= let node = compileXNode (getNode t)
children = HsList (map compileXmlTree (getChildren t))
in
- xn "mkTree" $: HsParen node $: children
+ unq "mkTree" $: HsParen node $: children
compileXmlTrees :: XmlTrees -> HsExp
compileXNode :: XNode -> HsExp
-compileXNode (XText s) = xn "mkText" $: litStr s
-compileXNode (XCharRef n) = xn "mkCharRef" $: litInt n
-compileXNode (XEntityRef s) = xn "mkEntityRef" $: litStr s
-compileXNode (XCmt s) = xn "mkCmt" $: litStr s
-compileXNode (XCdata s) = xn "mkCdata" $: litStr s
-compileXNode (XPi qn ts) = xn "mkPi" $: HsParen (compileQName qn) $: compileXmlTrees ts
-compileXNode (XTag qn ts) = xn "mkElementNode" $: HsParen (compileQName qn) $: compileXmlTrees ts
-compileXNode (XDTD de as) = xn "mkDTDNode" $: compileDTDElem de $: compileAttributes as
-compileXNode (XAttr qn) = xn "mkAttrNode" $: HsParen (compileQName qn)
-compileXNode (XError n s) = xn "mkError" $: litInt n $: litStr s
+compileXNode (XText s) = unq "mkText" $: litStr s
+compileXNode (XCharRef n) = unq "mkCharRef" $: litInt n
+compileXNode (XEntityRef s) = unq "mkEntityRef" $: litStr s
+compileXNode (XCmt s) = unq "mkCmt" $: litStr s
+compileXNode (XCdata s) = unq "mkCdata" $: litStr s
+compileXNode (XPi qn ts) = unq "mkPi" $: HsParen (compileQName qn) $: compileXmlTrees ts
+compileXNode (XTag qn ts) = unq "mkElementNode" $: HsParen (compileQName qn) $: compileXmlTrees ts
+compileXNode (XDTD de as) = unq "mkDTDNode" $: compileDTDElem de $: compileAttributes as
+compileXNode (XAttr qn) = unq "mkAttrNode" $: HsParen (compileQName qn)
+compileXNode (XError n s) = unq "mkError" $: litInt n $: litStr s
compileDTDElem :: DTDElem -> HsExp
compileAttr (k, v) = HsTuple [ litStr k, litStr v ]
-
-xn :: String -> HsExp
---xn = HsVar . Qual (Module "XN") . HsIdent
-xn = unq
-
unq :: String -> HsExp
unq = HsVar . UnQual . HsIdent