Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xml-dev] Restrictions on existence of attributes?

From: Eric van der Vlist <vdv@--------.--->
To: xml-dev@-----.---.---
Date: 7/6/2006 6:48:00 AM
ooops... Just found out how substitution groups can be better translated
in RELAX NG just after having pressed the send button. What I have
written would work, but here is a better way to express substitution
groups.

Compact syntax:

Head = element Head { BaseType }
Head |= element Restricted { RestrictedType }
Head |= element Extended { ExtendedType }
start = element Root { Head  }

XML Syntax:

  <define name="Head">
    <element name="Head">
      <ref name="BaseType"/>
    </element>
  </define>
  <define name="Head" combine="choice">
    <element name="Restricted">
      <ref name="RestrictedType"/>
    </element>
  </define>
  <define name="Head" combine="choice">
    <element name="Extended">
      <ref name="ExtendedType"/>
    </element>
  </define>
  <start>
    <element name="Root">
      <ref name="Head"/>
    </element>
  </start>

Explanation;

The first definition of the Head element is the definition of the
substitution group head and each of the following ones add a new element
as an option.

I think that this is near enough from W3C XML Schema substitution group
that it doesn't require to be marked by an annotation (tools could be
clever enough to detect this pattern) but an annotation could be added
(like I have shown in the previous mail) to make that more explicit.

This is also the case of derivation by extensions in which I had added
no annotation but could also carry one.

Eric
-- 
GPG-PGP: 2A528005
Don't you think all these XML schema languages should work together?
                                                         http://dsdl.org
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
(ISO) RELAX NG   ISBN:0-596-00421-4 http://oreilly.com/catalog/relax
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
------------------------------------------------------------------------

Ceci est une partie de message=?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e?=


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