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 $regions := for $rect in $rects where matches($rect/@id, "region.*") return $rect
19 let $goals := for $rect in $rects where matches($rect/@id, "goal.*") return (
20 let $goal_id := replace($rect/@id, "goal(.*)", "$1")
21 let $goal_region := for $region in $regions where $region/@id = concat("region", $goal_id) return $region
25 $goal_region[1]/@x, " ",
26 $goal_region[1]/@y, " ",
27 $goal_region[1]/@width, " ",
28 $goal_region[1]/@height, " ",
29 replace($rect/@style, ".*fill:#([0-9a-z]{6}).*", "$1")
32 let $lavas := for $rect in $rects where matches($rect/@id, "lava.*")
38 replace($rect/@style, ".*fill:#([0-9a-z]{6}).*", "$1")
40 let $background := for $rect in $rects where $rect/@id = "background"
41 return replace($rect/@style, ".*fill:#([0-9a-z]{6}).*", "$1")
42 let $backplatforms := for $rect in $rects where matches($rect/@id, "^backrect.*")
48 replace($rect/@style, ".*fill:#([0-9a-z]{6}).*", "$1")
59 count($backplatforms),