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

Re: Does DTD validation work with namespaces?

  • From: Rick JELLIFFE <ricko@g...>
  • To: xml-dev@l...
  • Date: Tue, 15 Aug 2000 02:13:03 +0800

todd vincent
"Winchel 'Todd' Vincent, III" wrote:
 
> When I say, "new behavior rules" I do not mean you could simply allow new
> elements to be inserted into a well-formed document, from a different
> namespace, when you have this:
> 
> <!DOCTYPE Address [
> <!ELEMENT Address (Street+,City,State,PostalCode,Country) >
> <!ELEMENT Street (#PCDATA) >
> <!ELEMENT City (#PCDATA) >
> <!ELEMENT State (#PCDATA) >
> <!ELEMENT PostalCode (#PCDATA) >
> <!ELEMENT Country (#PCDATA) >
> ]>
> 
> That is, you can't do this:
> 
> <Address>
>  <H1>This is what I unilaterally decided to put here today.</H1>
>  <Street>2356 Peachtree Street</Street>
>  <City>Atlanta</City>
>  <State>Georgia</State>
>  <PostalCode>30302</PostalCode>
>  <Country>U.S.A.</Country>
> </Address>
> 
> I would not want to allow the insertion/mixing of <H1> either if the
> "Address" DTD were mine.
> 
> However, if the "parent" DTD (for lack of a better word) were to allow ANY
> in one or more places, then you could add otherwise undeclared elements from
> a different namespace where ANY content is allowed (along the lines of what
> I suggest to Marcus).  This would allow you to use elements from someone
> else's DTD without having to create one big DTD and you might also be able
> to take advantage of some of the Namespace features (defaulted prefixes, for
> instance), which I can't see how you would do otherwise.
> 
> Again, I could be way off base on this, but I'd appreciate any feedback.

XML Schemas seems to allow exactly what you are asking for: a wildcard
particle that lets you open up to different namespaces. (Note that XML
Schema's type derivation mechanism is not relevant here: extensions of
types are tacked on at the end of content.)

Schematron also allows this kind of thing easily.

If you are asking: is it possible to use DTD syntax to specify some
other set of constraints on top of the ones expressed in the usual DTD,
then that road has already been gone down: ISO Architectural Forms allow
you to declare markup declarations in an external entity. These
declarations are interpreted according to different rules than normal
DTDs, which can allow some special effects.

Finally, you can simply transformat your instance through XSLT into
various forms, and check these against specific DTDs. 

So you already have these four choices:
  1) Schematron: here now, small, not standardized, not shrink-wrapped
  2) XML Schemas: real soon now, big, to be vendors-standard, to be
shrink-wrapped
  3) Architectural Forms: here now, medium but hard to understand, ISO
standard, not really shrink-wrapped
  4) Transform: here now, medium complex, non-standard,
not-shrink-wrapped.  


Rick Jelliffe

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.