You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xml.apache.org by sw...@iFulfillment.com on 2001/08/15 20:46:08 UTC

Parsing failures with '&'

We have a situation where a client has the ampersand character in product
descriptions submitted to us in XML.  For a fictious example, assume
<description>M & M</description>.  The crimson parser fails with "Illegal
character or entity reference syntax".

Is there anyway around this problem short of writing a replacement script
before sending it to the parser?

Thanks in advance.

Scott


---------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org


Re: Parsing failures with '&'

Posted by Bob Jamison <rj...@lincom-asg.com>.
Also, this one is cool:

&#160;

is the same as  '&nbsp;'  in HTML,
and is -really- useful for XSLT, since
it can be passed through.



Bob




---------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org


Re: Parsing failures with '&'

Posted by yudo pria <yu...@rileks.co.id>.
i've tried the following replacement,
and this far it works ..

      Name Code Number Code Glyph Description 
        
     &#00;-
      &#08;  unused 
     &#09;  horizontal tab 
     &#10;  line feed 
     &#11;   unused 
     &#32;  space 
     &#33; !   exclamation mark 
      &quot; &#34; "   double quotation mark 
     &#35; #   number sign 
     &#36; $   dollar sign 
     &#37; %   percent sign 
      &amp; &#38; &   ampersand 
     &#39; '   apostrophe 
     &#40; (   left parenthesis 
     &#41; )   right parenthesis 
     &#42; *   asterisk 
     &#43; +   plus sign 
     &#44; ,   comma 
     &#45; -   hyphen 
     &#46; .   period 

so, you have to replace on the query 
(or whenever you'd like)
like this :

replace(fieldName,'&','&amp;') as fieldName

or if you already have the .xml files,
you can perform the process 
right before sending it into parser.

hope it helps,
yudo.


----- Original Message ----- 
From: <sw...@iFulfillment.com>
To: <ge...@xml.apache.org>
Sent: Thursday, August 16, 2001 1:46 AM
Subject: Parsing failures with '&'


> We have a situation where a client has the ampersand character in product
> descriptions submitted to us in XML.  For a fictious example, assume
> <description>M & M</description>.  The crimson parser fails with "Illegal
> character or entity reference syntax".
> 
> Is there anyway around this problem short of writing a replacement script
> before sending it to the parser?
> 
> Thanks in advance.
> 
> Scott
> 
> 
> ---------------------------------------------------------------------
> In case of troubles, e-mail:     webmaster@xml.apache.org
> To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
> For additional commands, e-mail: general-help@xml.apache.org
> 
> 


---------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org


RE: Parsing failures with '&'

Posted by ve...@suplicity.com.
there may not be a short cut method as XML is already built,

but one can look for suspected tags (using StringTokenizer etc) and replace
"&" with "&amp".

thanks
venu

-----Original Message-----
From: swallace@iFulfillment.com [mailto:swallace@iFulfillment.com]
Sent: Wednesday, August 15, 2001 2:46 PM
To: general@xml.apache.org
Subject: Parsing failures with '&'


We have a situation where a client has the ampersand character in product
descriptions submitted to us in XML.  For a fictious example, assume
<description>M & M</description>.  The crimson parser fails with "Illegal
character or entity reference syntax".

Is there anyway around this problem short of writing a replacement script
before sending it to the parser?

Thanks in advance.

Scott


---------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org



---------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org