EXSLT: No More DTM Identifiers

I have been looking for an answer to this problem all day. I am creating a stylesheet for a moderate-sized XML document (~ 1.5 MB, ~ 1000 elements), which causes me a lot of problems. This is about creating a graph of events and timelines for various process equipment installations. XML is created through the SAP MII QueryTempalte thingy and is in the format / Rowsets / Rowset / Row. All this data is processed and stored in the local node-set, in the format / Equipments / Equipment / Event. This node-set is then processed in HTML and then displayed in the browser. Now I'm in trouble. I can easily retrieve data from the last 5 days, which leads to ~ 900 rows of data from MII and is processed in my node format, which leads to a little less than 900 lines. But the second, I hit 1017 lines from MII, the stylesheet will only display half the path, and then the exception “No more DTM identifiers are available” stops. Now only JDK 1.5.x is running on the MII server, and I read that this could be a problem - just the thing, I can do nothing about it. So now I ask: is there a way to optimize my code? I linked some links for my XSL and XML sample.

XSL: http://pastie.org/1566517 Samlpe XML: http://pastie.org/1566522

Now the XML sample may not produce any “fun” visual results and may not be able to replicate the error. But if anyone could detect obvoius optimization, I would love to know :) I thought it would be nice to replace / move the calculations for startOffset, endOffset, etc., but I can’t figure out how to do this.

Hope someone can help me! :)

+4
source share
2 answers

Be aware that this question is outdated, but it has come to the same question itself, as those who also find this problem look like there is an SAP note describing a JVM patch that can solve this:

Note # 1604623

https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=1604623

One of the corrections in the note:

Improved resource consumption for XSLT conversion. We have detected a resource leak in XSLT processing that will result in the "DTMException: No More DTM Identifiers" error for complex XSL devices that use (recursive) templates. The reason for this problem is that the intermediate results of the processing step are stored in the DTM, and the number of DTMs is limited to 65536.

With this change, a new system property, "Com.sap.jvm.xsltc.enableResourceOptimization", appears. If this property is set to true, the XSLT compiler will produce intermediate results and therefore require less resources. Handling complex XSL should be possible. Please note that this system property is not set by default.

+2
source

Follow-up

We also encountered this problem with another application, the basis of the error is the same. As mentioned above, the main problem is the limitation of xalan, the Apache project for processing xslt documents. The restriction, although rarely caused, leads to the exhaustion of the maximum number of DTM 65535 identifiers (16 bits). In the above application, this can be avoided, apparently by using the resource allocation efficiency function in SAP, but this will not apply to other applications, such as the one we used.

Xalan change

Thus, the DTM 65K identifier was limited for some time (ca 2003), fixed, and then the patch in branch 2.7 was lost. The current, latest version 2.7.2 has this problem. At the most basic level, the document identifier is a 32-bit integer. A fix is ​​a change in source code that increases the number of bits reserved for the DTM. A more detailed discussion can be found here . The proposed hack is a change in the number of node bits to 12, which increases the fact that for a DTM to 20, the overall DTM increases to 1048576. Steps

  • download source xalan
  • unzip and modify src / org / apache / xml / dtm / DTMManager.java by changing the line that sets IDENT_DTM_NODE_BITS .
  • build xalan. You will probably need to install ant and set the class path accordingly . The new can will be located in the assembly directory.
  • replace the previous xalan can with the one you just built.
+5
source

Source: https://habr.com/ru/post/1339831/


All Articles