Skip to content

Instantly share code, notes, and snippets.

View jamescummings's full-sized avatar

James Cummings jamescummings

View GitHub Profile
@jamescummings
jamescummings / identity-transform.xsl
Last active April 30, 2020 15:49
An example identity transform XSLT stylesheet
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:tei="http://www.tei-c.org/ns/1.0"
xmlns="http://www.tei-c.org/ns/1.0"
xpath-default-namespace="http://www.tei-c.org/ns/1.0"
exclude-result-prefixes="xs tei"
version="2.0">
<!-- Notice TEI namespace is also given in 'xpath-default-namespace' -->
@jamescummings
jamescummings / tei_minimal-new.odd
Created June 23, 2019 19:13
A proposed new tei_minimal.odd which really is minimal
<?xml version="1.0" encoding="UTF-8"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0">
<teiHeader>
<fileDesc>
<titleStmt>
<title>TEI Minimal</title>
<author>James Cummings</author>
</titleStmt>
<publicationStmt>
<publisher>TEI Consortium</publisher>
@jamescummings
jamescummings / AddingXInclude.odd
Created March 21, 2017 13:10
elementSpecs trying to purify tei_xinclude.odd (or indeed add XInclude to my own odd)
<elementSpec ident="include" ns="http://www.w3.org/2001/XInclude" mode="add">
<desc xml:lang="en" versionDate="2014-01-12">The W3C XInclude element</desc>
<classes>
<memberOf key="model.common"/>
<memberOf key="model.teiHeaderPart"/>
</classes>
<content>
<elementRef key="fallback" minOccurs="0" maxOccurs="1"/>
</content>
<attList>
@jamescummings
jamescummings / tei_mathPlusTest.odd
Last active March 10, 2017 14:32
Just a quick test using the tei_math ODD to add a new attribute with the same name as a TEI one.
<?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>
<?xml version="1.0" encoding="UTF-8"?>
<root>
<group>
<l xml:id="ms1-1">
<q target="#ms1-q-1">1</q>
</l>
<l xml:id="ms1-2">
<q target="#ms1-q-1">1</q>
</l>
<l xml:id="ms1-3">
@jamescummings
jamescummings / group-things.xsl
Created February 23, 2017 15:00
An XSLT to group and subGroup <l> elements
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xs" version="2.0">
<xsl:output method="xml" indent="yes"/>
<!--
Group input like:
<root>
<l xml:id="ms1-26">
<q target="#ms1-q-4">4</q>