ilene 2003/06/30 08:34:51
Modified: java/src/org/apache/xalan/xsltc/trax TransformerImpl.java
java/src/org/apache/xalan/xsltc DOMCache.java
java/src/org/apache/xalan/xsltc/dom DocumentCache.java
Log:
Update the DocumentCache class to be compatible with the DOMCache
interface. Although, with the native interface no longer supported, users
should not be using the DocumentCache. Instead they should set a
URIResolver on the Transformer in order to resolve arguments
passed to the document function.
Revision Changes Path
1.70 +2 -2
xml-xalan/java/src/org/apache/xalan/xsltc/trax/TransformerImpl.java
Index: TransformerImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/trax/TransformerImpl.java,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -r1.69 -r1.70
--- TransformerImpl.java 24 Jun 2003 15:46:14 -0000 1.69
+++ TransformerImpl.java 30 Jun 2003 15:34:50 -0000 1.70
@@ -1157,7 +1157,7 @@
* DOMCache interface. This approach is simple, but removes the
* possibility of using external document caches with XSLTC.
*
- * @param baseURI The URI for the stylesheet
+ * @param baseURI The base URI used by the document call.
* @param href The href argument passed to the document function.
* @param translet A reference to the translet requesting the document
*/
1.7 +5 -1 xml-xalan/java/src/org/apache/xalan/xsltc/DOMCache.java
Index: DOMCache.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/DOMCache.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- DOMCache.java 17 Jun 2003 18:35:42 -0000 1.6
+++ DOMCache.java 30 Jun 2003 15:34:51 -0000 1.7
@@ -84,6 +84,10 @@
* (3) setting the document URI:
*
* _dom.setDocumentURI(uri);
+ *
+ * @param baseURI The base URI used by the document call.
+ * @param href The href argument passed to the document function.
+ * @param translet A reference to the translet requesting the document
*/
public DOM retrieveDocument(String baseURI, String href, Translet
translet);
1.12 +12 -1
xml-xalan/java/src/org/apache/xalan/xsltc/dom/DocumentCache.java
Index: DocumentCache.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/DocumentCache.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- DocumentCache.java 30 Jun 2003 15:15:31 -0000 1.11
+++ DocumentCache.java 30 Jun 2003 15:34:51 -0000 1.12
@@ -73,6 +73,7 @@
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.TransformerException;
import javax.xml.transform.sax.SAXSource;
import org.apache.xalan.xsltc.DOM;
@@ -81,6 +82,7 @@
import org.apache.xalan.xsltc.runtime.AbstractTranslet;
import org.apache.xalan.xsltc.runtime.BasisLibrary;
import org.apache.xalan.xsltc.runtime.Constants;
+import org.apache.xml.utils.SystemIDResolver;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
@@ -284,9 +286,18 @@
* Returns a document either by finding it in the cache or
* downloading it and putting it in the cache.
*/
- public final DOM retrieveDocument(String uri, int mask, Translet trs) {
+ public DOM retrieveDocument(String baseURI, String href, Translet trs) {
CachedDocument doc;
+ String uri = href;
+ if (baseURI != null && !baseURI.equals("")) {
+ try {
+ uri = SystemIDResolver.getAbsoluteURI(uri, baseURI);
+ } catch (TransformerException te) {
+ // ignore
+ }
+ }
+
// Try to get the document from the cache first
if ((doc = lookupDocument(uri)) == null) {
doc = new CachedDocument(uri);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]