[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Enforcing use of xsi:type


xsi xml
Probably correct, if processors are operating correctly (big if),
given the following:

http://www.w3.org/2001/XMLSchema-instance


  <?xml version="1.0" ?>
  <!DOCTYPE xs:schema (View Source for full doctype...)>
- <xs:schema targetNamespace="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.w3.org/1999/xhtml" finalDefault="" blockDefault=""
elementFormDefault="unqualified" attributeFormDefault="unqualified">
- <xs:annotation>
- <xs:documentation>
  <h1>XML Schema instance namespace</h1>
- <p>
  See
  <a href="http://www.w3.org/TR/xmlschema-1/">the XML Schema Recommendation</a>
  for an introduction
  </p>
  <hr />
  $Date: 2001/03/16 20:25:57 $
  <br />
  $Id: XMLSchema-instance.xsd,v 1.4 2001/03/16 20:25:57 ht Exp $
  </xs:documentation>
  </xs:annotation>
- <xs:annotation>
- <xs:documentation>
- <p>
  This schema should never be used as such:
  <a href="http://www.w3.org/TR/xmlschema-1/#no-xsi">the XML Schema
Recommendation</a>
  forbids the declaration of attributes in this namespace
  </p>
  </xs:documentation>
  </xs:annotation>
  <xs:attribute name="nil" />
  <xs:attribute name="type" />
  <xs:attribute name="schemaLocation" />
  <xs:attribute name="noNamespaceSchemaLocation" />
  </xs:schema>

Cheers,
Bryan Rasmussen

On 6/7/06, Paul Spencer <xml-dev-list@b...> 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>
>
>

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.