Hi all. I am not sure that this message is
related to Cocoon, so I apologize,
if this is not appropriate here.
I have a very simple html -
test.html:
<html>
<head>
<title>Test anchors</title>
</head>
<body>
<p>test anchors</p>
<a href="">One</a> <a
href="">Two</a>
<div>separator</div>
<a href="">One1</a>
<br />
<a href="">Two1</a>
<div>separator</div>
<a href="">One2</a>
some text
<a href="">Two2</a>
</body>
</html>
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"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<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>
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="" type="html"/>
<map:transform type="xslt-saxon" src=""/>
<map:serialize type="xml"/>
</map:match>
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 related.
Best
regards,
Anna
|
- Re: XPath problems in Cocoon? Anna Afonchenko
- Re: XPath problems in Cocoon? Derek Hohls
- Re: XPath problems in Cocoon? Anna Afonchenko
- RE: XPath problems in Cocoon? Laurent Comte
- RE: XPath problems in Cocoon? Derek Hohls
- Re: XPath problems in Cocoon? Derek Hohls
- Re: XPath problems in Cocoon? Anna Afonchenko
- Re: XPath problems in Cocoon? Emmanuil Batsis (Manos)
- Re: XPath problems in Cocoon? Anna Afonchenko
- RE: XPath problems in Cocoon? Laurent Comte
- Re: XPath problems in Cocoon? Anna Afonchenko