转载自http://blog.csdn.net/fbysss/archive/2007/06/24/1664076.aspx
作者:fbysss
Blog:blog.csdn.net/fbysss
msn:jameslastchina@hotmail.com
声明:本文章由fbysss整理编写,转载或引用请注明引用地址。
关键字:qname
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
4.总结:qname无非是有着特定格式的xml元素,其作用主要是增加了名字空间,比如有同样的元素名称,而名字空间不同的情况。先了解这么多,请大家补充。
参考地址:
http://infohost.nmt.edu/tcc/help/pubs/pyxml/def-qname.html
原文如下:
A document may contain elements and attributes from more than one namespace URI. Because namespace URIs can be quite lengthy, it is cumbersome to include the complete namespace URI in each element or attribute name.
XML allows a shorthand notation to simplify assigning names to namespaces. You may invent a short namespace prefix and associate it with a namespace URI.
For example, suppose your document contains names from both the XSLT and XHTML namespaces. In this situation, it is customary to associate the namespace prefix “xsl” with XSLT. You might use prefix “html” to refer to the XHTML namespace.
A qualified name has three parts:
A namespace prefix.
A colon character, “:”.
A local name that gives the name of the element or attribute within that namespace.
For example, here is a fragment illustrating the use of qualified names:
<xsl:template match="separator">
<html:hr/>
</xsl:template>
Element template is in the XSLT namespace, and element hr is in the HTML namespace.
You can also use an unqualified name, which is just a local name without the namespace prefix. The namespace of such a name is called the default namespace.
The association between a namespace prefix and a namespace URI is made with an xmlns attribute located in some element. This attribute can have two forms:
An attribute named xmlns='nsURI' defines the namespace URI of the default namespace. This namespace is associated with all elements and attributes that have unqualified names.
An attribute named xmlns:prefix='nsURI' associates the given prefix with the namespace URI nsURI.
Here is an example of a complete document using elements from two namespaces:
<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>
In this example, the template element is in the XSLT namespace. The hr element is in the default namespace, which is associated with the XHTML namespace URI.
分享到:
相关推荐
qname.jar qname.jar
QName qname = new QName(namespaceURI, localPart, prefix); ``` #### 4. **库版本与兼容性问题** - **Bea WebLogic Server**: - 问题可能与使用的库版本有关,例如`com.bea.xml.stream.MXParser`。 - 如果...
1. Add the QName JAR file (qname.jar) into the WEB-INF/lib folder in your WAR file 2. Add a file weblogic.xml into the WEB-INF folder in your WAR file Below is an example weblogic.xml file: <!DOCTYPE ...
xmlbeans-qname.jar
JavaScript中的QName(全称限定名)是一种在XML和相关技术中广泛使用的概念,它用于唯一地标识元素、属性和命名空间中的其他项。QName由两部分组成:命名空间URI(Uniform Resource Identifier)和本地名称。js-...
, qualifiedName qName: String?, attributes attributeDict: [String : String]?) { currentElement = elementName } func parser(parser: NSXMLParser, foundCharacters string: String) { // 处理当前元素...
println("开始元素: $qName") } override fun endElement(uri: String?, localName: String?, qName: String?) { println("结束元素: $qName") } ``` 以上就是在Kotlin中使用SAX解析XML字符串的基本流程。SAX...
xmlbeans-qname.jar包含了对QName(XML命名空间限定名称)的支持,这对于处理XML Schema中的命名空间非常重要。 5. **jaxen-1.1-beta-2.jar**: Jaxen是一个独立于XML解析器的XPath库,它提供了在各种XML API(如...
, qualifiedName qName: String?, attributes attributeDict: [String : String] = [:]) func parser(_ parser: NSXMLParser, foundCharacters string: String) func parser(_ parser: NSXMLParser, didEndElement ...
, qualifiedName qName: String?, attributes attributeDict: [String : String] = [:]) { currentNodeName = elementName } func parser(_ parser: NSXMLParser, foundCharacters string: String) { current...
weblogic javax/xml/namespace/QName报错-附件资源
, qualifiedName qName: String?, attributes attributeDict: [String : String] = [:]) { currentElement = elementName } func parser(_ parser: NSXMLParser, foundCharacters string: String) { current...
, qualifiedName qName: String?, attributes attributeDict: [String : String] = [:]) { currentElement = elementName } func parser(_ parser: NSXMLParser, foundCharacters string: String) { if ...
, qualifiedName qName: String?, attributes attributeDict: [String : String] = [:]) { // 处理元素开始 } func parser(_ parser: NSXMLParser, foundCharacters string: String) { // 处理元素内容 } ...
, qualifiedName qName: String?, attributes attributeDict: [String : String] = [:]) { currentElementName = elementName currentValue = "" } func parser(_ parser: NSXMLParser, foundCharacters string...
你需要传递WSDL URL和服务QName(命名空间+服务名)来实例化服务对象。 ```java URL wsdlLocation = new URL("http://example.com/service?wsdl"); QName serviceName = new QName(...
, qualifiedName qName: String?, attributes attributeDict: [String: String] = [:]) { currentKey = elementName } func parser(_ parser: XMLParser, didEndElement elementName: String, namespaceURI: ...
在本文中,我们将深入探讨如何使用Apache Axis1.3框架构建自定义的SOAP(Simple Object Access Protocol)应用程序。SOAP是一种基于XML的协议,用于在Web服务中交换结构化信息。Apache Axis是Apache软件基金会开发的...
, qualifiedName qName: String?, attributes attributeDict: [String : String] = [:]) { currentElementName = elementName } func parser(_ parser: NSXMLParser, foundCharacters string: String) { // ...