Re: [xml-dev] DSDL part 9: new namespace declarations not needed
by Dennis Sosnoski other posts by this author
Jun 17 2002 7:34PM messages near this date
Re: [xml-dev] DSDL part 9: new namespace declarations not needed
|
Re: [xml-dev] DSDL part 9: new namespace declarations not needed
This *does* look really nice - very concise, and easy to understand. I
hadn't looked at the compact format for RELAX NG before. Okay, I'll sign
up for replacing DTDs with RELAX NG, especially when/if the compact
syntax can be used interchangably with the XML version.
As for the validation issue, I see a lot of applications using XML and
very few of them use parser validation in normal operation. In some
cases I wish they would - too many applications silently ignore portions
of a document when it doesn't match what they're expecting. This is
often the case with SAX-based applications, since the event-driven
interface tends to encourage ordering assumptions in the code while
requiring extra effort to check that the assumptions are met. I see pull
parser interfaces as a big step forward here because they allow you to
make use of structure information in your code while simultaneously
making it easy to check that the document matches your expectations.
Incidentally, the whole approach to validating documents currently used
by most parsers (get a document, find and parse the schema, interpret
the schema against the document to validate) seems kind of bizarre to
me. It's very inefficient, and it also creates the opportunity for
disaster from changing the schema without changing the program to match
("the schema is not the application", to coin a paraphrase...).
Techniques that integrate the schema validation into the application
(such as some of the data binding frameworks) seem much more robust in
this respect.
- Dennis
John Cowan wrote:
> Dennis Sosnoski scripsit:
>
>
>
> >Simplicity and terseness are at the top of my list. The only real
> >problem with using DTDs now is Namespaces. The non-XML format is a pain,
> >but less so than the verbosity and complexity of Schemas. DTDs are
> >simple enough that they don't really require any special tools, in my
> >experience; Schemas do.
> >
> >
>
> How does this suit you?
>
> ## Simplified purchase order schema for Example.com.
> ## Copyright 2002 Example.com. All rights reserved.
>
> start = element purchaseOrder { purchaseOrderType }
>
> comment = element comment { text }
>
> purchaseOrderType =
> element shipTo { USAddress },
> element billTo { USAddress },
> comment?,
> element items { Items },
> attribute orderDate { text }
>
> USAddress =
> element name { text },
> element street { text },
> element city { text },
> element state { text },
> element zip { xsd:decimal },
> attribute country { xsd:NMTOKEN "US" }
>
> Items =
> element item {
> element productName { text },
> element quantity {
> xsd:positiveInteger params { maxExclusive = "100" }
> },
> element USPrice { xsd:decimal },
> comment?,
> element shipDate { xsd:date },
> attribute partNum { SKU }
> }
>
> ## Stock Keeping Unit, a code for identifying products -->
> SKU = xsd:string params { pattern = "d{3}-[A-Z]{2}" }
>
> (This schema slavishly imitates the one in XS-0, and is not an example
> of my personal style.)
>
>
-----------------------------------------------------------------
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://lists.xml.org/ob/adm.pl>
Thread:
John Cowan
Marcus Carr
Eric Bohlman
Marcus Carr
james anderson
james anderson
james anderson
Marcus Carr
Arjun Ray
Marcus Carr
Arjun Ray
John Cowan
Arjun Ray
John Cowan
Arjun Ray
John Cowan
Arjun Ray
John Cowan
Deborah Aleyne Lapeyre
John Cowan
Thomas B. Passin
Ronald Bourret
Ronald Bourret
Michael Kay
Thomas B. Passin
james anderson
David Carlisle
james anderson
David Carlisle
james anderson
David Carlisle
james anderson
Michael Kay
james anderson
David Carlisle
Tim Bray
Ronald Bourret
Ronald Bourret
Ronald Bourret
Arjun Ray
John Cowan
Arjun Ray
John Cowan
Arjun Ray
John Cowan
John Cowan
james anderson
John Cowan
Rick Jelliffe
Arjun Ray
John Cowan
Rick Jelliffe
Rick Jelliffe
Dennis Sosnoski
John Cowan
Dennis Sosnoski
John Cowan
Dennis Sosnoski
Arjun Ray
G. Ken Holman
John Cowan
Arjun Ray
james anderson
Arjun Ray
John Cowan
Arjun Ray
Rick Jelliffe
John Cowan
Arjun Ray
John Cowan
John Cowan
james anderson
John Cowan
james anderson
james anderson
John Cowan
james anderson
james anderson
John Cowan
Ronald Bourret
Ronald Bourret
Jonathan Borden
Ronald Bourret
Michael Fuller
John Cowan
Bob Hutchison
james anderson
Thomas B. Passin
John Cowan
Ronald Bourret
John Cowan
Thomas B. Passin
Ronald Bourret
Ronald Bourret
james anderson
Norman Walsh
K. Ari Krupnikov
John Cowan
John Cowan
K. Ari Krupnikov
John Cowan
G. Ken Holman
Ronald Bourret
Rick Jelliffe
John Cowan
Marcus Carr
G. Ken Holman
John Cowan
Michael Fitzgerald
Paul Prescod
John Cowan
John Cowan
|