Hi all,

I have some problems related to QDomNodeList QDomNode::childNodes () const
For example, I have xml content as the following:
Qt Code:
  1. <?xml version='1.0' encoding='utf-8'?>
  2. <xliff xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 &#xa; &#xa;xliff-core-1.2-transitional.xsd" >
  3. <file original="String" product-name="String" category="String" build-num="String" target-language="en-us" tool="manual" datatype="plaintext" source-language="en-us" xml:space="default" product-version="String" date="2001-12-17T09:30:47-05:00" ts="String" >
  4. <body>
  5. <group merged-trans="yes" >
  6. <trans-unit id="_1_ski_374" approved="no" >
  7. <source>a contact-email</source>
  8. <target equiv-trans="no" state="needs-translation" >%d ទំនាក់ទំនង</target>
  9. </trans-unit>
  10. <trans-unit id="_1_ski_383" approved="no" >
  11. <source>%d contact-emails.</source>
  12. <target equiv-trans="no" state="needs-translation" >%d contact-emails.sdf</target>
  13. </trans-unit>
  14. </group>
  15. </body>
  16. </file>
  17. </xliff>
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. fileNodes = []
  2. fileNodes = xliff.xlifffile.document.firstChildElement(xliff.xlifffile.rootNode).childNodes()
  3. for k in range(fileNodes.count()):
  4. if fileNodes. at(k).nodeName() == 'file':
  5. _units = fileNodes.at(k).firstChildElement(xliff.xlifffile.bodyNode).childNodes()
  6. for i in range(_units.count()):
  7. print i, _units.at(i).nodeName()
To copy to clipboard, switch view to plain text mode 

Output:
0 #text
1 group
2 #text

In my code, I want to get direct child nodes of <body>, and my expected output should be:
0 group

I was wondering where is the #text come from?

Thanks for you help,
Da