
Hi all, Say i have data of type Content, and i want to put that data into a type which is an instance of XmlContent, so that i can use it with hPutXml. How can i do so? Does it involve the List1 type and its NonEmpty constructor? Thanks in advance, Alexis.

Alexis Hazell
Say i have data of type Content, and i want to put that data into a type which is an instance of XmlContent, so that i can use it with hPutXml. How can i do so? Does it involve the List1 type and its NonEmpty constructor?
I don't fully understand the question. Do you mean that you have data of the HaXml-defined type Text.XML.HaXml.Types.Content? If so, then there is no need to convert it to any instance of XmlContent, just in order to write it to a file. hPutXml would only convert it back again! You can write ordinary Content data just using import Text.XML.HaXml.Pretty as PP import Text.PrettyPrint.HughesPJ (render) main = ( hPutStrLn h . render . PP.content ) mydata Regards, Malcolm
participants (2)
-
Alexis Hazell
-
Malcolm Wallace