FAQ
Hi all,

I am working on SunOS 5.8, Python 2.2.2

When I run the python grogram below:



#Beginning

import xml.dom.minidom



xml_str = """\

<test>

<a>&apos; this is a</a>

<b>c&apos; this is b</b>

<c>this is c</c>

</test>

"""



dom = xml.dom.minidom.parseString(xml_str)



na = dom.getElementsByTagName("a")[0]

nb = dom.getElementsByTagName("b")[0]

nc = dom.getElementsByTagName("c")[0]



print na.childNodes[0].data

print nb.childNodes[0].data

print nc.childNodes[0].data

#End



The result is as below:

" this is a

c

this is c



I don't know why the letters following the quote are lost.
Even the quote lost if the quote following another letter.



Regards,

Sean





This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080925/2a7d7ed1/attachment.htm>

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedSep 25, '08 at 8:44a
activeSep 25, '08 at 8:44a
posts1
users1
websitepython.org

1 user in discussion

Xiaowei Lin: 1 post

People

Translate

site design / logo © 2022 Grokbase