Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Derivation of complex types using a global and local schema file

From: Nils Kaiser <NilsKaiser@---.--->
To: xmlschema-dev@--.---
Date: 11/19/2008 12:15:00 PM
Hi all,

I'm quite new to xml schema, especially to the area of overriding 
existing types (derivation, restriction, etc.). I have the following use 
case and I'd appreciate some input on the best way to model it in xml 
schema.

I have a template format in xml which is used to declare content using 
templates, lets say:

<page>
  <section template="intro">
     <input type="text" name="title">Welcome</input>
     <input type="longtext" name="body">Hello, welcome to the main 
page</input>
  </section>
  <section template="withpic">
     <input type="link name="picurl">http://.......</input>
     <input type="longtext" name="body">This is a wonderful picture</input>
  </section>
  <section template="withpic">
     <input type="link" name="picurl">http://.......</input>
     <input type="longtext" name="body">This is another picture</input>
     <input type="checkbox" name="position">left</input> <!-- optional, 
only values allowed left, right, center -->
  </section>
</page>

Now, there are two levels of declaration:
1) the basic elements page, section, input types  (link, longtext, 
checkbox...)
2) the sections depending on the value of the template attribute 
(withpic, intro), that restrict which input types can be used within 
this section.

I'd like to split both levels in different schema files, a global schema 
and a special schema, using the overriding mechanisms of xml schema 
(derivation, restriction, redefinition...). What is the best way to 
implement the overriding of the global schema by the local one?

Especially because the derivation depends on the attribute value 
(template=??) I am not sure how to implement this.

Thx for any hints or suggestions!

Nils



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