garyp 01/06/01 11:59:23
Modified: java/src/org/apache/xpath SourceTreeManager.java
XPathContext.java
Log:
Resolved bugzilla bug 1830
(http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1830).
The EntityResolver in the primary XMLReader was not being propagated to the
XMLReader created to handle the document() function.
The routine to construct the new XMLReader now obtains the primaryReader and
uses its EntityResolver if available.
Revision Changes Path
1.25 +27 -0
xml-xalan/java/src/org/apache/xpath/SourceTreeManager.java
Index: SourceTreeManager.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xpath/SourceTreeManager.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- SourceTreeManager.java 2001/02/08 04:10:15 1.24
+++ SourceTreeManager.java 2001/06/01 18:59:20 1.25
@@ -98,6 +98,20 @@
public class SourceTreeManager
{
+ /** XPathContext that created this SourceTreeManager. */
+
+ private XPathContext m_xctxt;
+
+ /**
+ * Construct the instance and save a reference to the creating XPathContext
+ *
+ */
+
+ public SourceTreeManager(XPathContext xctxt) {
+ super();
+ m_xctxt = xctxt;
+ }
+
/** Vector of SourceTree objects that this manager manages. */
private Vector m_sourceTree = new Vector();
@@ -483,6 +497,19 @@
// What can we do?
// TODO: User diagnostics.
+ }
+
+ if (reader == null)
+ return null;
+
+ XMLReader primaryReader = m_xctxt.getPrimaryReader();
+ if (primaryReader != null)
+ {
+ EntityResolver primaryResolver = primaryReader.getEntityResolver();
+ if (primaryResolver != null)
+ {
+ reader.setEntityResolver(primaryResolver);
+ }
}
return reader;
1.21 +1 -1 xml-xalan/java/src/org/apache/xpath/XPathContext.java
Index: XPathContext.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/XPathContext.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- XPathContext.java 2001/03/28 04:41:07 1.20
+++ XPathContext.java 2001/06/01 18:59:21 1.21
@@ -290,7 +290,7 @@
/** The source tree manager, which associates Source objects to source
* tree nodes. */
- private SourceTreeManager m_sourceTreeManager = new SourceTreeManager();
+ private SourceTreeManager m_sourceTreeManager = new
SourceTreeManager(this);
/**
* Get the SourceTreeManager associated with this execution context.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]