-import "Data/XML"\r
-\r
-mapping relation MapNote Element Element\r
-\r
-rule SectionsRule where\r
- @when\r
- MapNote ?noteA ?noteB\r
- ?sectionName <- ["from", "to", "heading", "body"]\r
- \r
- @from\r
- Attribute ?noteA ?sectionName ?text\r
- \r
- @to\r
- Element ?noteB ?sectionName ?el\r
- TextContent ?el ?text\r
- \r
-main () = do\r
- doc = parseString """<note to="Tove" from="Jani" heading="Reminder" body="Don't forget me this weekend!"/>"""\r
-\r
- doc2 = parseString "<note/>"\r
-\r
- transformation OneShotForward where\r
- MapNote (rootElementOf doc) (rootElementOf doc2)\r
- \r
- print $ outputString doc2\r
+import "Data/XML"
+
+mapping relation MapNote Element Element
+
+rule SectionsRule where
+ @when
+ MapNote ?noteA ?noteB
+ ?sectionName <- ["from", "to", "heading", "body"]
+
+ @from
+ Attribute ?noteA ?sectionName ?text
+
+ @to
+ Element ?noteB ?sectionName ?el
+ TextContent ?el ?text
+
+main () = do
+ doc = parseString """<note to="Tove" from="Jani" heading="Reminder" body="Don't forget me this weekend!"/>"""
+
+ doc2 = parseString "<note/>"
+
+ transformation OneShotForward where
+ MapNote (rootElementOf doc) (rootElementOf doc2)
+
+ print $ outputString doc2
\ No newline at end of file