Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: Include multiple complex types into one element ...

From: Dragon Fly <dragon-fly999@-------.--->
To: Michael Kay <mike@--------.--->, 'Andrew Welch' <andrew.j.welch@-----.--->
Date: 7/9/2008 6:00:00 AM
It makes sense.  Thanks again.

> From: mike@s...
> To: andrew.j.welch@g...=3B dragon-fly999@h...
> CC: xmlschema-dev@w...
> Date: Wed=2C 9 Jul 2008 13:49:38 +0100
> Subject: RE: Include multiple complex types into one element ...
> 
> 
> > - the element can be reused (so LastName can be used (ref'd) 
> > in multiple places)
> > 
> > - the element is defined in one place (so changing the type 
> > of LastName only needs to be done once=2C not everywhere that it's used=
)
> > 
> > - the types are exposed to applications=2C so you can match on 
> > type define variables as that type in schema-aware XSLT or XQuery
> > 
> > - it follows a consistent style=2C and turns the upper part of 
> > your schema into a data dictionary :)
> > 
> 
> And one more=2C if you consistently avoid using local element declaration=
s=2C
> then it's easier to avoid the trap of writing
> 
> <xs:element name="person"/>
> 
> when you meant
> 
> <xs:element ref="person"/>
> 
> It's a really nasty mistake to make=2C because your schema document is va=
lid
> and it validates all your valid instances=2C but it doesn't catch the val=
idity
> errors that you intended to catch. That's because <xs:element
> name="person"/> defaults to <xs:element name="person" type="xs:anyT=
ype"/>
> 
> I don't condemn local element declarations entirely=2C however. But I ten=
d to
> apply the rule that if you use a local element declaration then it should
> refer to a global type definition.
> 
> Michael Kay
> http://www.saxonica.com/
> 
> 

_________________________________________________________________
Making the world a better place one message at a time.
http://www.imtalkathon.com/?source=EML_WLH_Talkathon_BetterPlace=


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