0

I have a XML where the elementcan come mixed upper or lower case.

<cXML>
  <Header>
    <To>
      <Credential domain="NetworkId">
        <Identity>AN01505149896</Identity>
      </Credential>
    </To>
  </Header>
</cXML>

This can also come like, where the ID can be all upper case:

<cXML>
  <Header>
    <To>
      <Credential domain="NetworkID">
        <Identity>AN01505149896</Identity>
      </Credential>
    </To>
  </Header>
</cXML>

I am using the below xPath to check it.

/cXML/Header/To/Credential[@domain='NetworkId']/Identity

Can you help me with the xpath which can ignore the case in xml

In my case the NetworkId can come like NetworkID or NETWORKID

Can you advice what can we do here in the xpath or xslt to pick up the data.

Thanks Yatan

Yatan
  • 89
  • 5
  • Which version of XSLT and/or XPath? – Martin Honnen Aug 18 '20 at 17:52
  • 2
    All versions of XSLT/XPath are covered in the duplicate link. Even if you don't want substring testing (`contains()`), the same techniques apply to string equality testing. For example, `/cXML/Header/To/Credential[translate(@domain, 'NETWORKID', 'networkid')='networkid']/Identity`, or some of the other ideas described there. – kjhughes Aug 18 '20 at 17:56

0 Answers0