You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Rathi, Pradeep" <pr...@documentum.com> on 2001/03/22 19:44:38 UTC

RE: How to preserve spaces when escape characters(like '&', '>',' <' etc) encountered?

Are you using the XMLSerializer. If so you can do the following on the
OutputFormat object:

outputFormat.setPreserveSpace(true);

Pradeep

> -----Original Message-----
> From: Poornima Prabhu [mailto:Poornima.Prabhu@Kewill.com]
> Sent: Thursday, March 22, 2001 9:28 AM
> To: 'xerces-j-dev@xml.apache.org'
> Subject: RE: How to preserve spaces when escape characters(like '&',
> '>',' <' etc) encountered?
> 
> 
> I have the following problem while parsing with Xerces-J 1.3.0
> 
> <City>SOUTH &amp; FIELD</City>
> 
> would parse it as SOUTH&FIELD  with no spaces after SOUTH and 
> before FIELD.
> 
> I would like it to be SOUTH & FIELD. 
> 
> I am concatenating SOUTH+&+FIELD through characters( ) 
> callback;(which calls
> this 3 times )
> 
> 1)"SOUTH" 
> 2) "&" 
> 3)"FIELD" 
> 
> But the parser doesn't distinguish between "SOUTH&FIELD"  and "SOUTH &
> FIELD". Both of them would be parsed like "SOUTH&FIELD".  So how can I
> preserve spaces when escape characters like '&' ,'<', '>' are 
> encountered?
> 
> Thx.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
>