https://github.com/TEIC/TEI
Raw File
Tip revision: 773926275c5b1f5611ca52b0b3fb68f5655f5b99 authored by Sebastian Rahtz on 08 November 2009, 22:06:19 UTC
create tag of P5 release 1.5.0
Tip revision: 7739262
p5odds-ex.odd
<?xml version="1.0" encoding="UTF-8"?>
<TEI xml:lang="en" xmlns="http://www.tei-c.org/ns/1.0"
     xmlns:rng="http://relaxng.org/ns/structure/1.0"
     xmlns:xi="http://www.w3.org/2001/XInclude">
  <teiHeader>
    <fileDesc>
      <titleStmt>
	<title>TEI with maximal setup</title>
	<author>Sebastian Rahtz</author>
      </titleStmt>
      <publicationStmt>
	<p> </p>
      </publicationStmt>
      <sourceDesc>
	<p>authored from scratch</p>
      </sourceDesc>
    </fileDesc>
  </teiHeader>
  <text>
    <body>
      <schemaSpec ns="http://www.tei-c.org/ns/Examples" ident="p5examples" prefix="TEI_" start="egXML"  xmlns:rng="http://relaxng.org/ns/structure/1.0">
	<moduleRef key="tei"/>
	<moduleRef key="core"/>
	<moduleRef url="Exemplars/mathml2-main.rng"/>
	<moduleRef url="Exemplars/relaxng.rng"/>
	<moduleRef url="Exemplars/svg11.rng"/>
	<moduleRef key="analysis"/>
	<moduleRef key="certainty"/>
	<moduleRef key="corpus"/>
	<moduleRef key="declarefs"/> 
	<moduleRef key="dictionaries"/>
	<moduleRef key="drama"/>
	<moduleRef key="figures"/>
	<moduleRef key="gaiji"/>
	<moduleRef key="header"/>
	<moduleRef key="iso-fs"/>
	<moduleRef key="linking"/>
	<moduleRef key="msdescription"/>
	<moduleRef key="namesdates"/>
	<moduleRef key="nets"/>
	<moduleRef key="spoken"/>
	<moduleRef key="tagdocs"/>
	<moduleRef key="textcrit"/>
	<moduleRef key="textstructure"/>
	<moduleRef key="transcr"/>
	<moduleRef key="verse"/>

	<classSpec module="tei" mode="change" ident="att.global" type="atts">
	  <attList>
	    <attDef ident="topic" mode="add"
		    ns="http://www.example.org/ns/nonTEI">
	      <datatype>
		<rng:data type="string"/>
	      </datatype>
	    </attDef>
	  </attList>
	</classSpec>

	<elementSpec module="figures" mode="change" ident="formula">
	  <content>
	    <rng:choice>
	      <rng:ref name="mathml.math"/>
	      <rng:text/>
	    </rng:choice>
	  </content>
	</elementSpec>
	
	<macroSpec ident="anyTEI" mode="add">
	  <content>
	    <element xmlns="http://relaxng.org/ns/structure/1.0"
		     ns="http://www.tei-c.org/ns/Examples">
	      <xi:include href="Exemplars/names.xml">
		<xi:fallback> ERROR: cannot locate list of
		names</xi:fallback>
	      </xi:include>
	      <ref name="att.global.attribute.xmlid"/>
	      <ref name="att.global.attribute.xmllang"/>
	      <zeroOrMore>
		<attribute>
		  <anyName>
		    <except>
		      <name>xml:id</name>
		      <name>xml:lang</name>
		    </except>
		  </anyName>
		</attribute>
	      </zeroOrMore>
	      <zeroOrMore>
		<choice>
		  <text/>
		  <ref name="anyTEI"/>
		  <ref name="macro.schemaPattern"/>
		  <ref name="mathml.math"/>
		  <ref name="anySchematron"/>
		  <ref name="anyISOSchematron"/>
		</choice>
	      </zeroOrMore>
	    </element>
	  </content>
	</macroSpec>
	
	<macroSpec ident="anyISOSchematron" mode="add">
	  <content>
	    <element xmlns="http://relaxng.org/ns/structure/1.0">
	      <nsName ns="http://purl.oclc.org/dsdl/schematron"/>
	      <zeroOrMore>
		<choice>
		  <attribute>
		    <anyName/>
		  </attribute>
		  <ref name="anyISOSchematron"/>
		  <text/>
	      </choice>
	      </zeroOrMore>
	    </element>
	  </content>
	</macroSpec>
	
	
	<macroSpec ident="anySchematron" mode="add">
	  <content>
	    <element xmlns="http://relaxng.org/ns/structure/1.0">
	      <nsName ns="http://www.ascc.net/xml/schematron"/>
	      <zeroOrMore>
		<choice>
		  <attribute>
		    <anyName/>
		  </attribute>
		  <ref name="anySchematron"/>
		  <text/>
		</choice>
	      </zeroOrMore>
	    </element>
	  </content>
	</macroSpec>
	
	<macroSpec ident="macro.schemaPattern" mode="change"
		   module="tagdocs">
	  <content>
	    <group xmlns="http://relaxng.org/ns/structure/1.0">
	      <choice>
		<text/>
		<oneOrMore>
		  <ref name="pattern"/>
		</oneOrMore>
	      </choice>
	    </group>
	  </content>
	</macroSpec>

      <elementSpec ident="data" mode="change" module="tagdocs">
	<content>
	  <zeroOrMore xmlns="http://relaxng.org/ns/structure/1.0">
	    <choice>
	      <text/>
	      <ref name="anySchematron"/>
	      <ref name="anyISOSchematron"/>
	    </choice>
	  </zeroOrMore>
	</content>
      </elementSpec>

	<elementSpec ident="fallback" ns="http://www.example.org/cannot/really/use/XInclude" mode="add">
	  <content xmlns:rng="http://relaxng.org/ns/structure/1.0">
	    <rng:optional>
	      <rng:ref name="anyTEI"/>
	    </rng:optional>
	  </content>
	</elementSpec>

	<!-- The goal here is to permit *any* element from the nh: namespace-->
	<!-- The prolbem is that we can't do this via <elementSpec>, as it-->
	<!-- requires a name be specified on ident=, and separates contnent-->
	<!-- declaration from attribute declaration (maybe we could put the-->
	<!-- attribute declaration inside elementSpec/content/, but it's not-->
	<!-- how it is intended to work). So instead, we just define a macro-->
	<!-- which will resolve the RELAX NG declarations we want-->
	<macroSpec ident="anyAlien" mode="add">
	  <content>
	    <!-- macro defines a single element type, as it were, but -->
	    <element  xmlns="http://relaxng.org/ns/structure/1.0">
	      <!-- there is no restriction on the local name part, but-->
	      <!-- it must be in the following namespace: -->
	      <nsName ns="http://www.example.org/ns/nonTEI"/>
	      <!-- element can have any number of any attrs with any values: -->
	      <zeroOrMore>
		<attribute>
		  <anyName/>
		  <data type="token"/>
		</attribute>
	      </zeroOrMore>
	      <zeroOrMore>
		<choice>
		  <text/>
		  <ref name="anyTEI"/>
		  <ref name="anyAlien"/>
		</choice>
	      </zeroOrMore>
	      <empty/>
	    </element>
	  </content>
	</macroSpec>

	<!-- in examples we'd like to be able to show use of <xi:include>; of course, -->
	<!-- we can't put in an <xi:include> element, or it will be processed! Thus, -->
	<!-- here we use a bogus namespace -->
	<elementSpec ident="include" ns="http://www.example.org/cannot/really/use/XInclude" mode="add">
	  <!-- the content and attributes were devised based on my reading of the spec at
	       http://www.w3.org/TR/2006/REC-xinclude-20061115/, also having looked at
	       Norm Walsh's implimentation for DocBook. -sb -->
	  <content>
	    <rng:optional>
	      <rng:ref name="fallback"/>
	    </rng:optional>
	  </content>
	  <attList>
	    <attDef ident="href">
	      <datatype>
		<rng:data type="anyURI">
		  <rng:param name="pattern">[^#]+</rng:param>
		</rng:data>
	      </datatype>
	    </attDef>
	    <attDef ident="parse">
	      <defaultVal>xml</defaultVal>
	      <valList>
		<valItem ident="xml"/>
		<valItem ident="text"/>
	      </valList>
	    </attDef>
	    <attDef ident="xpointer">
	      <datatype>
		<rng:data type="string"/>
	      </datatype>
	    </attDef>
	    <attDef ident="encoding">
	      <datatype>
		<rng:data type="string"/>
	      </datatype>
	    </attDef>
	    <attDef ident="accept">
	      <datatype>
		<rng:data type="string"/>
	      </datatype>
	    </attDef>
	    <attDef ident="accept-language">
	      <datatype>
		<rng:data type="string"/>
	      </datatype>
	    </attDef>
	  </attList>
	</elementSpec>

	<elementSpec ident="egXML" module="tagdocs" mode="change">
	  <content>
	    <group xmlns="http://relaxng.org/ns/structure/1.0">
	      <zeroOrMore>
		<choice>
		  <xi:include href="Exemplars/exnames.xml">
		    <xi:fallback> ERROR: cannot locate list of names</xi:fallback>
		  </xi:include>
		  <ref name="mathml.math"/>
		  <ref name="svg"/>
		  <ref name="anySchematron"/>
		  <ref name="anyISOSchematron"/>
		  <ref name="include"/>
		  <ref name="anyAlien"/>
		  <text/>
		</choice>
	      </zeroOrMore>
	    </group>
	  </content>
	</elementSpec>
      </schemaSpec>
    </body>
  </text>
</TEI>
back to top