Возможно разделить XML на несколько страниц с помощью XSLT?
С XSLT 2.0 - да используйте <xsl:result-document>
элемент:
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:template match="page">
<xsl:result-document href="page{position()}.html">
<html>
<head></head>
<body><xsl:value-of select="."/></body>
</html>
</xsl:result-document>
</xsl:template>
</xsl:stylesheet>
Результаты :
Saxon 9.1.0.5J from Saxonica
Java version 1.6.0_23
Stylesheet compilation time: 549 milliseconds
Processing file:/C:/Program%20Files/Java/jre6/bin/marrowtr.xml
Building tree for file:/C:/Program%20Files/Java/jre6/bin/marrowtr.xml using class net.sf.saxon.tinytree.TinyBuilder
Tree built in 4 milliseconds
Tree size: 7 nodes, 30 characters, 0 attributes
Loading net.sf.saxon.event.MessageEmitter
Writing to file:/C:/Program%20Files/Java/jre6/bin/page1.html
Writing to file:/C:/Program%20Files/Java/jre6/bin/page2.html
Execution time: 86 milliseconds
Memory used: 11480728
NamePool contents: 23 entries in 22 chains. 6 prefixes, 7 URIs
С XSLT 1.0 можно использовать элемент расширения EXSLT <exslt:document>
:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ext="http://exslt.org/common">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="page">
<ext:document href="page{position()}.html">
<html>
<head></head>
<body><xsl:value-of select="."/></body>
</html>
</ext:document>
</xsl:template>
</xsl:stylesheet>