Re: XML/HTML Encoding problem

2006-05-23 Thread Dale Strickland-Clark
Thanks, Duncan. That did the trick. If you're EuroPythoning, I'll buy you a drink. Cheers. Duncan Booth wrote: > First up, when I repeat what you did I don't get the same output. toxml() > without an encoding argument produces a unicode string, and no encoding > attribute in the > > toxml()

Re: XML/HTML Encoding problem

2006-05-22 Thread Duncan Booth
Dale Strickland-Clark wrote: > from xml.dom.minidom import parseString > output = parseString(strHTML).toxml() > > The output is: > > > > > >http-equiv="Content-Type"/> > > € > > > > So it encodes the entity reference to € (Euro sign).  I need it to > remain as € so that the resulting HTM

Re: XML/HTML Encoding problem

2006-05-22 Thread Sybren Stuvel
Dale Strickland-Clark enlightened us with: > So it encodes the entity reference to € (Euro sign).  I need it to > remain as € so that the resulting HTML can render properly in > a browser. If you want proper display, why not use UTF-8? Sybren -- The problem with the world is stupidity. Not sa

XML/HTML Encoding problem

2006-05-22 Thread Dale Strickland-Clark
A colleague has asked me this and I don't know the answer. Can anyone here help with this? Thanks in advance. Here is his email: I am trying to parse an HTML document using the xml.dom.minidom parser and then outputting a valid HTML document, all using the ISO-8859-1 charset. For example: My inp