[Haskell-cafe] HXT namespace problem

Martin Huschenbett huschi at gmx.org
Tue Apr 24 08:53:05 EDT 2007


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.



More information about the Haskell-Cafe mailing list