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

Re: XML spec and XSD

  • From: Mukul Gandhi <gandhi.mukul@gmail.com>
  • To: "Glidden, Douglass A" <Douglass.A.Glidden@boeing.com>
  • Date: Wed, 18 Nov 2009 06:27:45 +0530

Re:  XML spec and XSD
On Wed, Nov 18, 2009 at 2:21 AM, Glidden, Douglass A
<Douglass.A.Glidden@boeing.com> 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


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


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.