Java:将 XML 映射到其他 XML(翻译)
简而言之,我想制作一个java程序,它接受一个xml文件(格式x)作为输入,将其转换为XML格式y,也许对其做一些其他的事情,然后输出它。
格式 x 和 y 非常相似(都在 NLP 工具中使用,具有相同类型的标记等),并且我也有它们的描述模式。如果您好奇,我想将一些内容翻译为 TCF格式;在两个工具之间架起一座桥梁。
我以前从未这样做过,如何将一个 xml 映射到另一个 xml? 您能推荐一些库或工具吗? (不过,这必须在 Eclipse 中可用,并且应该是免费的)
到目前为止,我发现 来自 stylus studio 的这个程序< /a>,但它不是免费的,尽管它看起来很酷,但我不确定它的输出对我的 java 程序是否有任何用处。
如果此转换的结果是 XSLT,我可以在 java 中使用它吗? (这个 xslt 如何进行翻译?)(这样我可能会使用他们的 GUI 一次映射所有内容,然后在我的程序中以某种方式继续使用生成的 xslt)
非常感谢您对此事的任何启发!
To put this simply, I would like to make a java program that takes one xml file (in format x) as input, translate it to XML format y, maybe do some other stuff to it, and then output it.
Format x and y are fairly similar (both used in NLP tools, have same kind of tokens etc.) and I also have the description schemas for both of them. In case you're curious, I'd like to translate something to TCF format; make a bridge between 2 tools.
I've never done this before, how does one go about mapping one xml to another?
Can you recommend some libraries or tools? (this has to be usable in eclipse though, and should be free)
So far I found this program from stylus studio, but it's not free and even though it looks pretty cool, I'm not sure if it's output would be of any use for my java program.
If the result of this conversion is an XSLT, can I use it in java? (how does this xslt work for translating?) (so that I'd maybe use their GUI to map everything once, and then keep using the resulting xslt somehow in my program)
Many thanks for any shedding of light on the matter!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 XML 转换,它是由 jdk 内置的一组类实现的,请参阅
http://www.brics.dk/~amoeller/XML/transformation/index.html
获取教程。
Use XML Transformations, which is implemented by a set of classes built into the jdk, see
http://www.brics.dk/~amoeller/XML/transformation/index.html
for a tutorial.