As far as what I know about XML goes, it's correct in including the line
breaks in the first example. The XML spec says that all whitespace should be
sent to the agent that's going to deal with it, so the agent can do what it
wants with it. Given the type of data contained between two XML tags,
whitespace might matter. That's why a parser is just supposed to give it to
you as it is.

Keith

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 01, 2000 2:23 AM
Subject: [REBOL] XML parser includes line breaks


> Case 1
>
> >> parse-xml {<?xml version="1.0" encoding="iso-8859-1" ?>
> {    <doc>
> {      <childnode/>
> {    </doc>
> {    }
> XML Version: 1.0
> == [document none [["doc" none ["^/  " ["childnode" none none] "^/"]]]]
>
> Case 2
>
> >> parse-xml {<?xml version="1.0" encoding="iso-8859-1"
> ?><doc><childnode/></doc>}
> XML Version: 1.0
> == [document none [["doc" none [["childnode" none none]]]]]
> >>
>
> As you can see in Case 1 the parser has picked up the line breaks. Yet I
> would have thought the XML structures of case 1 and case 2 were
equivalent.
> I put these two cases to two other tools (IE5, WebL) and they appear to
> treat the two cases as if they were the same XML - though that is no
> guarantee that those tools follow the spec.
>
> Any ideas on this? Is parse-xml true to the XML spec or is it a bug?

Reply via email to