TEI schemas for project documents.
This repo contains the schema and annotated template files to be used to enter new data while a proper form is prepared.
Project members can find more documentation as part of the project guidelines.
tei-betamesaheft.xml
. This entails a customization of version 3.5.0 of the TEI Guidelines. Files created by the team in the framework of this project must be valid against this TEI customisation.tei-betamesaheft-expanded.odd
is a derived ODD (that uses tei-betamesaheft.xml
as its source) and it is meant to validate the expanded files generated in the app as well as files generated by other related projects.tei-betamesaheft.rng
andtei-betamesaheft-expanded.rng
are automatically generated from these ODDs through the TEIGarage API.For creating a XAR file with the schemas:
Run
ant
or
ant xar
While the workflow is automated to run on CI, should you wish to process the ODDs locally, there are different alternatives.
If you have the XML editor oXygen, you can configure a transformation scenario (Ctrl + Shift + C
). If the ODD files have the .odd
extension (instead of .xml
), oXygen already offers an associated scenario to this extension that converts the ODD to RELAXNG, so you only need to select this option.
From a file with the .xml
extension, you need to create a new scenario, or even easier, modify one of the TEI existing scenarios to create the
the ODD to RELAXNG one. To do so:
Ctrl + Shift + C
to open the Configure transformation scenario(s)
window.TEI P5 DOCX
. Edit
and a dialogue will offer you to create a copy instead and edit that copy. Accept. ODD to RELAXNG
for example). Build file
paste the following path: ${frameworksDir}/tei/xml/tei/stylesheet/relaxng/build-to.xml
Output
tab and change in the field Open
(at least) the extension of the output file. You can also define here the output folder (as default, oXygen creates a out
folder but you can change that behaviour by having in the field Open
the following path: ${cfd}/${cfn}.rng
).There are different options:
libbatik-java
and libavalon-framework-jav
.The ODD files are validated against the tei_odds RELAXNG schema.
jing
.E.g.:jing tei_odds.rng tei-betamesaheft.xml
extract-schematron.xsl
stylesheet:java -jar saxon-he-xx.x.jar -s:tei_odds.rng -xsl:extract-schematron.xslt -o:tei_odds.sch
java -jar schxslt-cli.jar -d tei-betamesaheft.xml -s tei_odds.sch -o report-main.xml
odd2odd.xsl
(for the expanded version, we only have this second option and it needs that the main ODD, tei-betamesaheft.xml
has been compiled first and saved under the name tei-betamesaheft_compiled.xml
):
curl -X 'POST' \
'https://teigarage.tei-c.org/ege-webservice/Conversions/ODD%3Atext%3Axml/ODDC%3Atext%3Axml' \
-H 'Content-Type: multipart/form-data' \
-F 'fileToConvert=@tei-betamesaheft.xml;type=text/xml' > tei-betamesaheft_compiled.xml
java -jar saxon-he-xx.x.jar -s:tei-betamesaheft-expanded.xml -xsl:odd2odd.xsl -o:tei-betamesaheft-expanded_compiled.xml
For the generation of the RELAXNG schemas we use the TEIGarage API uploading the compiled versions of the ODDs.
'https://teigarage.tei-c.org/ege-webservice/Conversions/ODD%3Atext%3Axml/ODDC%3Atext%3Axml/relaxng%3Aapplication%3Axml-relaxng/' \
-H 'Content-Type: multipart/form-data' \
-F 'fileToConvert=@tei-betamesaheft_compiled.xml;type=text/xml' > tei-betamesaheft.rng
Since at the moment TEIGarage cannot resolve local sources, we delete the @source
attribute with sed
in the derived ODD (the expanded version).
sed -i 's/ source="tei-betamesaheft_compiled.xml"//' tei-betamesaheft-expanded_compiled.xml
After this change we can use TEIGarage for the RELAXNG transformation.
We check that the generated schemas are well-formed with xmllint
. E.g.:
xmllint --noout tei-betamesaheft.rng
Your XML editor will recognize the <?xml-model?>
instruction on the top of the XMLs files.
Your ODD files should be associated to the the tei_odds
customisation:
<?xml-model href="http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_odds.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_odds.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
The project files should be associated to the RELAXNG files of this repository:
<?xml version="1.0" encoding="UTF-8"?><?xml-model href="https://raw.githubusercontent.com/BetaMasaheft/Schema/master/tei-betamesaheft.rng"
schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="https://raw.githubusercontent.com/BetaMasaheft/Schema/master/tei-betamesaheft.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
A .xar
package can be installed in eXist-db to make the RELAXNG schema files available via import
statements.