Ignoring ampersand(&) as a special character in xml

Chris c at cdot.de
Tue Sep 6 15:58:20 EDT 2005


Chris wrote:
> Thierry Lam wrote:
> 
>> Let's say I have the following xml tag:
>>
>> <para role="source">a & b</para>
>>
>> Currently, an xml parser will treat & as a special character.  Does
>> anyone know the special characters to use around the ampersand so that
>> the xml parser can treat "a & b" as a whole value?
>>
>> Thanks
>> Thierry
>>
> 
> Simple use the XML Entity for & which is &
> 
>     <para role="source">a & b</para>
> 
> You could use CDATA sections too but they seem to have the effect on 
> people ignoring that the containing strings are actually literary what 
> they seem (in this case "a & b") and not what they really are ("a & 
> b")...

should read before posting..., of course the other way round:
some people seem to ignore the visible "a & b" is not the actual "a 
& b" in CDATA sections...

> 
> chris
> 



More information about the Python-list mailing list