Skip to content

Instantly share code, notes, and snippets.

@ghukill
Created February 5, 2018 17:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ghukill/a9c5852ccd94d1475d3bb6eb23e3ac49 to your computer and use it in GitHub Desktop.
Save ghukill/a9c5852ccd94d1475d3bb6eb23e3ac49 to your computer and use it in GitHub Desktop.
Recursive allow hack for RELAX NG
<?xml version="1.0" encoding="UTF-8"?>
<grammar
xmlns="http://relaxng.org/ns/structure/1.0"
xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<start>
<choice>
<ref name="any_content"/>
</choice>
</start>
<!-- This is a strange little group of definitions that allow for anything recusively downsteam -->
<define name="any_content">
<interleave>
<zeroOrMore>
<ref name="any_element"/>
</zeroOrMore>
<text/>
</interleave>
</define>
<define name="any_element">
<element>
<anyName/>
<zeroOrMore>
<ref name="any_attribute"/>
</zeroOrMore>
<zeroOrMore>
<ref name="any_content"/>
</zeroOrMore>
</element>
</define>
<define name="any_attribute">
<attribute>
<anyName/>
</attribute>
</define>
</grammar>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment