File: validateexpr-30.xq

package info (click to toggle)
qtxmlpatterns-opensource-src 5.15.2-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 309,144 kB
  • sloc: xml: 360,343; cpp: 91,994; ansic: 388; sh: 53; sed: 31; makefile: 23
file content (18 lines) | stat: -rw-r--r-- 724 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 : validateexpr-30 :)
(: Description: Test that validating a document node (with processing instructions and comments) does not throw a type error in static typing implementations when used as an expression of type document(). :)
(: Author: Oliver Hallam :)
(: Date: 2010-03-15 :)

(: insert-start :)
import schema default element namespace "http://www.w3.org/XQueryTestOrderBy";
(: insert-end :)

let $document as document-node(element(Strings)) := 
  document { (
    <!--comment-->, 
    <Strings><orderData>one string</orderData></Strings>,
    <?processing instruction?>
  ) }
let $validated as document-node(schema-element(Strings)) :=
  validate { $document }
return count($validated/node())