in reply to splitting large xml documents
You coould always just use XSLT. Suppose your original XML is more along the lines of:
then an XSLT stylesheet such as this would do the trick:<NikuDataBus> <Header name="xyz"> <Customers> <customer name="x"> <address>1313 Mocking Bird Lane</address> </customer> <customer name="y" /> <customer name="z" /> </Customers> </Header> </NikuDataBus>
<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" /> <xsl:template match="customer"> <xsl:variable name="outFile" select="concat('customer.', @name, '.xml' )" /> <xsl:document method="xml" indent="yes" href="{$outFile}"> <NikuDataBus> <Header name="xyz"> <Customers> <xsl:copy> <xsl:copy-of select="*|@*"/> </xsl:copy> </Customers> </Header> </NikuDataBus> </xsl:document> </xsl:template> <xsl:template match="NikuDataBus"> <xsl:apply-templates select="Header/Customers/customer" /> </xsl:template> </xsl:stylesheet>
|
|---|