uss-xsd-engine 0.1.0-beta.3 → 0.1.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +135 -7
- package/dist/uss-xsd-engine.esm.js +925 -97
- package/dist/uss-xsd-engine.standalone.js +925 -97
- package/package.json +35 -3
package/README.md
CHANGED
|
@@ -4,6 +4,15 @@ Browser-first XSD engine for schema diagnostics, tree extraction, sample XML gen
|
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
+

|
|
8
|
+
[](https://www.jsdelivr.com/package/npm/uss-xsd-engine)
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
> 📦 Latest release: See full details in [GitHub Releases](https://github.com/mumblebaj/uss-xsd-engine/releases)
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
7
16
|
## 🚀 Overview
|
|
8
17
|
|
|
9
18
|
`uss-xsd-engine` is a standalone JavaScript engine designed to process XML Schema (XSD) directly in the browser.
|
|
@@ -85,12 +94,19 @@ import {
|
|
|
85
94
|
generateSampleXml,
|
|
86
95
|
validateXml
|
|
87
96
|
} from "uss-xsd-engine";
|
|
97
|
+
|
|
98
|
+
const result = validateXml(schema, xml);
|
|
99
|
+
console.log(result.issues);
|
|
88
100
|
```
|
|
89
101
|
|
|
90
102
|
### CDN/Browser
|
|
91
103
|
|
|
92
104
|
```HTML
|
|
93
|
-
<script src="https://unpkg.com/uss-xsd-engine@0.1.0-beta.
|
|
105
|
+
<script src="https://unpkg.com/uss-xsd-engine@0.1.0-beta.5/dist/uss-xsd-engine.standalone.js"></script>
|
|
106
|
+
|
|
107
|
+
or
|
|
108
|
+
|
|
109
|
+
<script src="https://cdn.jsdelivr.net/npm/uss-xsd-engine@0.1.0-beta.5/dist/uss-xsd-engine.esm.min.js"></script>
|
|
94
110
|
|
|
95
111
|
<script>
|
|
96
112
|
const result = UssXsdEngine.getSchemaDiagnostics({ xsdText });
|
|
@@ -173,6 +189,115 @@ validateXml({
|
|
|
173
189
|
|
|
174
190
|
---
|
|
175
191
|
|
|
192
|
+
## 🤔 Why uss-xsd-engine?
|
|
193
|
+
|
|
194
|
+
Most XML/XSD libraries were designed for server-side environments, require heavy dependencies, or lack meaningful diagnostics.
|
|
195
|
+
|
|
196
|
+
**uss-xsd-engine** is built differently — with a focus on modern, browser-first use cases and developer experience.
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
### 🌐 Browser-First by Design
|
|
201
|
+
|
|
202
|
+
* Runs fully in the browser
|
|
203
|
+
* No native dependencies or network fetching required
|
|
204
|
+
* Perfect for tools like USS, editors, and client-side validation
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
### 🧭 Precise Error Diagnostics
|
|
209
|
+
|
|
210
|
+
* Line/column support for both:
|
|
211
|
+
|
|
212
|
+
* XML parsing errors
|
|
213
|
+
* Schema validation errors
|
|
214
|
+
* Click-to-navigate support (e.g. Monaco Editor integration)
|
|
215
|
+
* Fine-grained mapping:
|
|
216
|
+
|
|
217
|
+
* elements
|
|
218
|
+
* attributes
|
|
219
|
+
* values
|
|
220
|
+
|
|
221
|
+
➡️ Debug XML like you debug code
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
### 🌐 Namespace-Aware Everything
|
|
226
|
+
|
|
227
|
+
* Proper handling of `targetNamespace`
|
|
228
|
+
* Prefix-aware sample XML generation
|
|
229
|
+
* Multi-schema support with correct namespace boundaries
|
|
230
|
+
|
|
231
|
+
➡️ No more ambiguity in complex schema environments
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
### 🔁 Real Multi-Schema Support
|
|
236
|
+
|
|
237
|
+
* Recursive `xs:include` and `xs:import` resolution
|
|
238
|
+
* Handles deep schema graphs (A → B → C)
|
|
239
|
+
* Circular-safe resolution
|
|
240
|
+
|
|
241
|
+
➡️ Works with real-world schemas (not just simple examples)
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
### 🧩 Practical XML Generation
|
|
246
|
+
|
|
247
|
+
* Generates usable sample XML
|
|
248
|
+
* Respects:
|
|
249
|
+
|
|
250
|
+
* structure
|
|
251
|
+
* required elements
|
|
252
|
+
* namespaces
|
|
253
|
+
* Designed for real testing, not just demos
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
### ⚡ Lightweight & Modular
|
|
258
|
+
|
|
259
|
+
* No heavy runtime dependencies
|
|
260
|
+
* Designed for CDN + npm usage
|
|
261
|
+
* Easy to embed into any tool or workflow
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
### 🧠 Built for Tooling
|
|
266
|
+
|
|
267
|
+
* Tree extraction for UI rendering
|
|
268
|
+
* Structured diagnostics pipeline
|
|
269
|
+
* Clean API surface for integration
|
|
270
|
+
|
|
271
|
+
➡️ Not just a library — a foundation for schema tooling
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
## 🚀 When to Use This Engine
|
|
276
|
+
|
|
277
|
+
Use **uss-xsd-engine** if you need:
|
|
278
|
+
|
|
279
|
+
* In-browser XML validation against XSD
|
|
280
|
+
* Schema-driven XML generation
|
|
281
|
+
* Developer-friendly diagnostics
|
|
282
|
+
* Multi-schema (include/import) support
|
|
283
|
+
* A lightweight alternative to server-side XML tools
|
|
284
|
+
|
|
285
|
+
---
|
|
286
|
+
|
|
287
|
+
## ⚠️ What This Is NOT (Yet)
|
|
288
|
+
|
|
289
|
+
* Full W3C spec-complete validator (edge cases still evolving)
|
|
290
|
+
* Streaming validator for very large XML
|
|
291
|
+
* Identity constraint (`xs:key`, etc.) enforcement
|
|
292
|
+
|
|
293
|
+
➡️ The focus is **practical correctness + usability**, with continuous expansion
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
💡 This engine is actively evolving — built to power real tools, not just validate specs.
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
176
301
|
## ⚠️ Supported vs Not Fully Supported
|
|
177
302
|
### ✅ Supported (v0.1.x)
|
|
178
303
|
- Most common XSD structures
|
|
@@ -181,19 +306,22 @@ validateXml({
|
|
|
181
306
|
- Restrictions (subset + occurrence checks)
|
|
182
307
|
- Facet validation (including pattern)
|
|
183
308
|
- Default / fixed semantics
|
|
184
|
-
- Include/import (manual provision)
|
|
185
|
-
- Sample XML generation (
|
|
186
|
-
- XML validation (
|
|
309
|
+
- Include/import (manual provision with recursive resolution)
|
|
310
|
+
- Sample XML generation (namespace-aware, multi-schema support)
|
|
311
|
+
- XML validation (structure, facets, and source-mapped diagnostics)
|
|
312
|
+
- XML parse diagnostics with line/column support
|
|
313
|
+
- Semantic validation diagnostics with line/column support
|
|
314
|
+
- Attribute and value-level source mapping
|
|
315
|
+
- Namespace-aware schema tree extraction
|
|
187
316
|
|
|
188
317
|
---
|
|
189
318
|
|
|
190
319
|
## ⚠️ Partially Supported / In Progress
|
|
191
320
|
- Deep sample XML expansion (choice branching, recursion depth)
|
|
192
321
|
- Full restriction theorem validation (advanced edge cases)
|
|
193
|
-
- Namespace
|
|
322
|
+
- Advanced Namespace handling (prefix customizatioon, default namespace strategies)
|
|
194
323
|
- Advanced wildcard (`xs:any`, `xs:anyAttribute`)
|
|
195
324
|
- Attribute namespace qualification
|
|
196
|
-
- Recursive include/import graph resolution
|
|
197
325
|
|
|
198
326
|
---
|
|
199
327
|
|
|
@@ -202,7 +330,7 @@ validateXml({
|
|
|
202
330
|
- Automatic network fetching of schemas
|
|
203
331
|
- Full W3C spec conformance (edge-case completeness)
|
|
204
332
|
- Streaming validation for very large XML
|
|
205
|
-
- Chameleon includes
|
|
333
|
+
- Chameleon includes (namespace adaptation)
|
|
206
334
|
|
|
207
335
|
---
|
|
208
336
|
|