Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Schema that mandates elements and attributes from disparate namespaces?

From: "Pete Cordell" <petexmldev@---------.--->
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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent