Integers in TextNodes w/ Python minidom

Posted by PylonsN00b on Stack Overflow See other posts from Stack Overflow or by PylonsN00b
Published on 2010-05-14T14:09:52Z Indexed on 2010/05/14 16:34 UTC
Read the original article Hit count: 333

Filed under:
|
|
|
|

I am working on an API using SOAP and WSDL. The WSDL expects integers to come through. I am fairly new to ALL of this, and constructing XML in Python. I have chosen to use minidom to create my SOAP message. So using minidom, to get a value into a node I found I have to do this:

 weight_node = xml_file.createElement("web:Weight")
 weight_contents = xml_file.createTextNode(weight)
 weight_node.appendChild(weight_contents)

So say weight needs to go in as an integer and IS an integer. The function is 'createTextNode' does this mean its going to be text, or what I put in there has to be text? Again I am fairly new to all of this. So if what I have explained seems way off base, please speak up.

© Stack Overflow or respective owner

Related posts about minidom

Related posts about integer