在Java中使用Xml的简单方法
问题描述:
是否有简单的方法在Java中读写Xml?
Is there is Simple way to read and write Xml in Java?
之前我使用过SAX解析器,但我记得它不直观,我看了在JAXB的几个教程中,它看起来很复杂。
I've used a SAX parser before but I remember it being unintuitive, I've looked at a couple of tutorials for JAXB and it just looks complicated.
我不知道我是否被C#的XmlDocument类所破坏,但我只想做是创建一个Xml文档,它代表一组类及其成员(有些是属性,有些是元素)。
I don't know if I've been spoilt by C#'s XmlDocument class, but All I want to do is create an Xml Document that represents a a set of classes and their members (some are attributes some are elements).
我会考虑序列化,但XML必须具有与ac#app的输出格式相同,我将其逆向工程为Java。
I would look into serialization but the XML has to have the same format as the output of a c# app which I am reverse engineering into Java.