Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Serializer and line breaks in attribute values

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: "John Cowan" <jcowan AT reutershealth.com>
  • To: Marc Ramsey <marc AT ranlog.com>
  • Cc: Elliotte Rusty Harold <elharo AT metalab.unc.edu>, xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] Serializer and line breaks in attribute values
  • Date: Wed, 19 Nov 2003 15:38:27 -0500

Marc Ramsey scripsit:

> In my particular case, one tool in the chain was using an older version of
> expat, which parsed, within one specific attribute value, a space followed
> by a newline as two spaces, resulting in a spurious mismatch between two
> attribute values.

If the attribute is of type CDATA, or undeclared type, that was the Right
Thing.

> As a result, two supposedly identical files, one of which
> had been serialized through XOM, produced very different results. The
> amusing part was that during the process of tracking down the bug, we tried
> several XML difference programs, each showed the two files to be identical,
> as they were properly compressing sequences of whitespace in attribute
> values to a single space...

Sequences of whitespaces should *not* be compressed (unless that's an
application feature rather than a parser feature) unless the attribute
is known to be of non-CDATA type.

--
"You know, you haven't stopped talking John Cowan
since I came here. You must have been http://www.reutershealth.com
vaccinated with a phonograph needle." jcowan AT reutershealth.com
--Rufus T. Firefly http://www.ccil.org/~cowan




Archive powered by MHonArc 2.6.24.

Top of Page