By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,389 Members | 1,955 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,389 IT Pros & Developers. It's quick & easy.

RE: parsing "&A" in a string..

P: n/a
Hi Fredrick

Thanks for the reply. But since I don't have control of the initial text, is
there something with python that will strip/replace this...

or are you saying I should do a search/replace on the "&" char with the
"amp&;" prior to parsing??

-----Original Message-----
From: py*****************************************@python .org
[mailto:py***************************************** @python.org]On Behalf
Of Fredrik Lundh
Sent: Sunday, August 31, 2008 1:10 PM
To: py*********@python.org
Subject: Re: parsing "&A" in a string..
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>

--
http://mail.python.org/mailman/listinfo/python-list

Aug 31 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.