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

Re: Validness, doctype, and Schema Instance

schema instance
>First of all, the XML specification, 
>http://www.w3.org/TR/2000/REC-xml-20001006, not only dictates the XML syntax, 
>but also includes the DTD language. Put it in another way; the spec is XML 
>syntax plus a schema language. Is that a correct interpretation/perspective?

It's not wrong, but it lacks historical perspective.

XML is a subset of SGML, which didn't separate well-formedness and
validity.  XML separated them, and more recently there have been other
schema languages invented.

>My conclusions from this reasoning, which surely can be wrong, is that for 
>example a XHTML document which looks like this:
><?xml version="1.0" encoding="UTF-8" ?>
><html xmlns="http://www.w3.org/1999/xhtml">
>   ...
>is _not_ valid XML, because it doesn't have a DOCTYPE thingy.

That's right.

>In other words, the XML specification ties the term "validness" to a 
>particular syntax, the DTD schema language. It's not an abstract term which 
>means "conforms to a model of the XML format", such that any schema language 
>can be used to "define" validness.

Just so.  When the XML spec was written, there were no other schema
languages for XML.

>But does it matter if a document is Not valid?

Not necessarily.  It's up to you.  Requiring a document to be valid is
a way of putting some constraints on it.  If you don't have any such
constraints (unlikely, unless you are writing some very generic
software like an editor), then there's no need for validity.  More
likely, not all your constraints can be expressed by a DTD, and you
will need to express them some other way.

And of course you can require the document to be valid according to
some other kind of schema, such as XML schemas or RelaxNG or

What "valid" means depends on context.  In the context of plain XML,
it means valid according to a DTD.  If there is ambiguity, use a term
like "DTD-valid" instead.

>The DTD specifies the logical structure, but also identifies /what/ type of 
>document it is, e.g. the public identifier. But isn't XML namespaces for 
>this?  When the XHTML namespace is declared in the xhtml element, wouldn't 
>that be enough?

Again, this lacks historical perspective.  XML namespaces were invented
after XML itself.

But even now that we have namespaces, a document using a given
namespace might conform to more than one DTD or schema.  Even your
example, XHTML, has "strict" and "transitional" DTDs.  New versions of
vocabularies may find it inconvenient to use a new namespace
(e.g. XSLT).  Or a vocabulary may be very general, and you may use
DTDs to require subsets of it.

-- Richard


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.
First Name
Last Name
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.