morten 01/10/19 01:58:38
Modified: java/src/org/apache/xalan/xsltc/dom LoadDocument.java
MultiDOM.java
Log:
A fix for determining the current working directory when loading XML
documents using the document() function. The base URI (that gives you
the CWD) should normally be taken from the context node, but can also
be determined by the node/node-set defining the document URI.
PR: bugzilla 3471
Obtained from: n/a
Submitted by: [EMAIL PROTECTED]
Reviewed by: [EMAIL PROTECTED]
Revision Changes Path
1.8 +7 -1
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.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- LoadDocument.java 2001/10/12 19:01:24 1.7
+++ LoadDocument.java 2001/10/19 08:58:37 1.8
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: LoadDocument.java,v 1.7 2001/10/12 19:01:24 tmiller Exp $
+ * @(#)$Id: LoadDocument.java,v 1.8 2001/10/19 08:58:37 morten Exp $
*
* The Apache Software License, Version 1.1
*
@@ -205,12 +205,18 @@
while ((node = iterator.next()) != DOM.NULL) {
String uri = dom.getNodeValue(node);
+ if ((baseURI == null) || baseURI.equals("")) {
+ String base = dom.getDocumentURI(node);
+ final int sep = base.lastIndexOf('/') + 1;
+ baseURI = base.substring(0, sep);
+ }
union.addIterator(document(uri, baseURI, translet, dom));
}
return(union);
}
}
catch (Exception e) {
+ e.printStackTrace();
throw new TransletException(e);
}
}
1.11 +2 -2
xml-xalan/java/src/org/apache/xalan/xsltc/dom/MultiDOM.java
Index: MultiDOM.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/MultiDOM.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- MultiDOM.java 2001/10/18 16:53:09 1.10
+++ MultiDOM.java 2001/10/19 08:58:37 1.11
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: MultiDOM.java,v 1.10 2001/10/18 16:53:09 morten Exp $
+ * @(#)$Id: MultiDOM.java,v 1.11 2001/10/19 08:58:37 morten Exp $
*
* The Apache Software License, Version 1.1
*
@@ -430,6 +430,6 @@
}
public String getDocumentURI(int node) {
- return _adapters[node>>24].getDocumentURI(0);
+ return _adapters[node>>>24].getDocumentURI(0);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]