-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbinding-0.5.jsdx
97 lines (76 loc) · 5.42 KB
/
binding-0.5.jsdx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<!--
Copyright (c) 2023 JSONx
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
You should have received a copy of The MIT License (MIT) along with this
program. If not, see <http://opensource.org/licenses/MIT/>.
-->
<schema
xmlns="http://www.jsonx.org/schema-0.5.xsd"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:jxns="http://www.jsonx.org/namespace"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.jsonx.org/schema-0.5.xsd schema-0.5.xsd"
jxns:jx="http://www.jsonx.org/schema-0.5.jsdx"
jxns:ji="http://www.jsonx.org/include-0.5.jsdx"
targetNamespace="http://www.jsonx.org/binding-0.5.jsdx">
<import namespace="http://www.jsonx.org/schema-0.5.jsdx" schemaLocation="http://www.jsonx.org/schema-0.5.jsdx"><xi:include href="http://www.jsonx.org/schema-0.5.jsdx"/></import>
<import namespace="http://www.jsonx.org/include-0.5.jsdx" schemaLocation="http://www.jsonx.org/include-0.5.jsdx"><xi:include href="http://www.jsonx.org/include-0.5.jsdx"/></import>
<string name="nonEmptyString" pattern="\S|\S.*\S"/>
<string name="typeIdentifier" pattern="(([a-zA-Z_$][a-zA-Z\d_$]*)\.)*[a-zA-Z_$][a-zA-Z\d_$]*(<.*>)?(\[\])?"/> <!-- FIXME: The generic section is loosely enforced -->
<string name="methodIdentifier" pattern="(([a-zA-Z_$][a-zA-Z\d_$]*)\.)*[a-zA-Z_$][a-zA-Z\d_$]*(\.<init>)?"/>
<string name="fieldIdentifier" pattern="[a-zA-Z_$][a-zA-Z\d_$]*"/>
<object name="fieldBinding" doc="Specifies language-specific binding.">
<property name="@field" xsi:type="reference" type="fieldIdentifier" use="optional" nullable="false" doc="Specifies the "field" identifier."/>
</object>
<object name="typeFieldBinding" extends="fieldBinding" doc="Specifies language-specific binding.">
<property name="@type" xsi:type="reference" type="typeIdentifier" use="optional" nullable="false" doc="Specifies the "type" qualified identifier."/>
</object>
<object name="codecTypeFieldBinding" extends="typeFieldBinding" doc="Specifies language-specific binding.">
<property name="@decode" xsi:type="reference" type="methodIdentifier" use="optional" nullable="false" doc="Specifies the "decode" qualified function identifier that accepts input as a string, or as the native JSON type of this property, and returns an output of the specified "type" (or the default type if "type" is unspecified)."/>
<property name="@encode" xsi:type="reference" type="methodIdentifier" use="optional" nullable="false" doc="Specifies the "encode" qualified function identifier that accepts input of the type specified in "type" (or the default type if "type" is unspecified), and returns an output as a string, or as the native JSON type of this property."/>
<!-- FIXME: Equivalent of <xs:assert test="some $path in ../@path satisfies not(@field) or count(tokenize($path, '([^\\]|\\\\)\[')) = 1 and count(tokenize($path, '([^\\]|\\\\)\.')) > 1"/> is not yet possible in JSDx -->
</object>
<object name="fieldBindings" abstract="true">
<property names="\S|\S.*\S" xsi:type="any" types="fieldBinding" nullable="false"/>
</object>
<object name="typeFieldBindings" abstract="true">
<property names="\S|\S.*\S" xsi:type="any" types="typeFieldBinding" nullable="false"/>
</object>
<object name="codecTypeFieldBindings" abstract="true">
<property names="\S|\S.*\S" xsi:type="any" types="codecTypeFieldBinding" nullable="false"/>
</object>
<object name="any" extends="typeFieldBindings">
<property name="@" xsi:type="string" pattern="any" nullable="false"/>
</object>
<object name="reference" extends="fieldBindings">
<property name="@" xsi:type="string" pattern="reference" nullable="false"/>
</object>
<object name="array" extends="fieldBindings">
<property name="@" xsi:type="string" pattern="array" nullable="false"/>
</object>
<object name="object" extends="typeFieldBindings">
<property name="@" xsi:type="string" pattern="object" nullable="false"/>
</object>
<object name="boolean" extends="codecTypeFieldBindings">
<property name="@" xsi:type="string" pattern="boolean" nullable="false"/>
</object>
<object name="number" extends="codecTypeFieldBindings">
<property name="@" xsi:type="string" pattern="number" nullable="false"/>
</object>
<object name="string" extends="codecTypeFieldBindings">
<property name="@" xsi:type="string" pattern="string" nullable="false"/>
</object>
<object name="binding">
<property name="@ns" xsi:type="string" pattern="http://www.jsonx.org/binding-0.5.jsd" nullable="false"/>
<property name="@schemaLocation" xsi:type="string" pattern="((\S|\S.*\S) (\S|\S.*\S))+" use="optional" nullable="false"/>
<property names="@schema" xsi:type="any" types="jx:schema ji:include" nullable="false"/>
<property names="\S|\S.*\S" xsi:type="any" types="any reference array object boolean number string" nullable="false"/>
</object>
</schema>