[DAS2] Re: Apollo and DAS/2 priorities

Dave Howorth dhoworth at mrc-lmb.cam.ac.uk
Mon Feb 6 14:27:34 UTC 2006


Andrew Dalke wrote:
> Dave Howorth:
>> Doing that automatically invalidates the document does it not?
>>
>> http://www.w3.org/TR/2004/REC-xml-20040204/#NT-prolog
>>
>> "Definition: An XML document is valid if it has an associated document 
>> type declaration and if the document complies with the constraints 
>> expressed in it.
>>
>> The document type declaration MUST appear before the first element in 
>> the document."
> 
> I think this page summarizes it nicely:
> http://www.xml.com/lpt/a/2002/09/04/xslt.html
> 
>     "Valid" is a technical term referring to the presence
>     of and conformance to a DOCTYPE declaration.

I think that's a paraphrase of the first para I quoted above?

> XML documents w/o a DTD are "well-formed".  XML documents
> with a DTD and which agree with the DTD are "valid".
> 
> In this case not being "valid" does not mean that the
> document is "invalid XML".

No, I believe you're wrong there; 'not valid' and 'invalid' have the 
same meaning both colloquially and as used in the spec. It's either 
valid or it isn't, and if it isn't then its invalid.

> As I understand things, it's perfectly fine to pass well-formed
> but not valid XML documents around.

I don't agree. There are occasions when it is acceptable but it's 
generally bad practice, IMHO. The discussion in sec 5 of the spec gives 
some motivation, particularly this section:

http://www.w3.org/TR/REC-xml/#safe-behavior

Or look here, or thousands of other places:
http://www.online-learning.com/demos/xml/valid_xml.html
http://en.wikipedia.org/wiki/Xml#Correctness_in_an_XML_document

In particular for interoperability of an open, distributed system with 
many writers and readers implemented by different groups (i.e. DAS), I 
suggest validity is essential.

I would have expected your experience of the PDB to make you keen on 
validation :)

Cheers, Dave



More information about the DAS2 mailing list