On 04/10/16 15:02, bruce wrote:

> I did a quick replace ('&','&') and it replaced the '&' as desired.
> So the content only had '&' in it..

You are preonbably better using your parseers escape/unescape
facilities. Simple string replacement is notioriously hard to
get right.

> I can provide a more comprehensive chunk of code, but minimized the post to
> get to the heart of the issue. Also, I'd prefer not to use a sep parse lib.

Define separate? There are several options in the standard library.
All will be more effective than trying to do it by hand.
And libxml2dom is not one of them (at least I've never
seen it before) so you appear to be breaking your own rules?

> ------------------------------------
> code chunk
> 
> import libxml2dom
> q1=libxml2dom

You can get the same effect with

import libxml2dom as ql

> s2= q1.parseString(a.toString().strip(), html=1)
> tt=s2.xpath(tpath)
> 
> tt=tt[0].toString().strip()
> print "tit "+tt
> 
> -------------------------------------

You may have over-simplified a tad, it has become fairly
meaningless to us - what are 'a' and 'tpath'?

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to