1 declare namespace svg ="http://www.w3.org/2000/svg";
3 let $rects := //svg:svg/svg:rect
4 let $player := for $rect in $rects where $rect/@id = "player"
8 replace($rect/@style, ".*fill:#([0-9a-z]{6}).*", "$1")
10 let $platforms := for $rect in $rects where matches($rect/@id, "^rect.*")
16 replace($rect/@style, ".*fill:#([0-9a-z]{6}).*", "$1")
18 let $boxes := for $rect in $rects where matches($rect/@id, "^box.*")
24 replace($rect/@style, ".*fill:#([0-9a-z]{6}).*", "$1")
26 let $regions := for $rect in $rects where matches($rect/@id, "region.*") return $rect
27 let $goals := for $rect in $rects where matches($rect/@id, "goal.*") return (
28 let $goal_id := replace($rect/@id, "goal(.*)", "$1")
29 let $goal_region := for $region in $regions where $region/@id = concat("region", $goal_id) return $region
33 $goal_region[1]/@x, " ",
34 $goal_region[1]/@y, " ",
35 $goal_region[1]/@width, " ",
36 $goal_region[1]/@height, " ",
37 replace($rect/@style, ".*fill:#([0-9a-z]{6}).*", "$1")
40 let $lavas := for $rect in $rects where matches($rect/@id, "lava.*")
46 replace($rect/@style, ".*fill:#([0-9a-z]{6}).*", "$1")
48 let $background := for $rect in $rects where $rect/@id = "background"
49 return replace($rect/@style, ".*fill:#([0-9a-z]{6}).*", "$1")
50 let $backplatforms := for $rect in $rects where matches($rect/@id, "^backrect.*")
56 replace($rect/@style, ".*fill:#([0-9a-z]{6}).*", "$1")
67 count($backplatforms),