Integers in TextNodes w / Python minidom

I am working on an API using SOAP and WSDL. WSDL expects integers to pass. I am new to all this and am building XML in Python. I decided to use a mini-module to create my SOAP message. So using minidom to get the value in node I found that I have to do this:

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

      

So tell me that the weight must be an integer and IS is an integer. Does the "createTextNode" function mean that it will be text, or what I put there should be text? Again, I'm pretty new to this. So if what I've explained doesn't seem to work, please do speak.

+2


a source to share





All Articles