Re: [XML-SIG] losing entities when parsing then texting

2005-07-06 Thread Andrew Clover
Greg Wilson <[EMAIL PROTECTED]> wrote: > I realize I should include the Unicode characters directly in my files, > but that's not possible in this case---I have to accommodate people who > are using editors that only handle 7-bit ASCII. Theoretically, .toxml('us-ascii') should generate usable out

Re: [XML-SIG] losing entities when parsing then texting

2005-07-03 Thread Dieter Maurer
Greg Wilson wrote at 2005-7-1 15:45 -0400: >I realize I should include the Unicode characters directly in my files, >but that's not possible in this case---I have to accommodate people who >are using editors that only handle 7-bit ASCII. Then, you need to implement an entity reference node (DOM ex

Re: [XML-SIG] losing entities when parsing then texting

2005-07-03 Thread Mike Brown
Greg Wilson wrote: > Dieter Maurer wrote: > > "Minidom"s support for entities is weak. > > > > Try to avoid them (beside the standard XML entities) by > > using the corresponding Unicode characters instead. > > I realize I should include the Unicode characters directly in my files, > but that's n

Re: [XML-SIG] losing entities when parsing then texting

2005-07-02 Thread Greg Wilson
Dieter Maurer wrote: > "Minidom"s support for entities is weak. > > Try to avoid them (beside the standard XML entities) by > using the corresponding Unicode characters instead. I realize I should include the Unicode characters directly in my files, but that's not possible in this case---I have t

Re: [XML-SIG] losing entities when parsing then texting

2005-07-01 Thread Dieter Maurer
Greg Wilson wrote at 2005-6-30 12:19 -0400: >This one must have come up several times before, but neither Google nor >the Cookbook have given me an answer. I'm doing this: > >data = sys.stdin.read() >doc = xml.dom.minidom.parseString(data) >root = doc.documentElement >...add and modify some nodes

[XML-SIG] losing entities when parsing then texting

2005-06-30 Thread Greg Wilson
This one must have come up several times before, but neither Google nor the Cookbook have given me an answer. I'm doing this: data = sys.stdin.read() doc = xml.dom.minidom.parseString(data) root = doc.documentElement ...add and modify some nodes... sys.stdout.write(root.toxml('utf-8')) A typica