Peter Gerstbach
Usenet Archive
- Joined
- Aug 11, 2004
- Messages
- 13
- Reaction score
- 0
Hello,
I need help on the new xsl:document element!
I'm using XSLT version 1.1 to be able to use the <xsl:document> element, because I need more than 1 output files. I'm using Saxon 6.5.3
My problem is the following. My XML document is a OpenOffice-document. There are headers and text underneath. But unfortunately the text elements are not nested in the header elements.
See this simple example:
<h>header 1</h>
<p>text</p>
<p>text</p>
<h>header 2</h>
<p>once more text</p>
<p>and so on</p>
Now I have the folowing Problem. I want to put each header with all subsequent text in one seperate file. To write into a new file I have to use the "document" element as follows:
<xsl:document href="file.txt">
blahblah
</xsl:document>
So I have to write the XSLT like that:
<xsl:for-each select="h">
<xsl:document href="file.txt">
Include headers and text here...
</xsl:document>
</xsl:for-each>
But this pull-based approach is very frustrating for a very big text document. Does anybody know how to handle this in a push-based way with templates?
Thanks a lot!
Peter
P.S: I crossposted this question in german on de.comp.text.xml
I need help on the new xsl:document element!
I'm using XSLT version 1.1 to be able to use the <xsl:document> element, because I need more than 1 output files. I'm using Saxon 6.5.3
My problem is the following. My XML document is a OpenOffice-document. There are headers and text underneath. But unfortunately the text elements are not nested in the header elements.
See this simple example:
<h>header 1</h>
<p>text</p>
<p>text</p>
<h>header 2</h>
<p>once more text</p>
<p>and so on</p>
Now I have the folowing Problem. I want to put each header with all subsequent text in one seperate file. To write into a new file I have to use the "document" element as follows:
<xsl:document href="file.txt">
blahblah
</xsl:document>
So I have to write the XSLT like that:
<xsl:for-each select="h">
<xsl:document href="file.txt">
Include headers and text here...
</xsl:document>
</xsl:for-each>
But this pull-based approach is very frustrating for a very big text document. Does anybody know how to handle this in a push-based way with templates?
Thanks a lot!
Peter
P.S: I crossposted this question in german on de.comp.text.xml