diff --git a/pom.xml b/pom.xml index dcd3bd8..4189f2e 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 pl.psnc.dl.ege.tei tei-converter - 0.6.4 + 0.6.5 EGE TEI Converter @@ -145,7 +145,7 @@ com.twelvemonkeys.imageio imageio-tiff - 3.1.1 + 3.9.4 com.thaiopensource diff --git a/src/main/java/pl/psnc/dl/ege/tei/Format.java b/src/main/java/pl/psnc/dl/ege/tei/Format.java index 80bfcc8..aa55917 100644 --- a/src/main/java/pl/psnc/dl/ege/tei/Format.java +++ b/src/main/java/pl/psnc/dl/ege/tei/Format.java @@ -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), diff --git a/src/main/java/pl/psnc/dl/ege/tei/TEIConverter.java b/src/main/java/pl/psnc/dl/ege/tei/TEIConverter.java index 30c45d4..5df5eaf 100644 --- a/src/main/java/pl/psnc/dl/ege/tei/TEIConverter.java +++ b/src/main/java/pl/psnc/dl/ege/tei/TEIConverter.java @@ -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)