sboag 00/11/08 16:00:44
Modified: java/src/org/apache/xalan/processor ProcessorInclude.java
StylesheetHandler.java
java/src/org/apache/xalan/res XSLTInfo.properties
java/src/org/apache/xalan/transformer TransformerImpl.java
java/src/org/apache/xalan/utils DOMBuilder.java
Log:
Fixed problem where exception thrown from getFeature was not being
caught, which kept Crimson from working. Also, in DOMBuilder, don't
call setAttributeNS for an xmlns: attribute because Crimson doesn't
like it. Things should work OK with Crimson now, at least with the
TrAX examples smoke test.
Revision Changes Path
1.9 +9 -2
xml-xalan/java/src/org/apache/xalan/processor/ProcessorInclude.java
Index: ProcessorInclude.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/processor/ProcessorInclude.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ProcessorInclude.java 2000/11/03 23:28:02 1.8
+++ ProcessorInclude.java 2000/11/09 00:00:26 1.9
@@ -243,8 +243,15 @@
reader.setEntityResolver(entityResolver);
reader.setContentHandler(handler);
-
reader.setFeature("http://apache.org/xml/features/validation/dynamic",
- true);
+ try
+ {
+
reader.setFeature("http://apache.org/xml/features/validation/dynamic",
+ true);
+ }
+ catch(org.xml.sax.SAXNotRecognizedException snre)
+ {
+ // We don't care.
+ }
handler.pushBaseIndentifier(inputSource.getSystemId());
try
1.18 +6 -3
xml-xalan/java/src/org/apache/xalan/processor/StylesheetHandler.java
Index: StylesheetHandler.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/processor/StylesheetHandler.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- StylesheetHandler.java 2000/11/08 20:21:16 1.17
+++ StylesheetHandler.java 2000/11/09 00:00:27 1.18
@@ -479,7 +479,8 @@
getStylesheetRoot().recompose();
// Resolve the result prefix tables in the elements.
- getLastPoppedStylesheet().resolvePrefixTables();
+ if(null != getLastPoppedStylesheet())
+ getLastPoppedStylesheet().resolvePrefixTables();
}
else
throw new SAXException("Did not find the stylesheet root!");
@@ -1072,9 +1073,11 @@
// The stylesheetLocatorStack needs to be popped because
// a locator was pushed in for this stylesheet by the SAXparser by
calling
// setDocumentLocator().
- m_stylesheetLocatorStack.pop();
+ if(!m_stylesheetLocatorStack.isEmpty())
+ m_stylesheetLocatorStack.pop();
- m_lastPoppedStylesheet = (Stylesheet) m_stylesheets.pop();
+ if(!m_stylesheets.isEmpty())
+ m_lastPoppedStylesheet = (Stylesheet) m_stylesheets.pop();
return m_lastPoppedStylesheet;
}
1.5 +1 -0
xml-xalan/java/src/org/apache/xalan/res/XSLTInfo.properties
Index: XSLTInfo.properties
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/res/XSLTInfo.properties,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XSLTInfo.properties 2000/10/09 23:25:15 1.4
+++ XSLTInfo.properties 2000/11/09 00:00:32 1.5
@@ -11,3 +11,4 @@
# but simply reads the system properties, Xalan tries to load
# this value into the system properties.
org.xml.sax.driver=org.apache.xerces.parsers.SAXParser
+# org.xml.sax.driver=org.apache.crimson.parser.XMLReaderImpl
\ No newline at end of file
1.45 +1 -3
xml-xalan/java/src/org/apache/xalan/transformer/TransformerImpl.java
Index: TransformerImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/TransformerImpl.java,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- TransformerImpl.java 2000/11/08 20:23:26 1.44
+++ TransformerImpl.java 2000/11/09 00:00:38 1.45
@@ -486,9 +486,7 @@
}
catch (SAXException se)
{
-
- // What can we do?
- // TODO: User diagnostics.
+ // We don't care.
}
// Get the input content handler, which will handle the
1.10 +2 -1 xml-xalan/java/src/org/apache/xalan/utils/DOMBuilder.java
Index: DOMBuilder.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/utils/DOMBuilder.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- DOMBuilder.java 2000/11/06 17:52:59 1.9
+++ DOMBuilder.java 2000/11/09 00:00:41 1.10
@@ -341,7 +341,8 @@
// System.out.println("attrNS: "+attrNS+", localName:
"+atts.getQName(i)
// +", qname: "+atts.getQName(i)+", value:
"+atts.getValue(i));
- if ((null == attrNS) || (attrNS.length() == 0))
+ // Crimson won't let us set an xmlns: attribute on the DOM.
+ if ((null == attrNS) || (attrNS.length() == 0) ||
atts.getQName(i).startsWith("xmlns:"))
elem.setAttribute(atts.getQName(i), atts.getValue(i));
else
{