Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#63 Problem with saxon and DOMSource

open
nobody
None
5
2012-10-08
2011-01-20
Michele G.
No

Hallo,

I have a DOM tree and i want to make a XSLT-transformation on this tree. Depending on where I am in the tree, I use a specific XSLT file for the transformation.

I have a function that performs the transformation. She gets as parameters the node (DOM subtree) and the path of the XSLT file

When I do somehting like that:
<xsl:variable name="numberOfCol">

<xsl:value-of select="//col"/>

</xsl:variable>

The returned numberOfCol is not right. I get the number of all col in the entire tree. But what I want, is the number of col in the subtree

What am I doing wrong ?

Thank you for your help.

PS: Sorry for my bad english

Discussion

  • Michael Kay
    Michael Kay
    2011-01-20

    When you are evaluating global variables in the stylesheet, the context item (.) is the node you specified as the initial context node, but "/" is the root of the tree containing the initial context node, which is the DOM Document node. If you want to select descendants of this node, use ".//col" rather than "//col".

     


Anonymous


Cancel   Add attachments