什么是QName
作者:fbysss 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 shortnamespace prefixand 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 “ Aqualified namehas three parts:
<xsl:template match="separator"> <html:hr/> </xsl:template>
Element You can also use anunqualified name,which is just a local name without the namespace prefix. The namespace of such a name is called thedefault namespace. The association between a namespace prefix and a namespace URI is made with an
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 来自:http://www.52php.cn/article/p-dzhswjce-bav.html (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |