diff --git a/README.md b/README.md
index 78fe805..9105d95 100644
--- a/README.md
+++ b/README.md
@@ -72,10 +72,10 @@ This document specifies the JSON Schema Definition Language, which al
6 [Sample Schemas](#6-sample-schemas) 6.1 [`structure.jsdx`](#61-structurejsdx) 6.2 [`structure.jsd`](#62-structurejsd)
-6.3 [`datatype.jsdx`](#63-datatypesjsdx)
-6.4 [`datatype.jsd`](#64-datatypesjsd)
-6.5 [`bindings.jsdx`](#65-bindingsjsdx)
-6.6 [`bindings.jsd`](#65-bindingsjsd)
+6.3 [`datatype.jsdx`](#63-datatypejsdx)
+6.4 [`datatype.jsd`](#64-datatypejsd)
+6.5 [`binding.jsdx`](#65-bindingjsdx)
+6.6 [`binding.jsd`](#65-bindingjsd) 7 [Contributing](#7-contributing) 8 [Special Thanks](#8-special-thanks) 9 [License](#9-license)
@@ -165,7 +165,7 @@ The **schema** is the root object of the JSD, and contains [type][#
| | **Property Name** | **Property Value** |
|:-|:-|:-|
-| ( **schema** )
| jx:ns
jx:schemaLocation
doc [a-zA-Z_$][-a-zA-Z\\d_$]*
| _Namespace of the JSON Schema._ Required. Used by schema processors to determine to which version of the JSON Schema the JSD is written. _Location URL of namespace._ Optional. Specified as: `"%NAMESPACE_URI% %LOCATION_URL%"` Used by schema processors to determine location of schema definition for a namespace. Text comments. Optional. _[Type Declaration][#type-declarations]_. Optional. Root object definitions that are referenceable throughout the schema. |
+| ( **schema** )
| jx:ns
jx:schemaLocation
jx:targetNamespace
doc [a-zA-Z_$][-a-zA-Z\\d_$]*
| _Namespace of the JSON Schema._ Required. Used by schema processors to determine to which version of the JSON Schema the JSD is written. _Location URL of namespace._ Optional. Specified as: `"%NAMESPACE_URI% %LOCATION_URL%"` Used by schema processors to determine location of schema definition for a namespace. _Target namespace of schema document._ Optional. Specified as: `"%NAMESPACE_URI%"` Represents the namespace of elements declared within the schema document. Text comments. Optional. _[Type Declaration][#type-declarations]_. Optional. Root object definitions that are referenceable throughout the schema. |
@@ -175,6 +175,7 @@ The **schema** is the root object of the JSD, and contains [type][#
{
"jx:ns": "http://www.jsonx.org/schema-0.4.jsd",
"jx:schemaLocation": "http://www.jsonx.org/schema-0.4.jsd http://www.jsonx.org/schema.jsd",
+ "jx:targetNamespace": "https://www.jsonx.org/example.jsd"
...
}
```
@@ -183,8 +184,10 @@ The **schema** is the root object of the JSD, and contains [type][#
```xml
+ xmlns="http://www.jsonx.org/schema-0.4.xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jsonx.org/schema-0.4.xsd http://www.jsonx.org/schema.xsd">
+ targetNamespace="https://www.jsonx.org/example.jsdx">
...
```
@@ -1344,10 +1347,10 @@ These bindings are allowed on [Object Properties of type `boolean`, `number`, or
#### 4.6.4 Examples
-1. [`datatypes.jsdx`](#63-datatypesjsdx)
-1. [`datatypes.jsd`](#64-datatypesjsd)
-1. [`bindings.jsdx`](#65-bindingsjsdx)
-1. [`bindings.jsd`](#66-bindingsjsd)
+1. [`datatype.jsdx`](#63-datatypejsdx)
+1. [`datatype.jsd`](#64-datatypejsd)
+1. [`binding.jsdx`](#65-bindingjsdx)
+1. [`binding.jsd`](#66-bindingjsd)
## 5 Related Resources for JSON Schema
@@ -1399,7 +1402,8 @@ This section provides sample schemas in both `jsdx` and `jsd` representations.
+ xsi:schemaLocation="http://www.jsonx.org/schema-0.4.xsd http://www.jsonx.org/schema.xsd"
+ doc="Schema expressing complex nested structures">
@@ -1464,6 +1468,7 @@ This section provides sample schemas in both `jsdx` and `jsd` representations.
{
"jx:ns": "http://www.jsonx.org/schema-0.4.jsd",
"jx:schemaLocation": "http://www.jsonx.org/schema-0.4.jsd http://www.jsonx.org/schema.jsd",
+ "doc": "Schema expressing complex nested structures",
"array": {
"jx:type": "array",
"elements": [{
@@ -1621,14 +1626,15 @@ This section provides sample schemas in both `jsdx` and `jsd` representations.
}
```
-#### 6.3 `datatypes.jsdx`
+#### 6.3 `datatype.jsdx`
```xml
+ xsi:schemaLocation="http://www.jsonx.org/schema-0.4.xsd http://www.jsonx.org/schema.xsd"
+ targetNamespace="http://www.jsonx.org/generator/test/datatype.jsdx"
+ doc="Schema intended to express full variability of type declarations">
@@ -1857,13 +1863,14 @@ This section provides sample schemas in both `jsdx` and `jsd` representations.
```
-#### 6.4 `datatypes.jsd`
+#### 6.4 `datatype.jsd`
```json
{
- "doc": "Schema intended to express full variability of type declarations",
"jx:ns": "http://www.jsonx.org/schema-0.4.jsd",
"jx:schemaLocation": "http://www.jsonx.org/schema-0.4.jsd http://www.jsonx.org/schema-0.4.jsd",
+ "jx:targetNamespace": "http://www.jsonx.org/generator/test/datatype.jsdx",
+ "doc": "Schema intended to express full variability of type declarations",
"arrayArr": {
"jx:type": "array",
"doc": "Array of arrays",
@@ -2821,14 +2828,14 @@ This section provides sample schemas in both `jsdx` and `jsd` representations.
}
```
-#### 6.5 `bindings.jsdx`
+#### 6.5 `binding.jsdx`
```xml
+ xsi:schemaLocation="http://www.jsonx.org/schema-0.4.xsd http://www.jsonx.org/schema.xsd"
+ doc="Schema focusing on bindings">
@@ -2936,13 +2943,13 @@ This section provides sample schemas in both `jsdx` and `jsd` representations.
```
-#### 6.6 `bindings.jsd`
+#### 6.6 `binding.jsd`
```json
{
- "doc": "Schema focusing on bindings",
"jx:ns": "http://www.jsonx.org/schema-0.4.jsd",
"jx:schemaLocation": "http://www.jsonx.org/schema-0.4.jsd http://www.jsonx.org/schema-0.4.jsd",
+ "doc": "Schema focusing on bindings",
"StringBoolean": {
"jx:type": "boolean",
"bindings": [{
diff --git a/examples/array.jsdx b/examples/array.jsdx
index 1f63640..b5214a9 100644
--- a/examples/array.jsdx
+++ b/examples/array.jsdx
@@ -17,7 +17,8 @@
+ xsi:schemaLocation="http://www.jsonx.org/schema-0.4.xsd http://www.jsonx.org/schema.xsd"
+ targetNamespace="http://www.jsonx.org/examples/array.jsdx">
diff --git a/examples/complete.jsdx b/examples/complete.jsdx
index 979e546..4298714 100644
--- a/examples/complete.jsdx
+++ b/examples/complete.jsdx
@@ -15,10 +15,11 @@
program. If not, see .
-->
+ xsi:schemaLocation="http://www.jsonx.org/schema-0.4.xsd http://www.jsonx.org/schema.xsd"
+ targetNamespace="http://www.jsonx.org/examples/complete.jsdx"
+ doc="Schema intended to provide a complete set of variations of declarations">
diff --git a/examples/datatype.jsdx b/examples/datatype.jsdx
index 8c810d7..94e09ea 100644
--- a/examples/datatype.jsdx
+++ b/examples/datatype.jsdx
@@ -15,10 +15,11 @@
program. If not, see .
-->
+ xsi:schemaLocation="http://www.jsonx.org/schema-0.4.xsd http://www.jsonx.org/schema.xsd"
+ targetNamespace="http://www.jsonx.org/examples/datatype.jsdx"
+ doc="Schema intended to express full variability of type declarations">
diff --git a/examples/reference.jsdx b/examples/reference.jsdx
index b7f321f..8276161 100644
--- a/examples/reference.jsdx
+++ b/examples/reference.jsdx
@@ -15,10 +15,11 @@
program. If not, see .
-->
+ xsi:schemaLocation="http://www.jsonx.org/schema-0.4.xsd http://www.jsonx.org/schema.xsd"
+ targetNamespace="http://www.jsonx.org/examples/reference.jsdx"
+ doc="Schema focusing on references">
diff --git a/examples/reserved.jsdx b/examples/reserved.jsdx
index 3af178e..111512f 100644
--- a/examples/reserved.jsdx
+++ b/examples/reserved.jsdx
@@ -15,10 +15,11 @@
program. If not, see .
-->
+ xsi:schemaLocation="http://www.jsonx.org/schema-0.4.xsd http://www.jsonx.org/schema.xsd"
+ targetNamespace="http://www.jsonx.org/examples/reserved.jsdx"
+ doc="Schema with names that overlap with Java's reserved words">
diff --git a/examples/structure.jsdx b/examples/structure.jsdx
index a2f0a24..7333401 100644
--- a/examples/structure.jsdx
+++ b/examples/structure.jsdx
@@ -15,10 +15,11 @@
program. If not, see .
-->
+ xsi:schemaLocation="http://www.jsonx.org/schema-0.4.xsd http://www.jsonx.org/schema.xsd"
+ targetNamespace="http://www.jsonx.org/examples/structure.jsdx"
+ doc="Schema expressing complex nested structures">
diff --git a/examples/template.jsdx b/examples/template.jsdx
index 2d91567..cc73aa4 100644
--- a/examples/template.jsdx
+++ b/examples/template.jsdx
@@ -15,10 +15,11 @@
program. If not, see .
-->
+ xsi:schemaLocation="http://www.jsonx.org/schema-0.4.xsd http://www.jsonx.org/schema.xsd"
+ targetNamespace="http://www.jsonx.org/examples/template.jsdx"
+ doc="Schema expressing the variations of templates">
diff --git a/schema-0.4/schema-0.4.jsd b/schema-0.4/schema-0.4.jsd
index 1436a63..a5e6d64 100644
--- a/schema-0.4/schema-0.4.jsd
+++ b/schema-0.4/schema-0.4.jsd
@@ -1,21 +1,22 @@
{
"jx:ns": "http://www.jsonx.org/schema-0.4.jsd",
"jx:schemaLocation": "http://www.jsonx.org/schema-0.4.jsd http://www.jsonx.org/schema-0.4.jsd",
+ "jx:targetNamespace": "http://www.jsonx.org/schema-0.4.jsd",
"min": {
"jx:type": "string",
- "pattern": "[\\d]+"
+ "pattern": "\\d+"
},
"max": {
"jx:type": "string",
- "pattern": "([\\d]+|unbounded)"
+ "pattern": "\\d+|unbounded"
},
"use": {
"jx:type": "string",
- "pattern": "(required|optional)"
+ "pattern": "required|optional"
},
"nonEmptyString": {
"jx:type": "string",
- "pattern": "\\S+( \\S+)*"
+ "pattern": "\\S|\\S.*\\S"
},
"documented": {
"jx:type": "object",
@@ -47,6 +48,12 @@
"use": "optional",
"nullable": false
},
+ "jx:targetNamespace": {
+ "jx:type": "reference",
+ "type": "nonEmptyString",
+ "use": "optional",
+ "nullable": false
+ },
"[a-zA-Z_][-a-zA-Z\\d_]*": {
"jx:type": "any",
"types": "array boolean number objectType string",
diff --git a/schema-0.4/schema-0.4.jsdx b/schema-0.4/schema-0.4.jsdx
index 0bad54e..f0d7527 100644
--- a/schema-0.4/schema-0.4.jsdx
+++ b/schema-0.4/schema-0.4.jsdx
@@ -17,12 +17,13 @@
+ xsi:schemaLocation="http://www.jsonx.org/schema-0.4.xsd schema-0.4.xsd"
+ targetNamespace="http://www.jsonx.org/schema-0.4.jsdx">
-
-
-
-
+
+
+
+