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: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] Serializer and line breaks in attribute values
  • Date: Wed, 19 Nov 2003 13:09:08 -0500

Elliotte Rusty Harold scripsit:

> You should note that preserving white space in attributes is *very*
> tricky. Parsers often remove, trim, and compress white space in
> attributes before XOM ever sees them.

Parsers MUST change line terminators to spaces in attribute values.

If a parser knows that an attribute has a type other than CDATA (and
attribute declarations in the internal subset MUST NOT be ignored), then
the parser MUST further trim all leading and trailing spaces, and
compress all runs of spaces to a single space, in values of that attribute.
This is quite independent of whether the parser validates or not.

If you want to get line terminators into attribute values, use character
references.

--
John Cowan jcowan AT reutershealth.com http://www.ccil.org/~cowan
Most languages are dramatically underdescribed, and at least one is
dramatically overdescribed. Still other languages are simultaneously
overdescribed and underdescribed. Welsh pertains to the third category.
--Alan King




Archive powered by MHonArc 2.6.24.

Top of Page