[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Schema that mandates elements and attributes

From: Pete Cordell <petexmldev@codalogic.com>
Date: Fri, 14 Mar 2008 10:03:07 -0000
Message-ID: <007c01c885ba$9e367740$b800a8c0@Codalogic>
To: "Gavin Kistner" <phrogz@mac.com>, <xmlschema-dev@w3.org>
Re: Schema that mandates elements and attributes

Hi Gavin,

You need to define three schema files (one for each namespace and the main 
one that is not associated with any namespace).  Then in, for example, the 
no-namespace schema, do:

    <xs:element ref="bar:charlie"/>

or:

    <xs:attribute ref="foo:msg"/>

The reffed to elements and attributed in the reffed XSD file do have to be 
global though.  I don't know whether this presents a problem when reffing 
parts of SVG.

HTH,

Pete Cordell
Codalogic
For XML C++ data binding visit http://www.codalogic.com/lmx/

----- Original Message ----- 
From: "Gavin Kistner" <>
To: <xmlschema-dev@w3.org>
Sent: Friday, March 14, 2008 2:01 AM
Subject: Schema that mandates elements and attributes from disparate 
namespaces?


>
> How can I write a schema that requires an XML file to have a structure 
> like the following?
>
>   <root xmlns:foo="http://foo.com" xmlns:bar="http://bar.com">
>     <alpha>This is in the default namespace</alpha>
>     <bravo foo:msg="This namespaced attribute is required on bravo 
> elements." >
>       <bar:charlie>This namespaced element is required as a child of 
> bravo.</bar:charlie>
>     </bravo>
>   </root>
>
> What I'm trying to do is create a specific derivation of SVG, that  allows 
> certain namespaced elements and attributes in specific  locations. I don't 
> want to just extend SVG to allow various non- namespaced attributes and 
> elements; I want to require those specific  namespaced items.
>
> Thanks in advance!
>
>
> 
Received on Friday, 14 March 2008 10:09:03 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.