Question about reading a xml

xiaowei.lin at accenture.com xiaowei.lin at accenture.com
Thu Sep 25 04:44:14 EDT 2008


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>' this is a</a>

<b>c' 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.html>


More information about the Python-list mailing list