Hi Konstantin. I know that my stylesheet works without Cocoon, I ran it through the batch file, using saxon. Even if I just run it using XSL Transformation of XMLSpy, it works fine, and chooses the //p tags as it should. So I am sure the problem is with Cocoon, but I don't understand, if it's my problem giving cocoon some wrong parameters (I don't know how this could happen) or maybe it is Cocoon problem? Using //node-name is a common XPath expression, it should work.
Maybe somebody knows what's wrong? Does nobody having problems with matching this kind of XPath expression in Cocoon? It is very important for me, so if somebody can give me a hint of where the problem lies, I would really appreciate this. Thank you very much for helping Anna ----- Original Message ----- From: "Konstantin Piroumian" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, December 18, 2002 3:17 PM Subject: Re: XPath problem in Cocoon? Anna, (please avoid HTML emails) Cocoon uses underlying XSLT engine to perform the transformation, so either this is just an XSLT problem in your code or a problem of the Xalan or XSLTC (which one is used). You can simply check if your stylesheet works without Cocoon: run Xalan from the command line with your XML as input and see what happens. Konstantin ----- Original Message ----- From: Anna Afonchenko To: cocoon-users Sent: Wednesday, December 18, 2002 16:01 Subject: XPath problem in Cocoon? Hi all. Another question for today: I wrote a small xsl that matches p nodes from the input and prints their content. I wrote it like this: <xsl:template match="/"> <xsl:for-each select="//p"> <xsl:text>Content of this tag is </xsl:text> <xsl:value-of select="."/> </xsl:for-each> </xsl:template> Then I run this stylesheet through cocoon pipeline. I get empty result, e.g. the for-each didn't match any p node in the input xml file. But there are p tags in the input. Moreover, if I change the for-each statement to <xsl:for-each select="descendant::node()[name()='p']"> It executes correctly! Can anyone explain to me, why Cocoon doesn't match //node-name? In XPath both //node-name and descendant::node()[name()='node-name'] have the same meaning. I dont want to use descendant::... style because I have this stylesheet get the XPath expression to match from some external xml file, and it is really a headache (if possible at all) to change all my //node-name expressions to descendant::node()[name()='node-name'] style. Please explain this mistery to me. Thank you very much for help. I know I am writing too many e-mails to the group these days, but since I am very new to Cocoon, I get stuck every few minutes on something new. Regards, Anna --------------------------------------------------------------------- Please check that your question has not already been answered in the FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html> To unsubscribe, e-mail: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]> --------------------------------------------------------------------- Please check that your question has not already been answered in the FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html> To unsubscribe, e-mail: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]>