Skip to content
/ eg2xsd Public

An XSLT transformation that compiles an Examplotron schema into an XML Schema (XSD) file

License

Notifications You must be signed in to change notification settings

Accuity/eg2xsd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eg2xsd

An XSLT transformation that compiles an Examplotron schema into an XML Schema (XSD) file.

Subject to differences in expressibility between XML Schema and RelaxNG, this transform attempts to faithfully implement the Examplotron schema language, as of v0.8 (21 August 2013), and then add a few extensions not present in the canonical Examplotron.

For compatibility, it reads the Examplotron v0.* namespace: xmlns:eg="http://examplotron.org/0/"

Extensions use the extension namespace: xmlns:egx="http://accuity.com/egx/0/"

For most input, this transform will produce a XSD 1.0 compliant schema. Known exceptions are:

  1. If assertions are made with eg:assert
  2. If elements of unbounded occurrence appear in elements with eg:interleave'd or mixed content models

See CHANGES.md for more details

Implementation Changes

Using XSD rather than RelaxNG as the output format means differences in what can be expressed meaningfully.

Extensions include:

  • Choice content model
  • Import/Include functionality
  • Pattern constraints (regex)
  • Enum constraints

For all changes and extensions, see CHANGES.md

Testing

test/eg2xsd.xspec describes test scenarios that can be run using the XSpec testing framework.

xspec.sh test/eg2xsd.xspec on Mac/Linux, or xspec.bat test\eg2xsd.xspec on Windows

To Do

  • @egx:maxLength

About

An XSLT transformation that compiles an Examplotron schema into an XML Schema (XSD) file

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages