Jump to content

Issue with the XSLT when input xml morethan 27MB


swapna

Recommended Posts

Hi! I am using xalan2.7.1 and Java1.7I wrote xsl to transform the inputxml to output xml.In my application, when I do the Transformation for eachtime the input xml is increasing. Becoz everytime results are adding to my input xml.For ex ..first time its 13MB.second time its 19MB.. when I reached to 27MB , I am getting the following error. org.apache.xml.dtm.DTMException: No more DTM IDs are available I tried with INCREMENTAL and NOOPTIMIMIZE , but no use. Any one has any idea reagarding the same. Please let me know. ThanksSwapna

Link to comment
Share on other sites

It is possible by any chance that you could split your XML file into several ones (and process them separately) OR use a SAX parser to only process fragments at a time?XSLT 1.0, as well as XSLT 2.0, does not have any "stream" capabilities - all of your content is parsed and held into memory. Because the presentation of a node takes more memory that the textural representation, combined with the fact that some DOM implementations place internal IDs to make DOM more efficient, transformation ends up taking a lot of memory... so much so, that all possible internal ID values are exhausted. I don't know if Apache's DTM has a setting of turning off internal IDs, but if it does, that means that your transformation will take significantly more time to process.XSLT 3.0 is planned to have streaming capabilities, but that's for the far future (well, a few years, up to a decade really; you know how fast technology is moving). For now, SAX and file splitting are the solutions.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...