3 sexOfRole "father" = "Male"
\r
4 sexOfRole "mother" = "Female"
\r
5 sexOfRole "son" = "Male"
\r
6 sexOfRole "daughter" = "Female"
\r
8 mapping relation RootMapping Element Element
\r
10 rule PersonRule where
\r
12 RootMapping ?families ?persons
\r
15 Element ?families "Family" ?family
\r
16 Attribute ?family "lastName" ?lastName
\r
17 Element ?family ?role ?familyMember
\r
18 Attribute ?familyMember "firstName" ?firstName
\r
21 Element ?persons (sexOfRole ?role) ?person
\r
22 Attribute ?person "fullName" (?firstName + " " + ?lastName)
\r
24 main :: [String] -> <Proc> ()
\r
25 main [fileName] = do
\r
26 doc = parseFile fileName
\r
27 doc2 = parseString "<Persons/>"
\r
29 transformation OneShotForward where
\r
30 RootMapping (rootElementOf doc) (rootElementOf doc2)
\r
32 print $ outputString doc2
\r