Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.
1. You can do it without xml processing at all. Just use regular exprssions to get <Book>....</Book> string and output them to different files by 250 per file.
2. You can do it thourgh SAX or XmlReader interfaces. Read portions of 250 Book elements and output them to different files. For me, i'll prefer SAX solution.
3. You can use DOM model, and traverse through Book elements saving them to file by 250. Easy to write this one :)
4. You can write XSLT to output to different files, something like this:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<xsl:for-each select="BookStore/Book">
<xsl:if test="position() mod 250=0">
<!-- change output file name here -->
</xsl:if>
<xsl:copy-of select="."/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
, but the mechanism to change output file depends on particular XSLT processor, so if tell us what's yout XSLT processor....we can help you more.
So, you see, there are number of options :)