You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Bennett <be...@glengroup.com> on 2003/10/07 21:49:00 UTC

retain hardreturn in attribute

I have a situation where I'd need to be able to output the hard-return 
within an attribute of the source document.


Does anyone have any tricks?
TIA


Re: retain hardreturn in attribute

Posted by Joseph Kesselman <ke...@us.ibm.com>.



Start by reviewing the XML Recommendation re normalization of attribute
values. (http://www.w3.org/TR/REC-xml#AVNormalize). If you want to
represent an attribute value containing the CR or LF character, you should
use a numeric character reference. XML-aware applications will convert that
reference to the character when the document is read in, and *should*
convert it back to the numeric character reference when they write it back
out.

(At one point, Xalan's serializers were failing to do that last step
correctly. That may have been fixed; check Bugzilla.)

______________________________________
Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more.
"The world changed profoundly and unpredictably the day Tim Berners Lee
got bitten by a radioactive spider." -- Rafe Culpin, in r.m.filk