]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.data/examples/XMLTransformationTest2.scl
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.scl.data / examples / XMLTransformationTest2.scl
index 18041bc6290cfe35a1f28123833d9f63ee26d3f0..63ce384894273778f77b22abcfabff0352ff94ca 100644 (file)
@@ -1,32 +1,32 @@
-import "Data/XML"\r
-\r
-sexOfRole "father"   = "Male"\r
-sexOfRole "mother"   = "Female"\r
-sexOfRole "son"      = "Male"\r
-sexOfRole "daughter" = "Female"\r
-\r
-mapping relation RootMapping Element Element\r
-\r
-rule PersonRule where\r
-    @when\r
-    RootMapping ?families ?persons\r
-    \r
-    @from\r
-    Element ?families "Family" ?family\r
-    Attribute ?family "lastName" ?lastName\r
-    Element ?family ?role ?familyMember\r
-    Attribute ?familyMember "firstName" ?firstName\r
-    \r
-    @to\r
-    Element ?persons (sexOfRole ?role) ?person\r
-    Attribute ?person "fullName" (?firstName + " " + ?lastName)\r
-    \r
-main :: [String] -> <Proc> ()\r
-main [fileName] = do\r
-    doc = parseFile fileName\r
-    doc2 = parseString "<Persons/>"\r
-\r
-    transformation OneShotForward where\r
-        RootMapping (rootElementOf doc) (rootElementOf doc2)\r
-    \r
-    print $ outputString doc2\r
+import "Data/XML"
+
+sexOfRole "father"   = "Male"
+sexOfRole "mother"   = "Female"
+sexOfRole "son"      = "Male"
+sexOfRole "daughter" = "Female"
+
+mapping relation RootMapping Element Element
+
+rule PersonRule where
+    @when
+    RootMapping ?families ?persons
+    
+    @from
+    Element ?families "Family" ?family
+    Attribute ?family "lastName" ?lastName
+    Element ?family ?role ?familyMember
+    Attribute ?familyMember "firstName" ?firstName
+    
+    @to
+    Element ?persons (sexOfRole ?role) ?person
+    Attribute ?person "fullName" (?firstName + " " + ?lastName)
+    
+main :: [String] -> <Proc> ()
+main [fileName] = do
+    doc = parseFile fileName
+    doc2 = parseString "<Persons/>"
+
+    transformation OneShotForward where
+        RootMapping (rootElementOf doc) (rootElementOf doc2)
+    
+    print $ outputString doc2