-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add program for fixing USAS taxonomy, cf. #202.
- Loading branch information
1 parent
343b44e
commit e7bbb29
Showing
4 changed files
with
3,220 additions
and
1,359 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
fix-usas: | ||
$s -xsl:fix-usastaxo.xsl usas-taxonomy.orig.xml > usas-taxonomy.xml | ||
xmllint --noout usas-taxonomy.orig.xml | ||
s = java -jar /usr/share/java/saxon.jar |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?xml version="1.0"?> | ||
<!-- Fix USAS taxonomy --> | ||
<xsl:stylesheet | ||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
xmlns:xi="http://www.w3.org/2001/XInclude" | ||
xmlns:tei="http://www.tei-c.org/ns/1.0" | ||
xmlns="http://www.tei-c.org/ns/1.0" | ||
xmlns:et="http://nl.ijs.si/et" | ||
exclude-result-prefixes="#all" | ||
version="2.0"> | ||
|
||
<xsl:output method="xml" indent="yes"/> | ||
|
||
<xsl:template match="tei:teiCorpus | tei:teiHeader"> | ||
<xsl:copy> | ||
<xsl:copy-of select="@*"/> | ||
<xsl:apply-templates/> | ||
</xsl:copy> | ||
</xsl:template> | ||
|
||
<xsl:template match="@id"> | ||
<xsl:attribute name="xml:id"> | ||
<xsl:value-of select="replace( | ||
replace( | ||
replace(., ':', '.'), | ||
'\-', 'n'), | ||
'\+', 'p') | ||
"/> | ||
</xsl:attribute> | ||
</xsl:template> | ||
|
||
<xsl:template match="*"> | ||
<xsl:copy> | ||
<xsl:apply-templates select="@*"/> | ||
<xsl:apply-templates/> | ||
</xsl:copy> | ||
</xsl:template> | ||
<xsl:template match="@*"> | ||
<xsl:copy/> | ||
</xsl:template> | ||
|
||
</xsl:stylesheet> |
Oops, something went wrong.