]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Added an FAQ entry about the element mismatch error message.
authorJeremias Maerki <jeremias@apache.org>
Thu, 21 Aug 2008 08:51:50 +0000 (08:51 +0000)
committerJeremias Maerki <jeremias@apache.org>
Thu, 21 Aug 2008 08:51:50 +0000 (08:51 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@687657 13f79535-47bb-0310-9956-ffa450edef68

src/documentation/content/xdocs/faq.xml

index a75cd41e05cc77f86e5195122a2d68e3bacc77cf..26a5329cb96cddc6d95eca72ee5d0dc783efe22e 100644 (file)
         </p>
       </answer>
     </faq>
+    <faq id="saxexception-mismatch">
+      <question>I get a SAXException: Mismatch: page-sequence vs. root
+        (or similar).</question>
+      <answer>
+        <p>
+          The full exception usually looks similar to this:
+        </p>
+        <source>Mismatch: page-sequence (http://www.w3.org/1999/XSL/Format) vs. root
+        (http://www.w3.org/1999/XSL/Format)</source>
+        <p>
+          This exception is usually a follow-up error after another exception. Sometimes
+          the original exception gets swallowed by Xalan's default <code>ErrorListener</code>
+          (should be fixed in the latest Xalan release).
+        </p>
+        <p>
+          The work-around is to set an explicit <code>ErrorListener</code> on the
+          <code>Transformer</code>. The <code>ErrorListener</code> can be as simple as this:
+        </p>
+        <source><![CDATA[
+import javax.xml.transform.ErrorListener;
+import javax.xml.transform.TransformerException;
+
+public class DefaultErrorListener implements ErrorListener {
+    
+    public void warning(TransformerException exc) {
+        System.err.println(exc.toString());
+    }
+
+    public void error(TransformerException exc)
+            throws TransformerException {
+        throw exc;
+    }
+
+    public void fatalError(TransformerException exc)
+            throws TransformerException {
+        throw exc;
+    }
+
+}]]></source>
+      </answer>
+    </faq>
   </part>
   <part id="part-output">
     <title>Problems with FOP output</title>