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

Re: DSDL part 9: new namespace declarations not needed

  • To: John Cowan <jcowan@r...>
  • Subject: Re: DSDL part 9: new namespace declarations not needed
  • From: Dennis Sosnoski <dms@s...>
  • Date: Mon, 17 Jun 2002 12:34:12 -0700
  • Cc: xml-dev@l...
  • References: <200206171245.IAA19715@m...>
  • User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020529

changing xsd date format
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.)
>  
>



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.