先来看官方的解释:

[Definition:]   QName represents XML qualified names. The ·value space· of QName is the set of tuples {namespace name, local part}, where namespace name is an anyURI and local part is an NCName. The ·lexical space· of QName is the set of strings that ·match· the QName production of [Namespaces in XML]. 

 也就是说QName是由一个命名空间名称前缀和NCName(就是XML元素的名称)

csdn上的一个blog的解释:

Qname这个东东,在使用dom4j的时候,经常见到,可能是自己解析的xml都太简单了,所以没有仔细研究过,就是觉得名字很怪异,在google百度搜索“什么是qname”,居然只有几条没有像样答案的纪录。还好,在国外网站上找到了相关的解释,这下基本明白了。
1.来历:qname是qualified name 的简写
2.构成:由名字空间(namespace)前缀(prefix)以及冒号(:),还有一个元素名称构成
3.举例:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     xmlns
="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
     version
="1.0">
  
<xsl:template match="foo">
    
<hr/>
  
</xsl:template>
</xsl:stylesheet>
xsl是名字空间前缀,template是元素名称,xsl:template 就是一个qname 

相关文章:

  • 2021-09-21
  • 2021-05-17
  • 2021-10-09
  • 2022-02-08
  • 2022-03-02
  • 2022-01-20
  • 2021-10-06
  • 2021-11-18
猜你喜欢
  • 2021-07-07
  • 2022-12-23
  • 2021-06-20
  • 2022-02-08
  • 2022-01-16
  • 2021-12-12
相关资源
相似解决方案