Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xml-dev] Enforcing use of xsi:type

From: George Cristian Bina <george@---------.--->
To: Paul Spencer <xml-dev-list@--------.--.-->
Date: 6/7/2006 1:45:00 PM
Hi Paul,

It is not clear if you are talking about elements with simple type or 
elements with complex type. If your elements have simple type then you 
can use an xs:union of the different identifier types.
If your elements have complex type then you can use an abstract type for 
them, thus you force the user to specify a non abstract type using 
xsi:type in the instance document.

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
www.---.com


Paul Spencer wrote:
> In the Election Markup Language, people may use a variety of identifiers
> depending on the type of election, country etc. The schema (XSD) therefore
> allows use of xsi:type in the instance so that the correct validation can be
> used for each identifier. I don't think that there is any way in XML Schema
> of forcing the use of the xsi:type attribute in the instance, so I am
> currently using Schematron rules to do this. Am I correct, or have I missed
> something obvious?
> 
> Before people point out that I am allowing the sender of the message to say
> what type of identifier they have, the Schematron (which changes for each
> scenario) also defines the allowed values for xsi:type. I would keep this,
> but it would be good if the schema itself enforced something as a hint to
> implementers to look at the spec and see what they need to do.
> 
> Regards
> 
> Paul Spencer
> 
> 
> -----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
> 
> The list archives are at http://lists.xml.org/archives/xml-dev/
> 
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://www.oasis-open.org/mlmanage/index.php>
>


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