W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2012

Re: Can an element's QName value be without a prefix?

From: Michael Kay <mike@saxonica.com>
Date: Mon, 12 Mar 2012 23:04:54 +0000
Message-ID: <4F5E8116.3010809@saxonica.com>
To: xmlschema-dev@w3.org


On 12/03/2012 22:28, Costello, Roger L. wrote:
> Hi Folks,
>
> Suppose an element is declared to be of type QName:
>
> <element name="example" type="QName" />
>
> In an instance document, can the value of<example>  be without a namespace prefix:
>
> <example>Hello</example>
Yes.
>
>
> If yes, then what is the namespace URI for Hello?
>
> Suppose I declare a default namespace:
>
> <document xmlns="http://www.example.org">
>        <example>Hello</example>
> </document>
>
> Is Hello in the http://www.example.org namespace?
Yes.

See http://www.w3.org/TR/xmlschema11-2/#QName, which also discusses how 
QNames are validated if they appear in a context other than an XML 
document - basically it depends on the host language.

Michael Kay
Saxonica
>
Received on Monday, 12 March 2012 23:05:19 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 12 March 2012 23:05:19 GMT