Hi all, I'm currently trying to generate XML documents with HXT. Everything went well but I can't figure out how to generate the "xmlns:..." attributes for the namespaces. My code looks like: runX $ constA (request TableListRequest) >>> root [] [writeA] >>> writeDocument [(a_indent,v_1)] "-" where writeA generates the actual content. This code generates something like: <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope> <soapenv:Body> <request:tablelist/> </soapenv:Body> </soapenv:Envelope> But I want it with XML namespaces, i.e.: <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:request="http://www.officematic.de/domas/request" > <soapenv:Body> <request:tablelist/> </soapenv:Body> </soapenv:Envelope> I tried using "uniqueNamespaces" and "uniqueNamespacesFromDeclAndQNames" but neither worked. Maybe I used them in the wrong part of code. The tree representation my document looks like: ---XTag "/" | +---XTag "{http://schemas.xmlsoap.org/soap/envelope/}soapenv:Envelope" | +---XTag "{http://schemas.xmlsoap.org/soap/envelope/}soapenv:Body" | +---XTag "{http://www.officematic.de/domas/request}request:tablelist" and for me this looks like if there is enough namespace information provided. I would appreciate any help, Martin.
Tim Walkenhorst schrieb:
runX $ constA (request TableListRequest) >>> root [] [writeA] >>> writeDocument [(a_indent,v_1)] "-"
writeDocument [(a_indent,v_1), (a_check_namespaces, v_1)] "-"
should do the trick.
a_check_namespaces unfortunately didn't do the trick. But using uniqueNamespacesFromDeclAndQNames *before* constructing the root helped. But this was not very well documented. However, thanks for your help. Regards, Martin.
participants (2)
-
Martin Huschenbett -
Tim Walkenhorst