Skip to content

Commit

Permalink
update dependencies, allowing new rng folder and old relaxng folder r…
Browse files Browse the repository at this point in the history
…efs #5
  • Loading branch information
anneferger committed Nov 27, 2023
1 parent 6ae4f04 commit dbbb801
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>pl.psnc.dl.ege.tei</groupId>
<artifactId>tei-converter</artifactId>
<version>0.6.4</version>
<version>0.6.5</version>
<name>EGE TEI Converter</name>
<properties>

Expand Down Expand Up @@ -145,7 +145,7 @@
<dependency>
<groupId>com.twelvemonkeys.imageio</groupId>
<artifactId>imageio-tiff</artifactId>
<version>3.1.1</version>
<version>3.9.4</version>
</dependency>
<dependency>
<groupId>com.thaiopensource</groupId>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/pl/psnc/dl/ege/tei/Format.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public enum Format {
ODDJSON("oddjson","application/json","oddjson","ODDC", "Compiled TEI ODD", "text", "Source ODD spec in JSON notation", "text", false, 10),
ODT("odt","application/vnd.oasis.opendocument.text","odt","TEI", "TEI P5 XML Document", "text", "OpenOffice Text (.odt)", "text", true, 8),
RDF("rdf","application/rdf+xml","rdf","TEI", "TEI P5 XML Document", "text", "RDF XML", "text", true, 5),
RELAXNG("relaxng","application/xml-relaxng","relaxng","ODDC", "Compiled TEI ODD", "text", "RELAX NG schema", "text", true, 10),
RELAXNG("relaxng","application/xml-relaxng","rng","ODDC", "Compiled TEI ODD", "text", "RELAX NG schema", "text", true, 10),
RNC("rnc","application/relaxng-compact","rnc","ODDC", "Compiled TEI ODD", "text", "RELAX NG compact schema", "text", false, 10),
TEXT("txt","text/plain", "txt","TEI", "TEI P5 XML Document", "text", "Plain text", "text", true, 15),
XHTML("xhtml","application/xhtml+xml","html","TEI", "TEI P5 XML Document", "text", "xHTML", "text", true, 9),
Expand Down
13 changes: 11 additions & 2 deletions src/main/java/pl/psnc/dl/ege/tei/TEIConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,17 @@ else if (Format.RELAXNG.getMimeType().equals(toMimeType)) {
profile = EGEConstants.DEFAULT_PROFILE;
}
properties.put("extension", "rng");
performXsltTransformation(inputStream, outputStream, Format.RELAXNG
.getProfile(), profile,"to", properties);
//if new renamed rng to stylesheet folder is not found use the old folder relaxng, see https://github.com/TEIC/tei-converter/issues/5
if (!new File(
ConverterConfiguration.STYLESHEETS_PATH + File.separator + "profiles"
+ File.separator + profile + File.separator + Format.RELAXNG
.getProfile()
+ File.separator + "to" + ".xsl").exists()){
performXsltTransformation(inputStream, outputStream, "relaxng", profile, "to", properties);
} else {
performXsltTransformation(inputStream, outputStream, Format.RELAXNG
.getProfile(), profile, "to", properties);
}
}
// TEI to RNC
else if (Format.RNC.getMimeType().equals(toMimeType)
Expand Down

0 comments on commit dbbb801

Please sign in to comment.