Altova Mailing List Archives>Archive Index >xmlschema-dev Archive Home >Recent entries >Thread Prev - Re: Extensible Enumerations Technique [Thread Next] Re: Schema that mandates elements and attributes from disparate namespaces?To: "Gavin Kistner" <phrogz@---.--->, <xmlschema-dev@--.---> Date: 3/14/2008 10:03:00 AM
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@w...>
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!
>
>
>
From phrogz@m... Fri Mar 14 18:46:31 2008
Received: from lisa.w3.org ([128.30.52.41])
by frink.w3 | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
