morten 01/08/07 01:58:05
Modified: java/src/org/apache/xalan/xsltc/dom LoadDocument.java
Log:
Added code behind the document() function to force the parser to be
namespace aware (Crimson is pr. default, Xerces is not).
PR: bugzilla 2862
Obtained from: n/a
Submitted by: [EMAIL PROTECTED]
Reviewed by: [EMAIL PROTECTED]
Revision Changes Path
1.5 +10 -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.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- LoadDocument.java 2001/08/03 11:55:26 1.4
+++ LoadDocument.java 2001/08/07 08:58:05 1.5
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: LoadDocument.java,v 1.4 2001/08/03 11:55:26 morten Exp $
+ * @(#)$Id: LoadDocument.java,v 1.5 2001/08/07 08:58:05 morten Exp $
*
* The Apache Software License, Version 1.1
*
@@ -81,6 +81,9 @@
public final class LoadDocument {
+ private static final String NAMESPACE_FEATURE =
+ "http://xml.org/sax/features/namespaces";
+
/**
* Returns an iterator containing a set of nodes from an XML document
* loaded by the document() function.
@@ -130,6 +133,12 @@
// Parse the input document and construct DOM object
// Create a SAX parser and get the XMLReader object it uses
final SAXParserFactory factory = SAXParserFactory.newInstance();
+ try {
+ factory.setFeature(NAMESPACE_FEATURE,true);
+ }
+ catch (Exception e) {
+ factory.setNamespaceAware(true);
+ }
final SAXParser parser = factory.newSAXParser();
final XMLReader reader = parser.getXMLReader();
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]