From 46c7fca1c1ec762154c077d66a32a2e10d17c560 Mon Sep 17 00:00:00 2001 From: Norman Walsh Date: Sun, 15 Jul 2001 20:07:49 +0000 Subject: [PATCH] New Xalan code sometimes (always?) returns DOCUMENT_NODE where DOCUMENT_FRAGMENT_NODE used to be returned: handle it --- xsl/extensions/xalan2/com/nwalsh/xalan/Verbatim.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/xsl/extensions/xalan2/com/nwalsh/xalan/Verbatim.java b/xsl/extensions/xalan2/com/nwalsh/xalan/Verbatim.java index a5986a11f..43425d5ba 100644 --- a/xsl/extensions/xalan2/com/nwalsh/xalan/Verbatim.java +++ b/xsl/extensions/xalan2/com/nwalsh/xalan/Verbatim.java @@ -206,6 +206,7 @@ public class Verbatim { int numLines = 0; if (node.getNodeType() == Node.DOCUMENT_FRAGMENT_NODE + || node.getNodeType() == Node.DOCUMENT_NODE || node.getNodeType() == Node.ELEMENT_NODE) { Node child = node.getFirstChild(); while (child != null) { @@ -248,7 +249,8 @@ public class Verbatim { private void lineNumberFragment(DOMBuilder rtf, Node node) { try { - if (node.getNodeType() == Node.DOCUMENT_FRAGMENT_NODE) { + if (node.getNodeType() == Node.DOCUMENT_FRAGMENT_NODE + || node.getNodeType() == Node.DOCUMENT_NODE) { Node child = node.getFirstChild(); while (child != null) { lineNumberFragment(rtf, child); @@ -442,7 +444,6 @@ public class Verbatim { public DocumentFragment insertCallouts (ExpressionContext context, NodeIterator areaspecNodeSet, NodeIterator xalanNI) { - String type = Params.getString(context, "stylesheet.result.type"); boolean useFO = type.equals("fo"); int defaultColumn = Params.getInt(context, "callout.defaultcolumn"); @@ -602,7 +603,8 @@ public class Verbatim { Node node, FormatCallout fCallout) { try { - if (node.getNodeType() == Node.DOCUMENT_FRAGMENT_NODE) { + if (node.getNodeType() == Node.DOCUMENT_FRAGMENT_NODE + || node.getNodeType() == Node.DOCUMENT_NODE) { Node child = node.getFirstChild(); while (child != null) { calloutFragment(rtf, child, fCallout); -- 2.40.0