You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by pe...@ca.ibm.com on 2001/03/26 22:18:05 UTC

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: peiyongz@ca.ibm.com
Phone: (416)448-4088; Fax: (416)448-4414; T/L: 778-4088



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: Bug report and fix

Posted by Tinny Ng <tn...@ca.ibm.com>.
Fix is in nightly build.

Tinny

peiyongz@ca.ibm.com wrote:

> 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: peiyongz@ca.ibm.com
> Phone: (416)448-4088; Fax: (416)448-4414; T/L: 778-4088
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org