What is the XSL selector for a node value where an attribute can be upper or lower-case (or a combination)? Here is an example (I've stripped off much of the XML that isn't relevant). The first has an attribute of "NetworkID". The latter is "networkid". I need to get the value of the "Identity" node.
Attribute is "NetworkID".
<?xml version="1.0" encoding="UTF-8"?>
<cXML payloadID="1541780158582-6094783182107158181@216.109.111.67" timestamp="2018-11-09T08:15:58-08:00">
<Header>
<To>
<Credential domain="networkid">
<Identity>AN01000000000-T</Identity>
</Credential>
</To>
</Header>
</cXML>
Attribute is "networkid".
<?xml version="1.0" encoding="UTF-8"?>
<cXML payloadID="1541780158582-6094783182107158181@216.109.111.67" timestamp="2018-11-09T08:15:58-08:00">
<Header>
<To>
<Credential domain="NetworkID">
<Identity>AN01000000000-T</Identity>
</Credential>
</To>
</Header>
</cXML>
Is there a way to do this so that it ignores case?
<xsl:value-of select="Header/To/Credential[@domain='networkid']/Identity"/>
In my application, the above works in one case. I am forced to change it manually to get it to work in the other (but it breaks the prior).
If you can use XSLT 2.0, then replace your:
with:
In XSLT 1.0, define:
then use: