Last active
March 10, 2017 14:32
-
-
Save jamescummings/155429676474d9416b8251c717776657 to your computer and use it in GitHub Desktop.
Just a quick test using the tei_math ODD to add a new attribute with the same name as a TEI one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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:math="http://www.w3.org/1998/Math/MathML" | |
> | |
<teiHeader> | |
<fileDesc> | |
<titleStmt> | |
<title>TEI with MathML and testing attributes with same name</title> | |
<author>Sebastian Rahtz</author> | |
</titleStmt> | |
<publicationStmt> | |
<p>Blah</p> | |
</publicationStmt> | |
<sourceDesc> | |
<p>authored from scratch</p> | |
</sourceDesc> | |
</fileDesc> | |
</teiHeader> | |
<text> | |
<body> | |
<p>Just a quick test using the tei_math ODD to add a new attribute with the same name as a TEI one.</p> | |
<schemaSpec ident="tei_math" prefix="tei_" start="TEI teiCorpus" xmlns:teix="http://www.tei-c.org/ns/Examples" | |
defaultExceptions="http://www.w3.org/1998/Math/MathML http://www.tei-c.org/ns/1.0 teix:egXML"> | |
<moduleRef | |
url="http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/mathml2-main.rng"/> | |
<moduleRef key="header"/> | |
<moduleRef key="core"/> | |
<moduleRef key="tei"/> | |
<moduleRef key="textstructure"/> | |
<moduleRef key="figures"/> | |
<elementSpec module="figures" ident="formula" mode="change"> | |
<content> | |
<rng:ref name="mathml.math"/> | |
</content> | |
</elementSpec> | |
<elementSpec ident="TEI" module="textstructure" mode="change"> | |
<attList> | |
<!-- A new attribute with a different name --> | |
<attDef ident="blort" ns="http://www.w3.org/1998/Math/MathML" mode="add"> | |
<valList type="closed"> | |
<valItem ident="foo"><desc>foo</desc></valItem> | |
</valList> | |
</attDef> | |
<!-- A new attribute with the same name --> | |
<attDef ident="n" ns="http://www.w3.org/1998/Math/MathML" mode="add"> | |
<valList type="closed"> | |
<valItem ident="NValue"><desc>NValue</desc></valItem> | |
</valList> | |
</attDef> | |
</attList> | |
</elementSpec> | |
</schemaSpec> | |
</body> | |
</text> | |
</TEI> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your ODD defines a second attribute called n as a local child of the TEI element, rather than as a member of att.global. But the n supplied by att.global is still there: hence the duplication. And neither of them works because of the name clash. Just for completeness, here's my (slightly simpler) demonstration file