[jdom-interest] Line breaks in attribute values removed by SAX Parser?

Jason Hunter jhunter at acm.org
Tue Aug 7 14:59:04 PDT 2001


I believe the behavior you're seeing is consistent with XML 1.0.

http://www.w3.org/TR/REC-xml#AVNormalize

-jh-

> Ken Klose wrote:
> 
> I have an XML document with an element that looks something like this:
> <element attribute="this
> has
> line
> breaks"/>
> 
> When I try to read this in using JDOM (B6) the call to
> getAttributeValue returns "this has line breaks".  The line breaks
> having been replaced by regular spaces.
> 
> It looks to my in-experienced eye that the SAX Parser is passing the
> value to SAXHandler.startElement already de-linebreaked.  Does anyone
> know of a way in either B6 or B7 to work around this (B6 preferred
> since I don't want to switch to B7 until after I deliver the current
> version later this week).
> 
> Many thanks,
> Ken



More information about the jdom-interest mailing list