xsl-list
[Top] [All Lists]

RE: value-of select="" on source XML while using apply-templates in a variable

2004-06-28 09:02:36

I have a varible which I iterate using apply-templates.
If I want t select an value from the source XML file, using
value-of select="//XMLDOCUMENT/ELEMENT"
I get nothing back.
While not applying templates inside an variable, I always 
have full access
to the XML file data.

Does anybody has an idea how to solve this problem?

Yes, anyone who's lurked on the list for more than a few days knows this
one: declare a global variable <xsl:variable name="root" select="/"/>, and
change your path expression to $root//XMLDOCUMENT/ELEMENT.

Incidentally, names beginning "XML" are reserved for future standardisation
(and in any case, calling something that isn't an XML document "XMLDOCUMENT"
seems designed to confuse the reader...).

Michael Kay



<Prev in Thread] Current Thread [Next in Thread>