zongaro 2003/02/03 12:48:14
Modified: java/src/org/apache/xpath SourceTreeManager.java
java/src/org/apache/xml/dtm/ref DTMManagerDefault.java
java/src/org/apache/xalan/xslt Process.java
java/src/org/apache/xalan/transformer TrAXFilter.java
TransformerIdentityImpl.java
java/src/org/apache/xalan/processor ProcessorInclude.java
TransformerFactoryImpl.java
Log:
The behaviour of the Xerces-J parser recently changed to agree with its
documented behaviour with respect to the dynamic validation feature. This
causes problems for stylesheets that contain a DTD, but are not otherwise
"valid" - for instance, because the DTD contains ENTITY declarations, but no
ELEMENT declarations - because error reporting is performed for documents if
the dynamic validation feature is enabled and the document contains a DOCTYPE
declaration.
The solution is to remove code (including code that was commented out) that
enabled the Xerces dynamic validation feature.
Revision Changes Path
1.33 +0 -7
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.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- SourceTreeManager.java 30 Jan 2003 18:46:22 -0000 1.32
+++ SourceTreeManager.java 3 Feb 2003 20:48:12 -0000 1.33
@@ -385,8 +385,6 @@
XMLReader reader = (inputSource instanceof SAXSource)
? ((SAXSource) inputSource).getXMLReader() : null;
- boolean isUserReader = (reader != null);
-
if (null == reader)
{
try {
@@ -412,11 +410,6 @@
{
reader.setFeature("http://xml.org/sax/features/namespace-prefixes",
true);
- // Commented out as per discussion with [EMAIL PROTECTED]
- // about bug 2124.
-// if(!isUserReader)
-//
reader.setFeature("http://apache.org/xml/features/validation/dynamic",
-// true);
}
catch (org.xml.sax.SAXException se)
{
1.45 +0 -19
xml-xalan/java/src/org/apache/xml/dtm/ref/DTMManagerDefault.java
Index: DTMManagerDefault.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xml/dtm/ref/DTMManagerDefault.java,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- DTMManagerDefault.java 30 Jan 2003 18:46:17 -0000 1.44
+++ DTMManagerDefault.java 3 Feb 2003 20:48:12 -0000 1.45
@@ -632,8 +632,6 @@
XMLReader reader = (inputSource instanceof SAXSource)
? ((SAXSource) inputSource).getXMLReader() : null;
- boolean isUserReader = (reader != null);
-
if (null == reader)
{
try
@@ -673,23 +671,6 @@
// What can we do?
// TODO: User diagnostics.
}
-
- // Commented out as per discussion with [EMAIL PROTECTED]
- // about bug 2124.
-// if(!isUserReader)
-// {
-// try
-// {
-//
reader.setFeature("http://apache.org/xml/features/validation/dynamic",
-// true);
-// }
-// catch (org.xml.sax.SAXException se)
-// {
-//
-// // What can we do?
-// // TODO: User diagnostics.
-// }
-// }
return reader;
}
1.54 +0 -6 xml-xalan/java/src/org/apache/xalan/xslt/Process.java
Index: Process.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xslt/Process.java,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- Process.java 30 Jan 2003 18:45:58 -0000 1.53
+++ Process.java 3 Feb 2003 20:48:12 -0000 1.54
@@ -956,12 +956,6 @@
true);
} catch (org.xml.sax.SAXException se) {}
- try
- {
-
reader.setFeature("http://apache.org/xml/features/validation/dynamic",
- true);
- } catch (org.xml.sax.SAXException se) {}
-
th.setResult(strResult);
reader.parse(new InputSource(inFileName));
1.12 +0 -4
xml-xalan/java/src/org/apache/xalan/transformer/TrAXFilter.java
Index: TrAXFilter.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/TrAXFilter.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- TrAXFilter.java 30 Jan 2003 18:45:55 -0000 1.11
+++ TrAXFilter.java 3 Feb 2003 20:48:13 -0000 1.12
@@ -165,10 +165,6 @@
{
parent.setFeature("http://xml.org/sax/features/namespace-prefixes",
true);
- // Commented out as per discussion with [EMAIL PROTECTED]
- // about bug 2124.
-//
parent.setFeature("http://apache.org/xml/features/validation/dynamic",
-// true);
}
catch (org.xml.sax.SAXException se){}
// setParent calls setupParse...
1.23 +0 -7
xml-xalan/java/src/org/apache/xalan/transformer/TransformerIdentityImpl.java
Index: TransformerIdentityImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/TransformerIdentityImpl.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- TransformerIdentityImpl.java 30 Jan 2003 18:45:56 -0000 1.22
+++ TransformerIdentityImpl.java 3 Feb 2003 20:48:13 -0000 1.23
@@ -383,8 +383,6 @@
if (source instanceof SAXSource)
reader = ((SAXSource) source).getXMLReader();
- boolean isUserReader = (reader != null);
-
if (null == reader)
{
@@ -421,11 +419,6 @@
{
reader.setFeature("http://xml.org/sax/features/namespace-prefixes",
true);
- // Commented out as per discussion with [EMAIL PROTECTED]
- // about bug 2124.
-// if(!isUserReader)
-//
reader.setFeature("http://apache.org/xml/features/validation/dynamic",
-// true);
}
catch (org.xml.sax.SAXException se)
{
1.26 +0 -10
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.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- ProcessorInclude.java 30 Jan 2003 18:45:44 -0000 1.25
+++ ProcessorInclude.java 3 Feb 2003 20:48:13 -0000 1.26
@@ -269,8 +269,6 @@
reader = saxSource.getXMLReader(); // may be null
}
- boolean isUserReader = (reader != null);
-
InputSource inputSource = SAXSource.sourceToInputSource(source);
if (null == reader)
@@ -300,14 +298,6 @@
if (null != reader)
{
reader.setContentHandler(handler);
- try
- {
- if(!isUserReader)
-
reader.setFeature("http://apache.org/xml/features/validation/dynamic",
- true);
- }
- catch(org.xml.sax.SAXException se) {}
-
handler.pushBaseIndentifier(inputSource.getSystemId());
try
1.49 +0 -14
xml-xalan/java/src/org/apache/xalan/processor/TransformerFactoryImpl.java
Index: TransformerFactoryImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/processor/TransformerFactoryImpl.java,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- TransformerFactoryImpl.java 30 Jan 2003 18:45:45 -0000 1.48
+++ TransformerFactoryImpl.java 3 Feb 2003 20:48:14 -0000 1.49
@@ -905,8 +905,6 @@
if (source instanceof SAXSource)
reader = ((SAXSource) source).getXMLReader();
- boolean isUserReader = (reader != null);
-
if (null == reader)
{
@@ -940,18 +938,6 @@
// If you set the namespaces to true, we'll end up getting double
// xmlns attributes. Needs to be fixed. -sb
// reader.setFeature("http://xml.org/sax/features/namespace-prefixes",
true);
- try
- {
- if(!isUserReader)
-
reader.setFeature("http://apache.org/xml/features/validation/dynamic",
- true);
- }
- catch (org.xml.sax.SAXException ex)
- {
-
- // feature not recognized
- }
-
reader.setContentHandler(builder);
reader.parse(isource);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]