除了 XSLT 之外,XML 到 XML 转换还有哪些其他替代方案
我有大量 XML 文件(3000 多个唯一节点)需要从一种格式转换为另一种格式。我主要关心的是速度和内存使用情况。除了使用 StAX 以编程方式解析输入 XML 并使用 StAX 创建目标 XML 之外,是否还有 XSLT 的替代方案?
我知道有一个 STX 项目,但我认为它没有得到维护。
I've huge XML files (3000+ unique nodes) that need to be translated from 1 format to another format. My main concern is about the speed and memory usage. Are there any alternatives to XSLT for this other than programatically parsing the input XML using StAX and creating the target XML using StAX?
I know there is a STX project but I doesn't think it is being maintained.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您非常关心速度和内存使用情况,您可能想编写自己的 SAX 转换器。这是否足够简单取决于转换的复杂性。
也就是说,3000 个节点并不多,我已经使用 Apache Cocoon 来转换更大的文档。 STX 的效果也很好。不维护并不一定意味着它不起作用。
最好尝试现有的解决方案,然后根据需要进行改进。
If you are so concerned about speed and memory usage you might want to write your own SAX transformer. Whether that's easy enough depends on the complexity of the transformation.
That said - 3000 nodes is not much and I've used Apache Cocoon to transform much bigger documents. And STX worked well, too. Not maintained does not necessarily mean it's not working.
Better try the existing solutions and then improve as needed.
烟熏可以帮助你。方便快捷。 http://www.smooks.org/
Smooks can help you. Handy and fast. http://www.smooks.org/
我发现 JDom 对于 Java 中 XML 结构的简单编程操作很有帮助。
I've found JDom helpful for simple programmatic manipulation of XML structures in Java.