File: copynamespace-18.xq

package info (click to toggle)
qtxmlpatterns-opensource-src 5.15.8-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 308,892 kB
  • sloc: xml: 360,343; cpp: 91,994; ansic: 388; sh: 53; sed: 31; makefile: 23
file content (18 lines) | stat: -rw-r--r-- 799 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
(: Name: copynamespace-18 :)
(: Written by: Carmelo Montanez :)
(: Description: Evaluates copy namespace declaration with value set to "preserve no-inherit" .:)
(: with multiple inclusions.  Examines last element in subtree.:)

declare copy-namespaces preserve,no-inherit;

declare variable $element1 := <element1 xmlns:namespace1="http://www.namespace1.com"></element1>;
declare variable $element2 := <element2 xmlns:namespace2="http://www.namespace2.com">{$element1}</element2>;
declare variable $element3 := <element3 xmlns:namespace3="http://www.namespace3.com">{$element2}</element3>;

(: insert-start :)
declare variable $input-context1 external;
(: insert-end :)

for $var in (in-scope-prefixes($element3/element2/element1))
order by exactly-one($var) ascending
return $var