Pyxml: DOM questions, problems with namespaces

"Matthias Dorfner" <[email protected]>
Newsgroups gmane.comp.python.xml
Message-ID <[email protected]>
Hello together,

I'm quite new to pyxml, so please forgive me some maybe "stupid"
questions. I've two question:

1. some problems creating my xml file with the
correct double quoted string in the namespace, here one example:

<?xml version='1.0' encoding='UTF-8'?>
<request xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xmlns:noNameSpaceSchemaLocation='Handle.xsd'>

I need exactly this output but not single quoted(' -> "). Here's the code
I use to create this one:

dom = xml.dom.minidom.getDOMImplementation()
doc = dom.createDocument(None, "request", None)

#Get the document element
msg_elem = doc.documentElement

#Create an xmlns attributes on the root element
msg_elem.setAttributeNS(EMPTY_NAMESPACE, "xmlns:xsi",
"http://www.w3.org/2001/XMLSchema-instance")
msg_elem.setAttributeNS(EMPTY_NAMESPACE, "xsi:noNameSpaceSchemaLocation",
"Handle.xsd")

2. I want so post the above created xml structure to a webserver, but I
need to convert this first to a string, how can I do this? PrettyPrint
allows only writing this DOM structure to a file. Or is it possible to
correctly read out this xml file?

Maybe you know what I can do, I tried a lot but nothing worked.

Thanks for your time,
Greetings

Babsi
_______________________________________________
XML-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/xml-sig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.