source: trunk/DbXmlAccessLib/resources/tnt-vd-spec.rnc @ 481

Revision 481, 2.1 KB checked in by vzholudev, 2 years ago (diff)

Allow href in the query element

  • Property svn:keywords set to HeadURL Rev Date Author Id URL
Line 
1# A RelaxNG schema for TNTBase Specifications for Virtual Documents
2# $Id$
3# $HeadURL$
4# See the documentation and examples at http://www.omdoc.org
5# Copyright (c) 2010 Vyacheslav Zholudev, released under the Apache 2.0 License
6
7default namespace tnt = "http://tntbase.mathweb.org/ns"
8
9#common definitions
10id.attrib = attribute xml:id {xsd:string}
11name.attrib = attribute name {text}
12query.attrib = attribute query {text}
13href.attrib = attribute href {xsd:string {minLength = "1"}}
14any.attrib = attribute * {xsd:string}
15any.el = element * {(any.attrib*, any.el*) & text*}
16
17#query elements - inside the skeleton and outside
18query.outside.el = element query {name.attrib, (xsd:string {minLength = "1"} | href.attrib)}
19query.inside.el = element query {name.attrib | xsd:string {minLength = "1"} | href.attrib}
20
21#root element of VD specification
22virtualdocument = element virtualdocument {id.attrib?, virtualdocument.model}
23virtualdocument.model = skeleton, (query.outside.el* & params?)
24
25#skeleton element - either empty with reference to another skeleton or with "meat"
26skeleton = element skeleton {id.attrib? & (skeleton.model | href.attrib)}
27#the skeleton should contain exactly one non tnt element as a child
28skeleton.model = element * - tnt:* {xqel* & any.attrib* & text*}
29
30#typical element of a skeleton - either tnt:xqinclude or arbitrary non-tnt element ot text
31xqel = xq | element * - tnt:* {xqel* & any.attrib* & text*}
32
33#tnt:xqinclude element - should contain a query as an attribute, or have a child tnt:query
34#Query as element should reference a query or contain a query as a text
35#The second allowed element is tnt:return
36xq = element xqinclude {(query.attrib | query.inside.el) , return.el}
37
38#tnt:return element and its children
39return.el = element return {return.internal.el*}
40return.internal.el = result.el | text* | element * - tnt:* {return.internal.el* & any.attrib*}
41result.el = element result {empty}
42
43#parameters
44params = element params {param+}
45param = element param{name.attrib, value+}
46value = element value {xsd:string {minLength = "1"}}
47
48#virtualdocument is the root element
49start = virtualdocument
Note: See TracBrowser for help on using the repository browser.