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 Järkeborn Joacim <jo...@consultant.volvo.com> on 2001/05/07 13:43:09 UTC
Invalid character
Hi,
We need to transfer strings in a XML structure. The string can contain '&' character.
e.g. <mydata>Testing & testing</mydata>
The XML parser doesn't like this because it thinks that '&' is a start for an character entity.
How can I transfer this string without error and which way is the best way (correct)?
Best regards
Joacim Järkeborn
Consultant - Systems Development
Cell Network Sverige AB
__________________________________________________
Volvo IT
Dept 9224, ARH4
Gothenburg, Sweden
Telephone..: +46 31 765 49 65
Mobilephone: +46 708 78 58 01
E-mail.....: joacim.jarkeborn@consultant.volvo.com
__________________________________________________
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org
Re: Invalid character
Posted by Arnaud Le Hors <le...@us.ibm.com>.
The std way is to escape it by using the built-in entity: &
--
Arnaud Le Hors - IBM Cupertino, XML Strategy Group
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org
Re: Invalid character
Posted by Milind Gadre <mi...@ecplatforms.com>.
Depending on your DTD, you can enclose it in a CDATA section as follows:
<mydata><![CDATA[Testing & testing]]></mydata>
> Hi,
>
> We need to transfer strings in a XML structure. The string can contain
'&' character.
>
> e.g. <mydata>Testing & testing</mydata>
>
> The XML parser doesn't like this because it thinks that '&' is a start
for an character entity.
>
> How can I transfer this string without error and which way is the best
way (correct)?
>
> Best regards
>
> Joacim Järkeborn
> Consultant - Systems Development
> Cell Network Sverige AB
Regards...
Milind Gadre
ecPlatforms, Inc
901 Mariner's Island Blvd, Suite 565
San Mateo, CA 94404
C: 510-919-0596
F: 815-352-0779
milind@ecplatforms.com
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org