W3C home > Mailing lists > Public > xml-dist-app@w3.org > November 2000

RE: XML within XML - includes, transcludes, whatever

From: Gavin Thomas Nicol <gtn@ebt.com>
Date: Wed, 1 Nov 2000 12:59:28 -0500
To: <xml-dist-app@w3.org>
> The problem is that when parsing I can't do the following
> (simplifying the XML terribly):
> <wrapper with wrapper.dtd>
>    <header> ... </header>           -- elements defined by wrapper.dtd
>    <body>
>       <newsml with newsml.dtd>      -- start of new enclosed document
>          <headline> ... </headline> -- elements defined by newsml.dtd
>          <body> ... </body>
>       </newsml>                     -- return to wrapping document context
>    </body>
> </wrapper>
> Where the wrapper.dtd doesn't know about newml, newsml.dtd doesn't know
> about the wrapper, and both chunks of XML are validated.

I think this is very much a question of layering. If you try to validate
the document *in toto* you'll have trouble. I have always felt that
parsing and validation are separate things, so I could quite easily
imagine doing this:

    <field name="id" value="12345678">

and then validating the various bits separately. For example, validating the
content of <header> is important, and validating the *content* of <body>
is important. We can validate those two, seperately using the idea that
validation is basically a boolean function

   validate(node, content-model)

where "content-model" would be a different DTD for <header> and
the content of <body>. In other words, read in the XML as a well-formed
document, then apply validation to the bits you care about. The only
thing you'd have to be a little careful of was namespaces.
Received on Wednesday, 1 November 2000 12:52:35 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 22:01:10 UTC