[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|