[Home] [By Thread] [By Date] [Recent Entries]

  • From: "Fraser Goffin" <goffinf@g...>
  • To: "XML Developers List" <xml-dev@l...>
  • Date: Thu, 9 Nov 2006 23:22:12 +0000

The 'name' element is declared to be in no namespace via your
elementFormDefault attribute value of 'unqualified'.

> In other words when working out the 'full' name of an element, does the
> definition of the default namespace effectively override the {no namespace}
> for a local element or not?

No. Thats just a namespace binding you're using within the schema, not
in an instance document.

Fraser.

On 09/11/06, Pete Cordell <petexmldev@t...> wrote:
> Hi,
>
> I've managed to confuse myself about namespaces and schemas - please help!
>
> If I define an unqualified local element such as 'name' in:
>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>        targetNamespace="http://www.abc.com" xmlns="http://www.abc.com"
>        elementFormDefault="unqualified">
>
>    <xsd:element name="MyAddress" type="AddressType"/>
>
>    <xsd:complexType name="AddressType">
>        <xsd:sequence>
>            <xsd:element name="name" type="xsd:string"/>
>        </xsd:sequence>
>    </xsd:complexType>
>
> </xsd:schema>
>
>
> Then, if I have the following instance:
>
> <MyAddress xmlns="http://www.abc.com">
>    <name>Pete</name>
> </MyAddress>
>
> when deciding what to validate 'name' against, is it treated as if it is {no
> namespace}:name, {http://www.abc.com}:name (in which case validation will
> fail) or something else?
>
> In other words when working out the 'full' name of an element, does the
> definition of the default namespace effectively override the {no namespace}
> for a local element or not?
>
> Going a bit further... if (validated by another schema) I have:
>
> <MyDetails xmlns="http://www.abc.com">
>    <ans:MyAddress xmlns:ans=http://www.abc.com/addr>
>        <name>Pete</name>
>    </ans:MyAddress>
> </MyDetails>
>
> Is name's full name {no namespace}:name (due to being defined as
> unqualified), {http://www.abc.com}:name (due to the default namespace being
> http://www.abc.com), or {http://www.abc.com/addr}:name (due to being local
> to ans:MyAddress)?
>
> Many thanks,
>
> Pete.
>
>
>
>
> _______________________________________________________________________
>
> XML-DEV is a publicly archived, unmoderated list hosted by OASIS
> to support XML implementation and development. To minimize
> spam in the archives, you must subscribe before posting.
>
> [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
> Or unsubscribe: xml-dev-unsubscribe@l...
> subscribe: xml-dev-subscribe@l...
> List archive: http://lists.xml.org/archives/xml-dev/
> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
>
>


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member