在Java中使用Xml的简单方法 [英] Simple way to do Xml in Java

查看:73
本文介绍了在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.

推荐答案

我建议 XOM 。它的API清晰直观。

I recommend XOM. Its API is clear and intuitive.

这篇关于在Java中使用Xml的简单方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆