问题
I have a xml file generated using moxy implementation of jaxb. However standalone value does not appear in the xml document.
回答1:
Note: I'm the EclipseLink JAXB (MOXy) lead and a member of the JAXB (JSR-222) expert group.
The standalone
attribute is seldom used, and is only relevant if you are using a DTD. Since JAXB (JSR-222) is primarily used with XML Schema it doesn't apply. We chose not to output that attribute in the MOXy implemenation of JAXB (JSR-222).
Other XML technologies chose not to support the standalone attribute as well. For example I am not aware of a way to output a standalone value using a StAX parser.
For More Information
- http://www.xmlplease.com/xml/xmlquotations/standalone
来源:https://stackoverflow.com/questions/12260436/standalone-value-does-not-appear-in-xml-generated-by-moxy-jaxb