There could have been an almost exactly analogous discussion about whether
or not to embed links to stylesheets or whether or not to embed links
generally. The pros and cons are very similar.
Francis Cave
> -----Original Message-----
> From: dsdl-comment-bounce@dsdl.org [mailto:dsdl-comment-
> bounce@dsdl.org] On Behalf Of Costello, Roger L.
> Sent: 18 December 2008 17:40
> To: 'dsdl-comment@dsdl.org'
> Subject: [dsdl-comment] Re: Proposed Best Practice: Keep validation
> information separate from the document being validated
>
> Hi Folks,
>
> Excellent discussion!
>
> Below is a summary of the discussion. Please notify me of any errors or
> omissions. /Roger
>
>
> THE EVILS OF EMBEDDED SCHEMA REFERENCES
>
> Consider this snippet of an XML instance document:
>
> <?xml version="1.0"?>
> <Library xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation=
> "http://www.book.org
> Book.xsd
> http://www.employee.org
> Employee.xsd">
>
> The schemaLocation attribute specifies what schemas are to be used to
> validate the document. The specification of what schemas are to be used
> is embedded within the XML instance document.
>
> Embedding schema information in the XML instance document is generally
> bad practice for these reasons:
>
> 1. It clutters the document.
>
> 2. Using schemas that are indicated in the document is potentially
> harmful. A bad person could create an XML instance document, containing
> bad data, that points to schema(s) that allows anything. The XML
> instance document may thus be accepted into a system when it should
> not.
>
> 3. Oftentimes - particularly in workflow-based applications - the XML
> instance document must be validated against different schemas at
> different stages of document lifecycle. Hardcoding an indication of the
> schema(s) to be used inside the XML instance document is not useful for
> such applications.
>
> For most occasions, validation information should be kept separate from
> the document being validated.
>
>
> OCCASIONS WHEN EMBEDDED SCHEMA REFERENCES ARE ACCEPTABLE
>
> There are occasions where it is useful and acceptable to embed within
> the XML instance document information about the schema(s) to be used to
> validate the XML instance document. For example, when you are learning
> a schema language and doing standalone testing of XML instances it is
> more convenient to embed schema information. And in controlled
> environments it may be acceptable to embed schema information.
>
>
> NEED A FLEXIBLE XML LANGUAGE FOR SPECIFYING SCHEMA INFORMATION
>
> A flexible XML vocabulary is needed for specifying how an XML instance
> document should be validated. For the above Library example, the XML
> vocabulary should be capable of expressing:
>
> Validate the elements in the http://www.book.org against Book.xsd
>
> Validate the elements in the http://www.employee.org against
> Employee.xsd
>
> NVDL is a flexible XML language for specifying the schemas to be used
> to validate a document.
>
> For example, here is an NVDL document for the above Library example:
>
> ---------------------------------------------------------
> <?xml version="1.0"?>
> <rules xmlns="http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0">
> <namespace ns="http://www.book.org">
> <validate schema="Book.xsd" />
> </namespace>
> <namespace ns="http://www.employee.org">
> <validate schema="Employee.xsd" />
> </namespace>
> </rules>
> ---------------------------------------------------------
>
> While NVDL is a flexible and powerful language for expressing the
> schema(s) that should be used to validate an XML instance document,
> there are a few things that it cannot express. For example, DocBook or
> TEI provide several grammars (subsets) which are differentiated by
> attribute value, which cannot be expressed using NVDL.
>
> Nonetheless, NVDL will probably satisfy 99% of your needs, and is the
> language that should be used.
>
>
> SUMMARY
>
> 1. In general, validation information should be kept separate from the
> document being validated.
>
> 2. Use NVDL to specify what schema(s) are to be used to validate an XML
> instance document.--
> DSDL comments
>
> To unsubscribe, please send a message with the
> command "unsubscribe" to dsdl-comment-request@dsdl.org
> (mailto:dsdl-comment-request@dsdl.org?Subject=subscribe)
-- DSDL comments To unsubscribe, please send a message with the command "unsubscribe" to dsdl-comment-request@dsdl.org (mailto:dsdl-comment-request@dsdl.org?Subject=unsubscribe)Received on Fri Dec 19 03:10:35 2008
This archive was generated by hypermail 2.1.8 : Fri Dec 19 2008 - 04:13:09 UTC