Hi Luke,
Try something like...
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="doc">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates select="page-break"/>
</xsl:copy>
</xsl:template>
<xsl:template match="doc/page-break">
<page>
<xsl:variable name="this-id" select="generate-id()"/>
<xsl:apply-templates
select="preceding-sibling::node()[generate-id(following-sibling::page-break)
= $this-id]"/>
</page>
<xsl:if test="not(following-sibling::page-break)">
<page>
<xsl:apply-templates select="following-sibling::node()"/>
</page>
</xsl:if>
</xsl:template>
<xsl:template match="*">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="@* | text() | comment() | processing-instruction()">
<xsl:copy/>
</xsl:template>
</xsl:stylesheet>
HTH
Marrow
http://www.marrowsoft.com - home of Xselerator (XSLT IDE and debugger)
http://www.topxml.com/Xselerator
"Łukasz" <lu***@digisign.pl> wrote in message
news:ch**********@atlantis.news.tpi.pl...
Hello,
i've short question. How convert this XML:
<doc>
<t1>
...
<t1>
<page-break/>
<t2>
...
<t2>
</doc>
into this:
<doc>
<page>
<t1>
...
<t1>
</page>
<page>
<t2>
...
<t2>
</page>
</doc>
please help!
Luke