OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] what is the meaning of elementFormDefault="qualified"in a schema without a targetnamespace?

Hi Bryan,

The target namespace for that schema is absent. If you include the 
schema from another one that has a target namespace then the components 
from that schema will have that target namespace (I believe this is 
called chameleon schema).
See an example below:


<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
     <xs:include schemaLocation="common.xsd"/>


<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
     <xs:element name="test">
                 <xs:element name="a"/>
                 <xs:element name="b"/>

The following instance is valid against test.xsd

<?xml version="1.0" encoding="UTF-8"?>
<test xmlns="http://example.com";
     xsi:schemaLocation="http://example.com test.xsd">

Best Regards,
George Cristian Bina - http://aboutxml.blogspot.com/
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger

bryan rasmussen wrote:
> Hi,
> As per the subject line.
> I am looking over a rather big application with some XML schemas in
> which elementFormDefault is always given as qualified but there is no
> targetNamespace. This strikes me as weird because the implication is
> that one would have instances like this
> <t:test xmlns:t="" xsi:schemaLocation="myschema.xsd"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
> which by my understanding would be very illegal.
> Cheers,
> Bryan Rasmussen
> _______________________________________________________________________
> 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@lists.xml.org
> subscribe: xml-dev-subscribe@lists.xml.org
> 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]

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS