Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xml-dev] XML spec and XSD

From: Mukul Gandhi <gandhi.mukul@-----.--->
To: "Glidden, Douglass A" <Douglass.A.Glidden@------.--->
Date: 11/18/2009 12:59:00 AM
On Wed, Nov 18, 2009 at 2:21 AM, Glidden, Douglass A
<Douglass.A.Glidden@b...> wrote:
> - Certain fairly simple data structures can only be achieved in XSD (if at all) with ridiculously verbose patterns;

I agree, that XSD Schemas can be quite verbose sometimes. But I think,
that's some of the cost we probably incuur to achieve needed
functionality.

For example,

You may consider this element definition to be OK, and not verbose:

[1]
<xs:element name="x" type="xs:string" />

But you may consider this one as verbose:

[2]
<xs:element name="x">
  <xs:simpleType>
    <xs:restriction base="xs:string">
      <xs:enumeration value="a"/>
      <xs:enumeration value="b"/>
      <xs:enumeration value="c"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>

But a definition like this one [2], helps us realize a necessary (for
somebody) use case. Unfortunately, a certain amount of
syntax/verboseness is needed to express something.

If needed, somebody may use an IDE to write XSD Schemas, which can
help with (most of) the verboseness issues.

> - Most business logic cannot be represented, like "the value of the foo element must be less than or equal to the value of the bar element".

I think, this will be expressible in XSD 1.1, using assertions for e.g:

<xs:assert test="foo le bar" />

> - I occasionally was foiled by XSDs strict "no ambiguity" rules, which make it difficult to enforce rules such as "if the value of the foo element is xyz, then the bar and baz elements are required, but otherwise they are optional".

Again this should be possible to express with XSD 1.1 assertions, for
e.g something like:

<xs:assert test="if (foo eq 'xyz') then (bar and baz)" />


-- 
Regards,
Mukul Gandhi

_______________________________________________________________________

XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.

[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe@l...
subscribe: xml-dev-subscribe@l...
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.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