You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Hui Cai <hc...@ingenuity.com> on 2003/02/06 18:15:38 UTC
line breaks in attributes
Hi,
When I call the getAttribute(String), it converts any line breaks to a white space. Is there a way the line breaks can be preserved?
Hui
----+----
This email message (and any attached document) contains information from Ingenuity Systems Inc. which may be considered confidential by Ingenuity, or which may be privileged or otherwise exempt from disclosure under law, and is for the sole use of the individual or entity to whom it is addressed. Any other dissemination, distribution or copying of this message is strictly prohibited. If you receive this message in error, please notify me and destroy the attached message (and all attached documents) immediately.
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org
Re: line breaks in attributes
Posted by Andy Clark <an...@apache.org>.
Hui Cai wrote:
> When I call the getAttribute(String), it converts any line
> breaks to a white space. Is there a way the line breaks can
> be preserved?
Make your attribute type CDATA *and* embed the line breaks
in your attribute content as character entity references.
For example:
Also, if you write directly to XNI, Xerces can give you the
non-normalized attribute value in the XMLAttributes inter-
face. But be careful when choosing this route since it will
add a dependency on the Xerces parser (until other parser
implementations adopt XNI ;).
--
Andy Clark * andyc@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org
Re: line breaks in attributes
Posted by Joseph Kesselman <ke...@us.ibm.com>.
See http://www.w3.org/TR/REC-xml#AVNormalize. Line breaks in attributes
are not meaningful in XML, and are normalized into spaces.
______________________________________
Joe Kesselman / IBM Research
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org