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

Re: Does DTD validation work with namespaces?

  • From: Norman Walsh <ndw@n...>
  • To: xml-dev@l...
  • Date: Wed, 09 Aug 2000 14:49:04 -0400

Re: Does DTD validation work with namespaces?
/ Wayne Steele <xmlmaster@h...> was heard to say:
| I think you are mistaken.
| The kind of mixing of DTDs that you're discussing is perfectly legal and
| acceptable with XML 1.0.
| 
| If I declare
|    <!ELEMENT foo (#PCDATA)* >
|    <!ELEMENT FooList ( foo )+ >
| 
|    There is _NO_ constraint that foo elements only appear inside FooList
| elements.

True, but it is a constraint that only foo elements occur inside a FooList.

|    I could quite legally have <!DOCTYPE foo ... > in my document.
|    I could also have an internal subset, that declares
|       <!ELEMENT FooBarList ( foo | bar )* >
|    and then mix foo elements side-by-side with bar elements.

Nope, you couldn't. That would violate the "Unique Element Type
Declaration" validity constraint. You could get the desired effect
with appropriate parameter entities, though, so nevermind :-)

| As long as names don't clash, there should be no problem.
| If something in dtd1 had a content model on "ANY", I can now take any element
| I choose from dtd1 or dtd2, and stick it in there.

Right, but explicitly because you used the content model ANY in dtd1.
If dtd1 declares

  <!ELEMENT FooList ( foo )+ >

and dtd2 declares my:foo, you *cannot* say:

  <FooList><my:foo/></FooList>

| DTD Validation is intended to allow documents to specify the model and
| constraints they adhere to, not to force documents to conform to some outside
| spec.

Those are two sides of the same coin, aren't they? A document conforms
to the constraints that it claims to adhere to if and only if it
conforms to the DTD (outside spec) that defines the constraints.

|    2. XML Documents can always override or add their DTDs with an internal
| subset.

In practice, this requires that the external subset DTD be defined with
appropriate parameter entities.

|    3. A DTD cannot specify what the "root" or Document Element, or "DOCTYPE"
| should be. An XML document can declare itself to be any element that is
| defined in the DTD.

Yeah, but I don't see how that's relevant.

                                        Be seeing you,
                                          norm

-- 
Norman.Walsh@E... | Great men too make mistakes, and many among
XML Technology Center     | them do it so often that one is almost
Sun Microsystems, Inc.    | tempted to call them little
                          | men.--Lichtenberg

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.