cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Derek Hohls" <>
Subject Re: XPath problems in Cocoon?
Date Thu, 20 Feb 2003 10:51:52 GMT
What type of error message do you get in the log files?

>>> 20/02/2003 12:40:10 >>>

Hi all. I am not sure that this message is related to Cocoon, so I
if this is not appropriate here.
I have a very simple html - test.html:
<title>Test anchors</title>
<p>test anchors</p>
<a href="one.html">One</a>  <a href="two.html">Two</a>
<a href="one.html">One1</a>
<br />
<a href="two.html">Two1</a>
<a href="one.html">One2</a>
some text
<a href="two.html">Two2</a>
I want to choose the 'a' nodes for which first following node that is
not a white-space only node is 'a' node. E.g. in the html above only the
first 'a' node should be picked up.
I wrote a very simple xsl - test.xsl:
<xsl:stylesheet version="1.0"
<xsl:template match="/">
select="//a[name(following-sibling::node()[1][not(self::text() and
<xsl:value-of select="."/>
When I apply this stylesheet on my test.html using XMLSpy's XSL
Transformation Tool, I get this xml:
<root>One</root>, e.g. it chose correctly the first a node.
But when I apply this stylesheet using Cocoon, I get empty <root/> as a
result, e.g. in Cocoon nothing is chosen.
Here is my pipeline:
<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"/>
Can somebody explain me what is wrong with my stylesheet and why
doesn't it work using Cocoon?
Thank you very much for help and sorry if this is not too much
Best regards,

This message has been scanned for viruses and dangerous content by 
MailScanner, and is believed to be clean.

"The CSIR exercises no editorial control over E-mail messages and/or
attachments thereto/links referred to therein originating in the
organisation and the views in this message/attachments thereto are
therefore not necessarily those of the CSIR and/or its employees.  
The sender of this e-mail is, moreover, in terms of the CSIR's Conditions
of Service, subject to compliance with the CSIR's internal E-mail and 
Internet Policy."

View raw message