久久国产成人av_抖音国产毛片_a片网站免费观看_A片无码播放手机在线观看,色五月在线观看,亚洲精品m在线观看,女人自慰的免费网址,悠悠在线观看精品视频,一级日本片免费的,亚洲精品久,国产精品成人久久久久久久

分享

什么是QName

 yliu277 2019-07-21

看代碼時(shí)經(jīng)常碰到QName,,當(dāng)時(shí)對(duì)這個(gè)東東具體什么意思也是不太明白,;今天在看SOAP消息的時(shí)候,想到這個(gè)東東,,就去仔細(xì)看了下,。QName其實(shí)就是Qualified Name的簡(jiǎn)稱,在“NameSpaces in XML1.0(Third Edition)”(http://www./TR/REC-xml-names/#ns-qualnames)中有如下這段話:

URI references can contain characters not allowed in names, and are often inconveniently long, so expanded names are not used directly to name elements and attributes in XML documents. Instead qualified names are used. [Definition: A qualified name is a name subject to namespace interpretation. ] In documents conforming to this specification, element and attribute names appear as qualified names. Syntactically, they are either prefixed names or unprefixed names.

同時(shí)文中對(duì)QName的定義如下:

In XML documents conforming to this specification, some names (constructs corresponding to the nonterminal Name) MUST be given as qualified names,,defined as follows:

Qualified Name

[7]    QName    ::=    PrefixedName
      | UnprefixedName
[8]    PrefixedName    ::=    Prefix ':' LocalPart
[9]    UnprefixedName    ::=    LocalPart
[10]    Prefix    ::=    NCName
[11]    LocalPart    ::=    NCName

The Prefix provides the namespace prefix part of the qualified name, and MUST be associated with a namespace URI reference in a namespace declaration. [Definition: The LocalPart provides the local part of the qualified name.]

Note that the prefix functions only as a placeholder for a namespace name. Applications SHOULD use the namespace name, not the prefix, in constructing names whose scope extends beyond the containing document.

In XML documents conforming to this specification, element names are given as qualified names,;

Attributes are either namespace declarations or their names are given as qualified names.

也就是說QName分為兩種,一種是帶前綴的名字,,另一種是不帶前綴的,。若是帶前綴,,則前綴必須和命名空間的URI引用相關(guān)聯(lián),如

<namespace-prefix:envelope xmlns:namespace-prefix='namespaceURI'> ... </namespace-prefix:envelope>,其中<namespace-prefix:envelope>就是QName,;不帶前綴,,也就是說xml文件使用的默認(rèn)命名空間,如<rootElement xmlns='namespaceURI'> ... </rootElement>,,這里<rootElement>就是QName,;在xml文件中,元素和屬性都是用QName表示的,;

如果應(yīng)用程序在構(gòu)造QName的時(shí)候,,同時(shí)這個(gè)QName的范圍超過了其被包含的xml文檔,比如應(yīng)用程序是Java或C#程序,,那么在構(gòu)造QName的時(shí)候就需要使用命名空間,,而不是前綴,QName可以看做是一個(gè)包含了命名空間和local part的二元組,,如(namespace, local name).

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn),。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式,、誘導(dǎo)購買等信息,謹(jǐn)防詐騙,。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多