简体   繁体   English

如何:使用POJO和XSLT文件进行XML转换

[英]How to: XML Transformation using POJO and XSLT file

I am new to xml transformation. 我是xml转换的新手。

What I've done is to moved my xml to POJO due to JAVA Heap Space Error due to large XML file. 我做的是由于XML文件大而导致JAVA堆空间错误,将xml移动到POJO。

XML + XSLT File ----> XML

is this possible doing this? 这有可能吗? How? 怎么样?

POJO ----> XSLT File ---- XML

can you give me example. 你能举个例子吗? Thanks! 谢谢!

XSLT can't process POJOs, morover, as mentioned in https://bytes.com/topic/net/answers/492204-xsltranslation-large-xml-file-using-java-results-outofmemory https://bytes.com/topic/net/answers/492204-xsltranslation-large-xml-file-using-java-results-out-memory中所述,XSLT无法处理POJO,也就是morover。

In general, XSLT can't operate as a streaming processor, since its use of XPaths assumes the entire document is available in memory (or at least can be re-read) at once 通常,XSLT不能用作流处理器,因为它对XPath的使用假定整个文档可以一次在内存中使用(或至少可以重新读取)。

So maybe you need to try this advice from the same post: 因此,也许您需要在同一篇文章中尝试以下建议:

Sometimes, if you have to process large documents, the only good answer is to drop down from XSLT to a lower level and code the processing yourself as a direct SAX application 有时,如果您必须处理大型文档,唯一的好答案是从XSLT降到较低级别,然后将处理本身编码为直接SAX应用程序

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM