Thank you very much for answering and sorry to ask XSL question on Cocoon list. But now my problem stays only in Cocoon. I did as you advice and edited my test.xsl file to
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:strip-space elements="*"/> <xsl:template match="/"> <root> <xsl:for-each select="//a[name(following-sibling::node()[1][not(self::text() and normalize-space())])='a']"> <xsl:value-of select="."/> </xsl:for-each> </root> </xsl:template> </xsl:stylesheet> Now, if I apply this stylesheet on html file test.html using the batch file: c:\saxon\saxon -o outTest.xml testAnchors.html testAnchors.xsl I get the right answer: <root>One</root> and this is great. But when I tried to apply this stylesheet using cocoon, I still got the empty root element <root/> as a result. I.e. now my stylesheet works everywhere except for Cocoon. So I guess the problem that I have now IS with Cocoon. So I am really sorry to ask this again, but I still don't understand this issue. My pipeline is: <map:match pattern="testAnchors"> <map:generate src="ub/testing/test.html" type="html"/> <map:transform type="xslt-saxon" src="ub/testing/test.xsl"/> <map:serialize type="xml"/> </map:match> I would be happy to hear any suggestions. Thank you very very much for help. Anna ----- Original Message ----- From: "J.Pietschmann" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, February 20, 2003 11:16 PM Subject: Re: XPath problems in Cocoon? Anna Afonchenko wrote: > Even if the white spaces are supressed, the algorythm will stay right, > because algorythm should check all a tags that are followed by another a tag, > and the only node between them MAY (not MUST) be white-space only text node. The problem is here select="//a[name(following-sibling::node()[1][not(self::text() and ^^^^^ You select the following nodes including all text nodes ^^^^ The grab the first. For these two nodes in the source: <a href="one.html">One</a> <a href="two.html">Two</a> MSXML gets the second <a> element node, because it strips the text node with the space between the two <a> elements. All other processors see this text node instead of the second <a> node at this point and the whole select turns out empty. Add a <xsl:strip-space elements="*"/> to the beginning of your style sheet in order to get the same results for all processors. Alternatively, try select="//a[following-sibling::a[1][not(normalize-space())]" but perhaps you even want select="//a[following-sibling::a[not(normalize-space())][1]" instead. BTW you should ask XSLT questions on the XSLT list: http://www.mulberrytech.com/xsl/xsl-list/ J.Pietschmann --------------------------------------------------------------------- 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]> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]