Java SGML to XML conversion?

扶醉桌前 提交于 2019-12-01 22:42:04

问题


Does anyone know of a method, or library, to convert SGML into XML?

EDIT: For clarification, I have to do the conversion in Java, and I cannot use the SP parser or the related SX tool.


回答1:


It seems that the general consensus is that there are no existing libraries for doing SGML work in Java. Certainly after several days of fruitlessly searching Google, and asking this question here, I have found no resources on this subject.




回答2:


The answer is not always that simple, as it depends on the sgml DTD. I haven't actually found a general SGML parser in Java at all, but this article uses SP which includes a converter.




回答3:


See http://jclark.com/sp/sx.htm for the SX converter from SGML to XML in the SP package.




回答4:


There is the mlParser, but I'm having a hard time trying to locate it: http://www.balisage.net/Proceedings/vol1/html/Smith01/BalisageVol1-Smith01.html




回答5:


There is no api for parsing SGML using Java at this time. There also isn't any api or library for converting SGML to XML and then parsing it using Java. With the status of SGML being supplanted by XML for all the projects I've worked on until now, I don't think there will every be any work done in this area, but that is only a guess.

Here is some open source code code from a University that does it, however I haven't tried it and you would have to search to find the other dependent classes. I believe the only viable solution in Java would require Regular Expressions.

Also, here is a link for public SGML/XML software.



来源:https://stackoverflow.com/questions/1504202/java-sgml-to-xml-conversion

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!