
Miguel Mitrofanov a écrit :
Seems rather strange for me, I've just installed HXT and got this:
Prelude Text.XML.HXT.Arrow> runX $ readString [(a_validate,"0")] "<this> </this>" >>> writeDocumentToString [] ["<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<this> </this>"]
Everything works fine except for the fact that all the nodes <this> </this> (that is, a space (an XML text node whose contents are a single space character) within a <this> element node) get transformed to a <this/> element node,
Thank you for investingating this : that made me realize that the issue comes from the a_indent option. What is strange is that this does not seems to appear with your example
runX $ readString [(a_validate,"0")] "<this> </this>" >>> writeDocumentToString [(a_indent, v_1)] ["<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<this>\n</this>\n"] But if I try the same with my XML file, my empty nodes are "folded". I suppose this comes from the "Ctrl-M" at the end of the lines. See the attached file and you may see that runX $ readDocument [(a_validate, v_0)] "ftest.5.11e.xdp" >>> writeDocumentToString [] produces « <text> </text> » nodes (OK), but runX $ readDocument [(a_validate, v_0)] "ftest.5.11e.xdp" >>> writeDocumentToString [(a_indent, v_1)] produces « <text/> » nodes (bad). I can manage it without the a_indent option. Thanks/спасибо Fernand