如何使用 StAX 添加架构位置
我正在使用 StAX,并且想将架构位置添加到我的 xml 文件中。实现这一目标的最佳方法是什么?
I am using StAX and I want to add a schema location to my xml file. What is the best way to achieve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用 XMLStreamWriter,则可以仅使用 writeNamespace() 和 writeAttribute()(或仅使用 writeAttribute()) )。
输出:
对于
XMLEventWriter
,您应该能够通过add()
创建createAttribute()
来完成此操作。问候,
最大限度
If you use
XMLStreamWriter
, you can just usewriteNamespace()
andwriteAttribute()
(or justwriteAttribute()
).Output:
For
XMLEventWriter
, you should be able to do it byadd()
ing acreateAttribute()
.Regards,
Max