XPath - Compare values from different documents

mkmajeed

New Member
This is my XPath expression\[code\]$XMLDESCRIPTION/myItems/ITEM[@TYPE="ok" and boolean($XML/myElements/element[ends-with(Description/@code, string(@CODE))])]\[/code\]The ITEM node in $XMLDESCRIPTION has an attribute called CODE and i want to check in $XML if there is an "element" with a Description/@code that matches the @CODE from $XMLDESCRIPTIONThe question is: how do I access the @CODE attribute in the $XML part of my filter?extra info:[*]I'm working in an XSLT context (I use stylevision)[*]The expression works fine if I type afixed value in the "ends-with" part instead of string(@CODE)XMLThis is my $XMLDESCRIPTION snippet\[code\]<myItems> <ITEM CODE="003423" TYPE="ok">Hello</ITEM> <ITEM CODE="003123" TYPE="ok">hello12</ITEM> <ITEM CODE="003223" TYPE="notok">Hellollo</ITEM> <ITEM CODE="005423" TYPE="notok">Hellolol</ITEM> <ITEM CODE="003424" TYPE="ok">HellossSSSDDFFSQSSQDFQSDF</ITEM> <ITEM CODE="003442" TYPE="ok">Helloee</ITEM> <ITEM CODE="003342" TYPE="ok">Hellodd</ITEM> <ITEM CODE="008900" TYPE="ok">Helloee</ITEM> <ITEM CODE="003888" TYPE="inprogress">Helloaa</ITEM></myItems>\[/code\]this is a snippet from my $XML document\[code\]<myElements> <element><Description code="009999">myinformation</Description></element> <element><Description code="008888">myinformation</Description></element> <element><Description code="003424">myinformation</Description></element> <element><Description code="002222">myinformation</Description></element> <element><Description code="003333">myinformation</Description></element> <element><Description code="005555">myinformation</Description></element></myElements>\[/code\]With those two xml examples my outcome should be "HellossSSSDDFFSQSSQDFQSDF" because that's the only element that has an existing description node with a code "003424" in $XML so that's the only ITEM element's content that the xpath should get.
 
Top