validation alternatives

I

indo3

If an e.g. XHTML document has a <!DOCTYPE html system ..dtd> AND a
schemaLocation="..xsd" attribute
in the root, to be valid, need both to be checked? that means need the document
first to be checked against the DTD and then against the Schema?
or can one freely choose among both or how is the situation here?

THANKS
 
R

Richard Tobin

indo3 said:
If an e.g. XHTML document has a <!DOCTYPE html system ..dtd> AND a
schemaLocation="..xsd" attribute
in the root, to be valid, need both to be checked?

There's no universal meaning of "valid" - you have to first decide
whether you are talking about DTDs, Schemas, or any other validation
mechanism.

Both DTD and schema validation are optional. If you do both, you
should do DTD validation first, because it is not defined as a
standalone operation, but rather as part of XML parsing.

-- Richard
 
R

Richard Tobin

Keith M. Corbett said:
Dunno about "universal meaning" but the W3C XML specification[1] clearly
defines validation in terms of DTDs.

And the Schema spec defines it in terms of Schemas. No one spec can
claim exclusive ownership of the word "valid", so unless the context
is clear it makes sense to refer to DTD-validity, Schema-validity, and
so on.

-- Richard
 
S

Stefan Ram

Dunno about "universal meaning" but the W3C XML specification[1] clearly
defines validation in terms of DTDs.
And the Schema spec defines it in terms of Schemas.

DTDs are part of the XML specification, Schemas are not.

The meaning of "valid" is given by the XML-specification.

http://www.w3.org/TR/2000/REC-xml-20001006.html#dt-valid

While the XML-schema-specification

http://www.w3.org/TR/xmlschema-1/

says

"Throughout this specification, [Definition:] the word
valid and its derivatives are used to refer to clause 1
above, the determination of local schema-validity."
 
R

Richard Tobin

Stefan Ram said:
DTDs are part of the XML specification, Schemas are not.

This is getting silly.

If someone says "is this document valid", how do you know that they
are asking in terms of the XML spec rather than the Schema spec?
Instead of arguing pedantically about what they ought to mean by
"valid", why not just say "it's DTD-valid" or "it's Schema-valid"?

To re-iterate the real point: DTD-validity and Schema-validity are
independent (a document can be valid according to one but not the
other); it's quite reasonable to check either or both; and if you do
both then DTD-validation is done as part of parsing and
Schema-validation afterwards.

-- Richard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,830
Latest member
HeleneMull

Latest Threads

Top