parsing "&A" in a string..

Fredrik Lundh fredrik at pythonware.com
Sun Aug 31 16:09:49 EDT 2008


bruce wrote:

> a pretty simple question, i'm guessing.
> 
> i have a text/html string that looks like:
>  	....(A&E)
> 
> the issue i have is that when i parse it using xpath/node/toString,
> i get the following
> 
> ...(A&E;).

that's because your parser is interpreting the &E part as an entity 
reference, and the serializer is then adding the missing semicolon.

bare ampersands must be written as "&" in the file.

</F>




More information about the Python-list mailing list