ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> xml-dev
xml-dev
Re: Does DTD validation work with namespaces?
by Winchel 'Todd' Vincent, III other posts by this author
Aug 14 2000 3:30PM messages near this date
[] DTD validation [can] work with namespaces [] | Re: Does DTD validation work with namespaces?
This message, sent last night, appears not to have made it to the list
because of email problems.  I am reposting it.  My apologies if anyone gets
it twice.

Norman, this email also addresses the "arbitrary mixtures" that you don't
like.  If I specify ANY in my DTD, then the mixtures aren't arbitrary
anymore.  Anyhow, I won't bother you with this issue anymore.  Thanks,  Todd


<NormanWalsh> 
>  My personal, default model of validation is very strict and draconian.
>  A document is valid if and only if every child of element 'A' is
>  listed in the content model of element 'A' and the children occur in a
>  number and sequence that is allowed by the content model in question.
> 
>  So, in my model, you cannot have
> 
>    <foo:a><bar:b/></foo:a>
> 
>  unless the content model of foo:a explicitly allows bar:b as its first
>  and only child. (Where "explicitly allows" may include DTD-style ANY
>  content models or XML Schema style "selective any" content models).
> 
>  This is irrespective of whether or not you are in control of the
>  schemas that you're using.
> 
>  This is *clearly* not the only validation model that one could imagine.
>  It is *equally clear* that this model doesn't work in all cases.
</NormanWalsh> 

Norman:

This is the same idea of validation that I have as well.  The question is
the rules/means by which you allow/declare additional elements where the DTD
allows ANY.  I just wrote the following to Marcus Carr:

===========
Why couldn't you use this same idea, but instead of relying on finding a
DOCTYPE (which would mean a change in XML 1.0), you simply pay attention to
the declared namespace and use the namespace URI to go fetch a DTD.  I may
be way off base on this, but it seems to me, this would not require a change
in DTD syntax.  It would not require a change in Namespace syntax.  It would
simply mean a change in the rule that the resource at the end of the URI is
irrelevant and it would mean extra work (and new behavior rules) for a DTD
validating parser.  I mentioned in an earlier post the difference between
(1) non-validating parser (2) validating parser (which everyone understands)
and (3) a proposed DTD-Namespace-aware validating parser.
==========

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.

Thanks,

Todd
Thread:
Paul W. Abrahams
Rick JELLIFFE
W. E. Perry

Jonathan Borden
Simon St.Laurent
Jonathan Borden
Simon St.Laurent
John F. Schlesinger
Jonathan Borden
Simon St.Laurent
W. E. Perry
John Cowan
Rick JELLIFFE
Rick JELLIFFE
Sean McGrath
Simon St.Laurent
Jonathan Borden
Sean McGrath
Rick JELLIFFE
Rick JELLIFFE
Simon St.Laurent
James Robertson
Simon St.Laurent
Jonathan Borden
Simon St.Laurent
Paul W. Abrahams
Jonathan Borden
Paul W. Abrahams
Rick JELLIFFE
Dan Vint
Rick JELLIFFE
Marcus Carr
Michael Champion
John Cowan
John Cowan
John Cowan
Michael Champion
Winchel 'Todd' Vincent, III
John Cowan
Jonathan Borden
sam th
Jonathan Borden

Simon St.Laurent
John Cowan
John Cowan
John Cowan
Simon St.Laurent
Richard Lanyon
John Cowan
Jonathan Borden
John Cowan
Simon St.Laurent
John Cowan
Jonathan Borden
Rick JELLIFFE
james anderson
Winchel 'Todd' Vincent, III
Winchel 'Todd' Vincent, III
Rick JELLIFFE

Norman Walsh
Jonathan Borden
Winchel 'Todd' Vincent, III
Jonathan Borden
Norman Walsh
Winchel 'Todd' Vincent, III
Amy Lewis

Eric Bohlman

John Cowan
Simon St.Laurent
Jeff Greif
Jonathan Borden
Elliotte Rusty Harold
Sean McGrath
Simon St.Laurent
Joe English
Simon St.Laurent
Jonathan Borden
Simon St.Laurent
W. E. Perry
Jonathan Borden
John Cowan
John Cowan
Sean McGrath
W. E. Perry
John F. Schlesinger
Sean McGrath
Michael Champion
Michael Champion
Paul W. Abrahams
John Cowan
Paul W. Abrahams
Paul W. Abrahams
Simon St.Laurent
Martin Gudgin
Jonathan Borden
Simon St.Laurent
Tim Bray
Jonathan Borden
Jack Rusher
Steve Rowe

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved