[xml] PythonBindingsAttrWithNsPb



 
Hello,
 
I suspect a problem wtih the Python libxmlmods interface (last version) to libxml.
 
The following script:
 
----------------------------------------------------------------------
xmlDoc="""<?xml version="1.0"?>
<SOAPsession>
  <SOAP-ENV:Envelope
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:ZSI="http://www.zolera.com/schemas/ZSI/"
    SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <SOAP-ENV:Body>
      <AverageWeightedByDay>
        <Eb11840 SOAP-ENC:arrayType="xsd:anyType[2]">
          <element xsi:type="xsd:decimal">1.0</element>
          <element xsi:type="xsd:decimal">2.0</element>
        </Eb11840>
        <Eb020c8 SOAP-ENC:arrayType="xsd:anyType[2]">
          <element xsi:type="xsd:integer" xsi:bidon="xsd:splatch">1</element>
          <element xsi:type="xsd:integer">1</element>
        </Eb020c8>
      </AverageWeightedByDay>
    </SOAP-ENV:Body>
  </SOAP-ENV:Envelope>
</SOAPsession>
"""
 
 
 
from libxml2 import parseDoc
 

doc=parseDoc(xmlDoc)
 
for node in doc:
    if node.name=="element":
        for attr in node.properties:
            print attr.name,attr.content
            print attr.ns()
---------------------------------------------------------------------------------
 
produces:
 
---------------------------------------------------------------------------------------
Microsoft Windows XP [version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
 
 
C:\Python\Scripts>python libxmlAttrsNs.py
type xsd:decimal
Traceback (most recent call last):
  File "libxmlAttrsNs.py", line 37, in ?
    print attr.ns()
  File "C:\Python\lib\site-packages\libxml2.py", line 2285, in ns
    if ret is None:raise treeError('xmlNodeGetNs() failed')
libxml2.treeError: xmlNodeGetNs() failed
------------------------------------------------------------------------------------------
 
 
Or maybe I missed something?
 
 
 
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]