Dynamic XPath Expression
If the variable $xPath contained the string value '/root/first'
could I do :-
I have to say from my initial testing this doesn't appear work and copy-of would just return the string itself not evaluate as an XPath expression, but I wondered whether there is a way of getting something like this to work ?
What I'm trying to do is compare aspects of one XML instance with another. There are a lot of comparisons I need to make and I don't really want to hard code in each individual test's XPath in an 'if' statement. So I was considering creating templates which match the portions of the document I want to compare and from that context recursing through matching each node found with the corresponding structure in the other doc :-
Doc 1 Doc 2 ==== ====
<FName>Fraser</FName> <-- OK --> <FName>Fraser</FName>
<LName>Goffin</LName> <-- OK --> <LName>Goffin</LName>
<FName>Luke</FName> <-- MISMATCH --> <FName>Marie</FName>
<LName>Goffin</LName> <-- MISMATCH --> <LName>Smith</LName>
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format