Using the ID function in xpath expressions
Posted: Tue Sep 25, 2007 12:04 pm
Hello,
i have created an xml-schema where some elements "A" that have an "id" attribute of type xs:ID and other elements "B" reference this attribute using xs:IDREF. Lets call this attribute "idref". I have also added key and keyref elements which work fine for the validation by making sure that the referenced attribute values in B in fact do exist in A. However, i now want to do resolve the referenced node A from a path pointing to B. From what i understood, this sould work something like that for all B:
//B/id(@idref)/elementOfInterestInA
However, this construct does not work in the xpath builder nor in a small xsl file i created. Do you possibly have any idea what may be a common mistake here? Thanks for your answers!
i have created an xml-schema where some elements "A" that have an "id" attribute of type xs:ID and other elements "B" reference this attribute using xs:IDREF. Lets call this attribute "idref". I have also added key and keyref elements which work fine for the validation by making sure that the referenced attribute values in B in fact do exist in A. However, i now want to do resolve the referenced node A from a path pointing to B. From what i understood, this sould work something like that for all B:
//B/id(@idref)/elementOfInterestInA
However, this construct does not work in the xpath builder nor in a small xsl file i created. Do you possibly have any idea what may be a common mistake here? Thanks for your answers!