Re: Validity Checking

On Monday, October 3, 2005, 10:27:55 PM, Doug wrote:

DS> Hi-

DS> I sent this to xml-dev@lists.xml.org, but got no reply, so I was hoping
DS> someone here could clarify.
Your whole question hinges on "what does valid mean" and "is valid the
same as conformant". The answer to the second question is 'no', and the
answer to the first question is 'it depends'.


DS> I've been playing around with the <oXygen /> XML editor, seeing how
DS> SVG-handy it is, and I've run into a question.

I use that editor as my main xml editor, for SVG and XHTML.

DS> I don't normally but DOCTYPE declarations in my SVG files, since I
DS> declare the namespaces in the root

The two are unrelated - even if you have a DOCTYPE, you still need to
have namespace declarations in the instance to be compliant SVG content.
This is something that has always been the case for SVG Recs, but was
not the case in early pre-Rec SVG history.

DS> (and since it causes some
DS> problems in script with import and parsing a file that does have a
DS> DOCTYPE declaration).

really?

DS>  But the Oxygen editor says it's not valid if I
DS> don't have one; in fact, it doesn't even recognize it as SVG.

oXygen can validate to a DTD, a W3C XML Schema, or to a RelaxNG schema.
If you don't have a DOCTYPE it can't find the DTD; if you don't have an
xsi:schemaLocation it can't find the W3C XML Schema (unless you tell it
where it is manually) and RelaxNG does not even have a way to indicate
the schema location in the instance. oXygen gets around that one by
adding an oXygen-specific processing instruction that tells it where the
RelaxNG schema is.

DS> So, can anyone confirm or categorically deny that one needs the DOCTYPE
DS> declaration to have a valid SVG file?

To have one that is DTD valid, yes (but so what, he says before Robin
says it). To have conformant SVG content, no.

DS>  This is counter to what I have gleaned
DS> from the SVG Spec (though I can't find a reference at the moment).

DS> Also, do I need a <?xml version="1.0" standalone="no"?> header,

If your XML is version 1.0
AND
your encoding is either UTF-8 or UTF-16

then you do not need an XML declaration (but you can still have one and
its probably good practice to state explicitly what the version and
encoding are).

If the encoding is anything else (Latin-1, etc) you *must* have an xml
declaration that says what the encoding is.

standalone is advisory and is only used for DTDs. standalone="no" was
used to indicate that the infoset produced from parsing the external
DTD subset would be different to the infoset produced by not parsing the
external DTD subset.

You don't need it, its only a hint and it only relates to DTD
processing; also no software seems to make use of it and iits undefined
what it would do it it did make use of it.

DS> and if so, when? Oxygen doesn't care if I do or not, but I just want
DS> to Do The Right Thing.





-- 
 Chris Lilley                    mailto:chris@w3.org
 Chair, W3C SVG Working Group
 W3C Graphics Activity Lead
 Co-Chair, W3C Hypertext CG

Received on Tuesday, 4 October 2005 05:08:53 UTC