E
Erhard Schwenk
Hi there,
Maybe this is a faq, if so, point me the URL please.
I have to do some xml to xml transformations in xslt, where I have -
simplified - the following:
input:
<doc>
<a/><a/><b/><a><a><a><b/><a><b/><a><a>
</doc>
output:
<doc>
<section><x/><x/></section>
<section><y/><x/><x/><x/></section>
<section><y/><x/></section>
<section><y/><x/><x/>
</doc>
e.g. I want to transform <a/> to <x/> and <b/> to <y/>, but start a
new section at each <b/>
For Example, you could think of a Text with headlines and paragraphs
and I want to start a new Page at each Headline.
Now there is the question, how to do this in xslt. Some Idea was the
following:
<section>
<xsl:apply-templates select="All a-nodes before the first b-node"/>
</section>
<xsl:for-each select="b">
<section>
<xsl:apply-templates select="b"/>
<xsl:apply-templates select="all following a-nodes up to the next
b-node"/>
</section>
</xsl:for-each>
My Problem are now the two xpath-Expressions "All a-nodes before the
first b-node" and "all following a-nodes up to the next b". Googling
around I did not find any useful tips on this, so perhaps someone here
has an Idea?
MfG,
Maybe this is a faq, if so, point me the URL please.
I have to do some xml to xml transformations in xslt, where I have -
simplified - the following:
input:
<doc>
<a/><a/><b/><a><a><a><b/><a><b/><a><a>
</doc>
output:
<doc>
<section><x/><x/></section>
<section><y/><x/><x/><x/></section>
<section><y/><x/></section>
<section><y/><x/><x/>
</doc>
e.g. I want to transform <a/> to <x/> and <b/> to <y/>, but start a
new section at each <b/>
For Example, you could think of a Text with headlines and paragraphs
and I want to start a new Page at each Headline.
Now there is the question, how to do this in xslt. Some Idea was the
following:
<section>
<xsl:apply-templates select="All a-nodes before the first b-node"/>
</section>
<xsl:for-each select="b">
<section>
<xsl:apply-templates select="b"/>
<xsl:apply-templates select="all following a-nodes up to the next
b-node"/>
</section>
</xsl:for-each>
My Problem are now the two xpath-Expressions "All a-nodes before the
first b-node" and "all following a-nodes up to the next b". Googling
around I did not find any useful tips on this, so perhaps someone here
has an Idea?
MfG,