source: mauRepo/ISO19136-AnxE/test-023.xq @ 8191

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/ISO19136-AnxE/test-023.xq@8253
Revision 8191, 1.8 KB checked in by mnagni, 8 years ago (diff)

#{ROOT_URL}ISO19136-AnxE parametrized the import URLs

Line 
1xquery version "1.0";
2(:~~~~~~~~~~~~~~~~~~~~~~~~~~ Conformance Test  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3Test Number:    023
4Description:    Asserts both ends of an association should not have
5                                navigability non-navigable (isNavigable=false).
6Reference:             
7~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~:)
8
9import module namespace mod-fr = "urn:local-module:ISO19136-V3.2-AnxE_XMI-V1.1:framework"
10at "#{ROOT_URL}ISO19136-AnxE/modules/module-framework-functions.xq";
11
12import module namespace mod-xp = "urn:local-module:ISO19136-V3.2-AnxE_XMI-V1.1:xmi-proc"
13at "#{ROOT_URL}ISO19136-AnxE/modules/module-xproc-functions.xq";
14
15declare namespace UML   = "omg.org/UML1.3";
16declare namespace cr    = "http://ndg.service.newmoon.conftest-result/1.0";
17
18(: Declare local variables, particular to this test :)
19declare variable $test-num as xs:integer := 23;
20declare variable $pass-msg as xs:string := "All associations do have at least one navigable end.";
21declare variable $fail-msg as xs:string := "WARNING: This will not be encoded because:";
22
23(:
24        #Date:          2009-01-09
25        #Author:        Krupali Patel
26
27        Declare the local assert function which defines a postive condition for pass.
28       
29        #Date:          2009-01-16
30        #Update:        Krupali Patel
31:)
32declare function local:assert($doc-root as node()?) as node()?
33{
34        let
35                $fail := (
36                        for $assoc in $doc-root//UML:Association[count(UML:Association.connection/UML:AssociationEnd[@isNavigable eq "false"]) eq 2]
37                        return <cr:message>{ concat("Both ends of the ", mod-xp:verbose-association($assoc), " are non-navigable.") }</cr:message>
38                )
39        return
40                if (empty($fail)) then ()
41                else
42                        <cr:fail>
43                                <cr:messages>{ $fail }</cr:messages>
44                        </cr:fail>     
45};
46
47(: Create a new result element :)
48mod-fr:new-result($test-num, $pass-msg, $fail-msg, local:assert(/))
Note: See TracBrowser for help on using the repository browser.