I have a series of variable types like:
abc1A, abc1B, abc3B, ...
xyz1A, xyz2A, xyz3C, ...
data1C, data2A, ...
Stored in a variety of xml formats:
<area name="DataMap">
<int name="number" nullable="true">
<case var="abc2,abc3,abc5">11</case>
<case var="abc4,abc6*">8</case>
<case var="data1,xyz7,xyz8">22</case>
<case var="data3A,xyz{9},xyz{5A,5B,5C}">24</case>
<case var="xyz{6,4A,4B,4C}">20</case>
<case var="other01">15</case>
</int>
</area>
I'm hoping to query what an instance like xyz5A, for example, maps to. The query should return 24, but I don't know ahead of time if its reference in the xml node is explicit as in "xyz4A", or via a wildcard like "xyz4*", or in curly braces like above.
This queries for strings on that line and will return a hit successfully:
xpath '/area[@name="DataMap"]/int[@name="number"]/case[contains(@var,"xyz")][contains(@var,"5A")]'
But it also returns a hit for data5A which is not incorrect:
xpath '/area[@name="DataMap"]/int[@name="number"]/case[contains(@var,"data")][contains(@var,"5A")]'
Are there xpath/other query constructs that parse the inconsistent (but I assume valid) xml above? I only seem to be able to query against explicit string matches vs. the wildcard and curly braced formats.