|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Navigating through the document using variables
> I have a variable initialized at runtime with the path to some element
> (something like this /elem1/elem2/elem3). Can I use this variable to
> navigate to the elem3 in another variable that is initialized with the
> document like this:
> <xsl:variable name="doc" select="document('./somedocument.xml')"/>
>
A number of products including Saxon support an xx:evaluate() extension
which allows you to evaluate an XPath expression that's held in a string (or
in a node in a source document), but it's not part of the standard XSLT 1.0
or 2.0 language. It's a very useful extension though!
You have to be careful with the context for the expression: both the static
context (in-scope variables, namespaces) and the dynamic context (context
item and position). You'll almost certainly find that different products
handle these questions differently.
Michael Kay
http://www.saxonica.com/
|
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
|






