Yes, this is well known. We never fully implemented the standalone checks,
because they are very high overhead relative to the number of people who
seem to need to use them (basically almost no one so far, since I can't
remember anyone complaining about it.) And I assume that you are just
reporting a test case failure and not that you need to use that
functionality?
Anyway, its probably very low priority relative to Schema work and such, and
some of the standalone checks would be non-trivial to do, so they would
require a good bit of work I think. For instance, the one you mention would
require, at the core parse level where everyone pays for it, a good bit of
information to be checked as all the data flows by. Since this is validation
stuff, it would desirable to have this code in the validator, but that would
require that the validator see all the XML data going by, which isn't very
desirable from a performance standpoint. And it has to be done as it
happens, you can't go back after the fact because there is no after the fact
for streaming interfaces. At best, there would have to be more APIs to the
validator, which the scanner would optionally call if the document was
indicated as being standalone. The validator would return say 'true' if the
data it just saw would validate standalone.
Anyway, its non-trivial to do and low bang for the buck.
--------------
Dean Roddey
Software Geek Extraordinaire
Portal, Inc
[EMAIL PROTECTED]
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 26, 2001 12:18 PM
To: [EMAIL PROTECTED]
Subject: Bug report and fix
Hi, there,
The current XML4C ACCEPTS the test case (shown below) and therefore FAILS
on validity constraint: Standalone document declaration.
Validity constraint: Standalone Document Declaration
The standalone document declaration must have the value "no"
if any external markup declarations contain declarations of:
attributes with default values, if elements to which
these attributes apply appear in the document without specifications of
values for these
attributes, or
Test case:
case1.xml
<?xml version="1.0" standalone="yes" ?>
<!DOCTYPE animal SYSTEM "case1.dtd" [
<!ELEMENT animal EMPTY>
]>
<animal/>
case1.dtd (version a)
<!ATTLIST animal color CDATA #FIXED "yellow">
case1.dtd(version b)
<!ATTLIST animal color CDATA "yellow">
A fix is made to both XMLScanner.cpp and XMLScanner2.cpp.
Index: XMLScanner.cpp
===================================================================
RCS file: /home/cvspublic/xml-xerces/c/src/internal/XMLScanner.cpp,v
retrieving revision 1.29
diff -w -r1.29 XMLScanner.cpp
2521c2521,2522
< else if (defType == XMLAttDef::Default)
---
> else if ((defType == XMLAttDef::Default) ||
> (defType == XMLAttDef::Fixed) )
Index: XMLScanner2.cpp
===================================================================
RCS file: /home/cvspublic/xml-xerces/c/src/internal/XMLScanner2.cpp,v
retrieving revision 1.21
diff -w -r1.21 XMLScanner2.cpp
418a419,431
> else if ((defType == XMLAttDef::Default) ||
> (defType == XMLAttDef::Fixed) )
> {
> if (fStandalone)
> {
> //
> // XML 1.0 Section 2.9
> // Document is standalone, so attributes
must not be defaulted.
> //
> emitError(XMLErrs::BadStandalone,
elemDecl.getFullName());
>
> }
> }
Regards,
Peiyong Zhang
____________________________________________
XML Parsers Development
IBM Toronto Laboratory email: [EMAIL PROTECTED]
Phone: (416)448-4088; Fax: (416)448-4414; T/L: 778-4088
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]