Jump to content
Sign in to follow this  
swapna

Issue with the XSLT when input xml morethan 27MB

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...