Boost logo

Boost :

From: Sebastian Redl (sebastian.redl_at_[hidden])
Date: 2007-07-13 09:38:13


Jake Voytko wrote:
> My concern, as I indicated in the other thread, is that
> 1)
> <?xml version="1.0"?>
> <article_info isbn="foo">
> <title>bar</title>
> <author>Testy McTest</author>
> </article_info>
>
> 2)
> <?xml version="1.0"?>
> <article_info isbn="foo">
> <!--Title goes here-->
> <title>bar</title>
> <author>Testy McTest</author>
> </article_info>
>
> and 3)
> <?xml <!-- Prolog tag--> version="1.0"?>
> <article_info isbn="foo">
> <!-- Author goes here -->
> <author>Testy McTest</author>
> <!-- Title goes here -->
> <title>bar</title>
> <!-- Maybe we could add more later-->
> </article_info>
>
> are all valid XML documents, and represent the same data.
The third isn't valid - the xml declaration cannot contain comments -
and whether they represent the same data is a matter of interpretation.
If your document type says that article_info can only contain elements,
then yes. But you have no document type declaration, so the processor
doesn't actually know it, and must preserve the character data. The
character data here is just whitespace, but it differs between the three
documents.

Sebastian Redl


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk