开发者

JAXB Namespace Order

Is it possible to control the order of namespaces in documents generated via JAXB? I know, it is not relevant to XML standards, but somehow we need to generate namespace declarations in specific order? For example, currently we have generated

<rootelement a="http://www.example.com/xom" b="http://www.example.com/crops">
..
</rootelement>

But I need:

开发者_高级运维<rootelement b="http://www.example.com/crops" a="http://www.example.com/xom">
..
</rootelement>


JAXB does not directly supports that, but you can marshal your object to ContentHandler, XMLStreamWriter or XMLEventWriter and take care of the namespace and attribute ordering in there.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜