用于冒号分隔标签的XML Parser? [英] XML Parser for colon-separated tags?

查看:200
本文介绍了用于冒号分隔标签的XML Parser?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我有冒号分隔的xml标签,如< my:tag> ,哪个库提供了简单的解析和值操作?我该怎么办?

If I have colon separated xml tags like <my:tag>, which library provides easy parsing and value manipulation? What do I have to look for?

推荐答案

我的之前冒号是一个命名空间前缀,并且在相同的元素或其中一个封闭元素上应该有一个属性 xmlns:my 名称空间URI 与前缀相关联。所有标准Java XML技术都支持命名空间(随JRE提供的SAX,DOM和StAX以及JDOM和XOM等第三方库),您需要记住的是,您通常使用命名空间URI引用任何API中的元素和本地名称(冒号后面的位),而不是具体的前缀。

The my before the colon is a namespace prefix, and there should be an attribute xmlns:my on either the same element or one of its enclosing elements somewhere higher up which associates a namespace URI with the prefix. All the standard Java XML technologies support namespaces (SAX, DOM and StAX provided with the JRE as well as third party libraries like JDOM and XOM), the thing you need to remember is that you generally refer to elements in any API using the namespace URI and local name (the bit after the colon), not the prefix specifically.

这篇关于用于冒号分隔标签的XML Parser?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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