[FOray-commit] SF.net SVN: foray:[12764] trunk/foray
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2022-12-02 20:21:18
|
Revision: 12764
http://sourceforge.net/p/foray/code/12764
Author: victormote
Date: 2022-12-02 20:21:15 +0000 (Fri, 02 Dec 2022)
Log Message:
-----------
1. Log a warning if an orthography is not found for a given writing system. 2. Fix failing tests by adding xml:lang to root element.
Modified Paths:
--------------
trunk/foray/foray-00-master/dist/resource/test/fo/invalid-ns-001.fo
trunk/foray/foray-00-master/dist/resource/test/fo/invalid-ns-002.fo
trunk/foray/foray-app/src/test/java/org/foray/app/fo/TestInvalidXml.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoTextWords4a.java
Modified: trunk/foray/foray-00-master/dist/resource/test/fo/invalid-ns-001.fo
===================================================================
--- trunk/foray/foray-00-master/dist/resource/test/fo/invalid-ns-001.fo 2022-12-02 19:53:24 UTC (rev 12763)
+++ trunk/foray/foray-00-master/dist/resource/test/fo/invalid-ns-001.fo 2022-12-02 20:21:15 UTC (rev 12764)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xml:lang="eng-US">
<fo:layout-master-set>
<fo:simple-page-master
margin-right="1.5cm"
Modified: trunk/foray/foray-00-master/dist/resource/test/fo/invalid-ns-002.fo
===================================================================
--- trunk/foray/foray-00-master/dist/resource/test/fo/invalid-ns-002.fo 2022-12-02 19:53:24 UTC (rev 12763)
+++ trunk/foray/foray-00-master/dist/resource/test/fo/invalid-ns-002.fo 2022-12-02 20:21:15 UTC (rev 12764)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xml:lang="eng-US">
<fo:layout-master-set>
<fo:simple-page-master
margin-right="1.5cm"
Modified: trunk/foray/foray-app/src/test/java/org/foray/app/fo/TestInvalidXml.java
===================================================================
--- trunk/foray/foray-app/src/test/java/org/foray/app/fo/TestInvalidXml.java 2022-12-02 19:53:24 UTC (rev 12763)
+++ trunk/foray/foray-app/src/test/java/org/foray/app/fo/TestInvalidXml.java 2022-12-02 20:21:15 UTC (rev 12764)
@@ -31,7 +31,6 @@
import org.axsl.fotree.FoTreeException;
import org.junit.Assert;
-import org.junit.Ignore;
import org.junit.Test;
/**
@@ -84,7 +83,6 @@
/**
* Test of fo/invalid-ns-001.fo, which contains an unregistered namespace.
*/
- @Ignore
@Test
public void testNamespace001() {
final FoDocumentReader reader = FoDocumentReader.getInstance();
@@ -99,7 +97,6 @@
/**
* Test of fo/invalid-ns-002.fo, which contains an unregistered namespace inside some foreign xml.
*/
- @Ignore
@Test
public void testNamespace002() {
final FoDocumentReader reader = FoDocumentReader.getInstance();
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoTextWords4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoTextWords4a.java 2022-12-02 19:53:24 UTC (rev 12763)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoTextWords4a.java 2022-12-02 20:21:15 UTC (rev 12764)
@@ -45,6 +45,9 @@
import org.axsl.orthography.OrthographyException;
import org.axsl.orthography.Whitespace;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* Text in an FO document that has been tokenized into words.
* This is a thin wrapper around an instance of {@link FoTextTokenFlow} that allows that token flow to live in an FO
@@ -52,6 +55,9 @@
*/
public class FoTextWords4a extends FoText4a implements FoTextWords, KpBranch {
+ /** Logger for this class. */
+ private static final Logger LOGGER = LoggerFactory.getLogger(FoTextWords4a.class);
+
/** The parent of this node. */
private FoObj parent;
@@ -69,6 +75,9 @@
this.parent = parent;
final FoOrthographyServer orthographyServer = getOrthographyServer();
final FoOrthography orthography = orthographyServer.getOrthography(getWritingSystem());
+ if (orthography == null) {
+ LOGGER.warn("Orthography not found for: {}", getWritingSystem());
+ }
this.tokenFlow = orthography.tokenize(content, 0, content.length());
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|