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