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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Fine namespace control in XML Schema

[ Lists Home | Date Index | Thread Index ]

Is it possible to add elements to distinct namespaces in an
XMLSchema and sub-elements to the global namespace
(since contect will disambiguate these nicely)?

E.g. Consider the following XML document:

----------------------------------------------------------------
<example xmlns:a="http://www.example.com/a";
   xmlns:b="http://www.example.com/b";>

 <a:frog>
  <name> Spotted tree frog </name>
  <colour> Blue with red spots </colour>
  <leap> minimal </leap>
 </a:frog>

 <b:frog>
  <name> Cane toad </name>
  <poison> Nasty </poison>
  <fecundity> enormous </fecundity>
 </b:frog>
</example>
----------------------------------------------------------------

It satisfies the RELAX NG schema

----------------------------------------------------------------
<grammar xmlns="http://relaxng.org/ns/structure/1.0";
   xmlns:a="http://www.example.com/a";
   xmlns:b="http://www.example.com/b";>

<start>
 <element name="example">
  <element name="a:frog"><ref name="frog"/></element>
  <element name="b:frog"><ref name="toad"/></element>
 </element>
</start>

<define name="frog">
 <element name="name"> <text/> </element>
 <element name="colour"> <text/> </element>
 <element name="leap"> <text/> </element>
</define>

<define name="toad">
 <element name="name"> <text/> </element>
 <element name="poison"> <text/> </element>
 <element name="fecundity"> <text/> </element>
</define>

</grammar>
----------------------------------------------------------------

I can't figure out how to disambiguate the two frog
elements in XML Schema (using XML namespaces).
I have looked at `any' and `elementFormDefault',
but neither seems to provide sufficient specifity.

Is there another way?

[ If not, is this kind of functionality on the cards for
XML Schema 1.1? ]


Many thanks

Daniel


--
Dr Daniel Prager
Research Fellow & Consultant
Deakin University & Freelance

Phone: +61 3 9251 7484
Web: www.deakin.edu.au/~danielp






 

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

Copyright 2001 XML.org. This site is hosted by OASIS