Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: General question

From: "Michael Kay" <mike@--------.--->
To: <Smoother@---.-->, <xmlschema-dev@--.--->
Date: 8/3/2006 10:04:00 AM
It's a bit difficult to see from your example which elements are =
supposed to
"have the same structure": there are too many ellipses.

There are several ways you can achieve reuse of definitions. You can =
define
a base type that includes the common attributes, and then define =
additional
types derived by extension that add different child elements to this =
base
definition. Or you can make all your element (or type) definitions
independent top-level definitions, but have them pull in named attribute
groups or named model groups for cases where there are shared =
components.
(It's a bit like the two ways of achieving reuse in an object system:
inheritance and delegation.)

Michael Kay
http://www.saxonica.com/

> -----Original Message-----
> From: xmlschema-dev-request@w... 
> [mailto:xmlschema-dev-request@w...] On Behalf Of Smoother@g...
> Sent: 02 August 2006 17:28
> To: xmlschema-dev@w...
> Subject: General question
> 
> 
> Hello, I'm new to XML Schema. I've already read the Schema 
> tutorial at w3schools.com but I still have numerous questions:
> 
> First, I want to let you know what my XML file looks like:
> 
> <root template="rootpage">
>   <page1 template="journal">
>     <entry1027 template="entry" title="title for entry no. 
> 1027">...</entry1027>    <entryAlpha template="entry" 
> title="some other title">...</entryAlpha>
>   </page1>
>   <another-page template="a-template">...</another-page>
>   <another-page-2nd template="a-template">...</another-page-2nd>
>   ...
> </root>
> 
> 
> As you can see, the file is not strucutred by equal node 
> names (<page /><page /><page />) but nodes with same 
> structure have the same attribute "template".
> So instead of xs:element, I search for a possiblity to define 
> a schema for any unspecfific nodes which have a specific 
> attribute value in common.
> 
> Can somone please give an example?
> 
> - Thanks, S.R.
> -- 
> 
> 
> Echte DSL-Flatrate dauerhaft f=FCr 0,- Euro*. Nur noch kurze Zeit!
> "Feel free" mit GMX DSL: http://www.gmx.net/de/go/dsl
> 
> 


From mike@s... Thu Aug 03 08:13:06 2006
Received: from aji.w3.org ([133.27.228.225])
	by fr


transparent
Print
Mail
Digg
delicious
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