> Unfortunately, dynamic validation does work :) and causes problems for
> existing XML documents that worked in previous versions of Xalan.
Dynamic
> validation blindly enables validation whenever it encounters a "DOCTYPE"
> declaration.
The problem with commenting out dynamic validation is it will make the id
(...) functions fail... I talked to the Xerces folk, and, while they do
process entity refs and default attributes, they do not process ID
declarations if validation is not run (I think this is the wrong behavior,
but that's something we need to discuss with the Xerces folk, as they may
well have good reasons for this). With your patch, many of our conformance
tests failed that used the id(...) function.
I am unsure of where to go with this. I am inclined to reject the patch,
on the basis of the id(...) function working being more important. On the
other hand, I understand your problem. Note that processing still occurs
(at least on the command line), even though validation errors are reported.
I would like to get your opinion, given this additional information, in
addition to anyone else's opinion, before making a decision on this patch
for our next release. Perhaps the Xerces folks have something to add?
On solution might be to add a third option that allows dynamic validation
to be controlled (with validation on by default). This isn't really a
solution, but at least it would provide a work-around. This is more work
than I can do for this release, but we would be willing to incorporate a
patch that does this if someone does it fast.
-scott
----- Forwarded by Scott Boag/CAM/Lotus on 07/20/2000 12:51 PM -----
Scott Boag
To: [email protected]
07/17/2000 cc:
07:33 PM Subject: Re: Resubmitting: [PATCH]
remove dynamic validation from
DTMLiaison.j ava(Document link: Scott
Boag)
Sorry for the delay. We have about 8 patches backlogged which we are
working on incorporating this week. Myriam may have already incorporated
this particular patch today, I'm not sure. We also need to run our full
regression suite on the patched code.
Our intention is to create our first patch-only release for Xalan 1.1,
probably sometime next week. If other's have patches, now's the time to
submit them!
BTW, this whole dynamic validation thing is tremendously frustrating to me.
The way it works seems to keep changing in Xerces. I agree with you about
the dynamic validation being turned off by default, except I would expect
that entity decls and default attributes would still be processed in this
case... not sure about lately, but at least at the time I wrote that code,
that wasn't the case (maybe a bug?). The bottom line is, the processor
should be able to process the document correctly without having to know
anything about the document (including entities and default attributes
declared in the external doctype). If, in the case you gave, with dynamic
validation turned off, the mdash entity does not get resolved, I would
argue that dynamic validation should be on by default (I agree with you
that there should be an API method to control it).
-scott
[EMAIL PROTECTED]
annica.com To: [email protected]
cc: (bcc: Scott Boag/CAM/Lotus)
07/17/2000 05:49 Subject: Resubmitting: [PATCH]
remove dynamic validation from
PM DTMLiaison.j ava
Please respond
to xalan-dev
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 13, 2000 9:22 AM
To: [email protected]
Subject: [PATCH] remove dynamic validation from DTMLiaison.java
Hi all,
Could a Committer please review and commit this patch? Thanks.
Index: DTMLiaison.java
===================================================================
RCS file:
/home/cvspublic/xml-xalan/src/org/apache/xalan/xpath/dtm/DTMLiaison.java,v
retrieving revision 1.16
diff -u -r1.16 DTMLiaison.java
--- DTMLiaison.java 2000/05/26 05:50:21 1.16
+++ DTMLiaison.java 2000/07/13 14:17:33
@@ -225,11 +225,10 @@
if(getUseValidation())
parser.setFeature("http://xml.org/sax/features/validation",
true);
- else
- {
- // This doesn't seem to work, but I'm a setting it anyhow.
-
parser.setFeature("http://apache.org/xml/features/validation/dynamic",
true);
- }
+
+ // "http://xml.org/sax/features/validation/dynamic" is and should
be false
+ // by default. It incorrectly decides to validate documents that
declare
+ // internal entities.
if(m_doThreading)
{
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 11, 2000 6:12 PM
To: [email protected]
Subject: Bug in DTMLiaison.java concerning "dynamic validation"
Hi all,
There is a significant bug in DTMLiaison, version 1.16. Scott B. created
the following block of code:
if(getUseValidation())
parser.setFeature("http://xml.org/sax/features/validation", true);
else
{
// This doesn't seem to work, but I'm a setting it anyhow.
parser.setFeature("http://apache.org/xml/features/validation/dynamic",
true);
}
Unfortunately, dynamic validation does work :) and causes problems for
existing XML documents that worked in previous versions of Xalan. Dynamic
validation blindly enables validation whenever it encounters a "DOCTYPE"
declaration. This is not proper default behavior, because some XML
documents perform nonvalidating resolution of special characters in the
DOCTYPE declaration. For example, the current version of Xalan attempts to
validate this legal nonvalidating XML document:
<?xml version="1.0" ?>
<!DOCTYPE article [
<!ENTITY mdash "—">
]>
<article>
this is my mdash —
</article>
To make a long story short, dynamic validation should be disabled. The
above code block should be replaced with this:
if(getUseValidation())
parser.setFeature("http://xml.org/sax/features/validation", true);
You may want to include a method in the XMLParserLiaison that allows a user
to enable it explicitly, but it should be disabled by default, as it is in
Xerces. In the current API, there is no way to turn off dynamic
validation.
That's bad.
Incidentally, I thought we were supposed to submit bugs to
http://xml.apache.org/bugs, but I've never been able to gain access. Is
the
bug database only accessible to certain people?
Thanks!
Morgan Delagrange
Britannica.com