zongaro 2002/09/12 09:06:09
Modified: java/src/org/apache/xalan/xsltc/dom Tag: XSLTC_DTM
LoadDocument.java
Log:
Code in document() should check whether DOM is SAXImpl or DOMImpl and cast
accordingly.
Revision Changes Path
No revision
No revision
1.11.10.4 +10 -4
xml-xalan/java/src/org/apache/xalan/xsltc/dom/LoadDocument.java
Index: LoadDocument.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/LoadDocument.java,v
retrieving revision 1.11.10.3
retrieving revision 1.11.10.4
diff -u -r1.11.10.3 -r1.11.10.4
--- LoadDocument.java 24 Aug 2002 11:33:23 -0000 1.11.10.3
+++ LoadDocument.java 12 Sep 2002 16:06:09 -0000 1.11.10.4
@@ -129,8 +129,15 @@
// Check if this DOM has already been added to the multiplexer
int mask = multiplexer.getDocumentMask(uri);
if (mask != -1) {
- DOM newDom =
((DOMAdapter)multiplexer.getDOMAdapter(uri)).getDOMImpl();
- return new
SingletonIterator(((SAXImpl)newDom).getDocument()/*DTMDefaultBase.ROOTNODE |
mask*/, true);
+ DOM newDom = ((DOMAdapter)multiplexer.getDOMAdapter(uri))
+ .getDOMImpl();
+ if (newDom instanceof SAXImpl) {
+ return new SingletonIterator(((SAXImpl)newDom).getDocument(),
+ true);
+ } else {
+ return new SingletonIterator(((DOMImpl)newDom).getDocument(),
+ true);
+ }
}
// Check if we can get the DOM from a DOMCache
@@ -146,8 +153,7 @@
throw new TransletException(e);
}
}
- else
- {
+ else {
// Parse the input document and construct DOM object
// Create a SAX parser and get the XMLReader object it uses
final SAXParserFactory factory = SAXParserFactory.newInstance();
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]