Valid /Validated-Difference (XML,DTD)

73 views Asked by At

I have a theoretical misunderstanding, maybe caused by the language, hence I apologise in advance for the simpe question. Speaking about XML-documents (-files) and DTD , there are two basic things,the difference of which should be understood: valid and validated. As explanation for this words stays:

Valid : (a) which is acceptable, because it is true (b) Which can be used lawfully

Validate : (a) to check to see if something is correct (b) to make something valid

Also, one XML-file is valid,when it's written correctly (well-formed) and conforms the grammar (DTD) and validate is simply the checking, whether the file is valid,so you (1)validate and then /affter correcting/ (2) the file is valid, that means, that a file can't be valid without to be validated. Is this true,or theoretical it isn't so simple?

1

There are 1 answers

0
kjhughes On

Your understanding is on the mark...

In conventional usage in XML, there is no deep difference between valid and validated. Both mean that an XML document adheres to the constraints of an associated schema.

One would usually use validated in situations where the emphasis is on the act of having run a validating parser successfully on the XML document.

One would usually use valid in situations where the emphasis is on the state of the file conforming to a schema, regardless of whether this was actually checked by a validating parser or otherwise known to be true.

Also, one XML-file is valid,when it's written correctly (well-formed) and conforms the grammar (DTD)

That's right...

Well-formed means that a textual object meets the W3C requirements for being XML.

Valid means that well-formed XML meets additional requirements given by a specified schema.

Read more about this distinction here: Well-formed vs Valid XML