sboag 00/12/27 14:21:10
Modified: java/src/org/apache/xalan/stree SourceTreeHandler.java
Log:
When setSystemID is called, create a StreamSource, and assign to
m_inputSource.
In unparsedEntityDecl, check to make sure m_inputSource
isn't null before trying to resolve to absolute URL.
Revision Changes Path
1.26 +10 -4
xml-xalan/java/src/org/apache/xalan/stree/SourceTreeHandler.java
Index: SourceTreeHandler.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/stree/SourceTreeHandler.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- SourceTreeHandler.java 2000/12/21 04:21:21 1.25
+++ SourceTreeHandler.java 2000/12/27 22:21:10 1.26
@@ -197,7 +197,7 @@
}
/** Source Document */
- Source m_inputSource;
+ private Source m_inputSource;
/**
* Set the Source document
@@ -302,6 +302,7 @@
public void startDocument() throws org.xml.sax.SAXException
{
// System.out.println("startDocument: "+m_id);
+
synchronized (m_root)
{
m_root.setSourceTreeHandler(this);
@@ -370,6 +371,7 @@
}
catch(TransformerException te)
{
+ // te.printStackTrace();
throw new org.xml.sax.SAXException(te);
}
}
@@ -432,7 +434,7 @@
String ns, String localName, String name, Attributes atts)
throws org.xml.sax.SAXException
{
-
+ // System.out.println("startElement: "+ns+", "+localName);
synchronized (m_root)
{
m_shouldStripWhitespaceStack.push(m_shouldStripWS);
@@ -454,6 +456,7 @@
public void endElement(String ns, String localName, String name)
throws org.xml.sax.SAXException
{
+ // System.out.println("endElement: "+ns+", "+localName);
synchronized (m_root)
{
@@ -874,8 +877,10 @@
XPathContext xctxt = m_transformer.getXPathContext();
SourceTreeManager stm = xctxt.getSourceTreeManager();
+
+ m_inputSource = new StreamSource(baseID);
- stm.putDocumentInCache(m_root, new StreamSource(baseID));
+ stm.putDocumentInCache(m_root, m_inputSource);
}
/**
@@ -1056,7 +1061,8 @@
{
try
{
- systemId =
org.apache.xml.utils.SystemIDResolver.getAbsoluteURI(systemId,
m_inputSource.getSystemId());
+ if(null != m_inputSource)
+ systemId =
org.apache.xml.utils.SystemIDResolver.getAbsoluteURI(systemId,
m_inputSource.getSystemId());
}
catch(Exception e)
{