【发布时间】:2022-12-01 22:16:42
【问题描述】:
I have the following xsd schema:
<Person>
<Gender>
<Any>
I have the following xml:
<Person>
<Gender>Male</Gender>
<Name>
<firstName>Elon</firstName>
<lastName>Musk</lastName>
</Name>
</Person>
I want to print the the text "Tesla" if the lastname is equal to "Musk".
I started with a template-match but I cannot access the Any-element.
Any good suggestions on how to access an -element in xslt?
I tried writing an template-match for this but I was not able to access the Any-element as expected.
<xsl:template match="/Person//* = 'Musk'">
<text>Tesla</text>
</xsl:template>
【问题讨论】: