You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xml.apache.org by "Roytman, Alex" <ro...@peacetech.com> on 2000/05/30 18:32:25 UTC

Xerces 1.1 overlooks DTD/XML inconsistency. While v 1.0.3 finds t he bug

this is a snippet from my DTD with couple of bugs in it:

<!ELEMENT dataset (tables,choose)>
<!ELEMENT ds-tables (table)+>
<!ELEMENT ds-table EMPTY>
<!ATTLIST ds-table
 name ID  #REQUIRED
>

when I renamed tables -> ds-tables and table -> ds-table I forgot to do so
in <!ELEMENT dataset (tables,choose)>

So I am using correct xml with incorrect DTD:

  <dataset>
    <ds-tables>
      <ds-table name="ds-account"/>
      <ds-table name="ds-alloc"/>
      <ds-table name="ds-adjust"/>
      <ds-table name="ds-trans"/>
    </ds-tables>
    <choose>
      <choose-total ds-tables="ds-alloc">
  ...........


XERCES 1.1 DOES NOT REPORT ANY ERRORS


while Xerces 1.0.3 does:

om.peacetech.xsum.InvalidXMLError:  Warning: The content model of element
"dataset" refers to the undeclared element "tables". (line 3, column 34)
org.xml.sax.SAXParseException: The content model of element "dataset" refers
to the undeclared element "tables". 	at
org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1225) 	at
org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1247) 	at
pti.mcps.xtotals.Test.main(Test.java:19)


I use following Parser setup:
 
parser.setFeature("http://apache.org/xml/features/dom/defer-node-expansion",
false);
 
parser.setFeature("http://apache.org/xml/features/continue-after-fatal-error
", false);
 
parser.setFeature("http://apache.org/xml/features/validation/warn-on-undecla
red-elemdef", true);
      parser.setFeature("http://xml.org/sax/features/validation", true);
      parser.setFeature("http://apache.org/xml/features/validation/dynamic",
false);
 
parser.setFeature("http://apache.org/xml/features/dom/include-ignorable-whit
espace", false);

Re: Xerces 1.1 overlooks DTD/XML inconsistency. While v 1.0.3 finds the bug

Posted by Mike Pogue <mp...@apache.org>.
Could you post this to the Xerces-J list?

Thanks!
Mike

"Roytman, Alex" wrote:
> 
> this is a snippet from my DTD with couple of bugs in it:
> 
> <!ELEMENT dataset (tables,choose)>
> <!ELEMENT ds-tables (table)+>
> <!ELEMENT ds-table EMPTY>
> <!ATTLIST ds-table
>  name ID  #REQUIRED
> >
> 
> when I renamed tables -> ds-tables and table -> ds-table I forgot to do so
> in <!ELEMENT dataset (tables,choose)>
> 
> So I am using correct xml with incorrect DTD:
> 
>   <dataset>
>     <ds-tables>
>       <ds-table name="ds-account"/>
>       <ds-table name="ds-alloc"/>
>       <ds-table name="ds-adjust"/>
>       <ds-table name="ds-trans"/>
>     </ds-tables>
>     <choose>
>       <choose-total ds-tables="ds-alloc">
>   ...........
> 
> XERCES 1.1 DOES NOT REPORT ANY ERRORS
> 
> while Xerces 1.0.3 does:
> 
> om.peacetech.xsum.InvalidXMLError:  Warning: The content model of element
> "dataset" refers to the undeclared element "tables". (line 3, column 34)
> org.xml.sax.SAXParseException: The content model of element "dataset" refers
> to the undeclared element "tables".     at
> org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1225)        at
> org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1247)        at
> pti.mcps.xtotals.Test.main(Test.java:19)
> 
> I use following Parser setup:
> 
> parser.setFeature("http://apache.org/xml/features/dom/defer-node-expansion",
> false);
> 
> parser.setFeature("http://apache.org/xml/features/continue-after-fatal-error
> ", false);
> 
> parser.setFeature("http://apache.org/xml/features/validation/warn-on-undecla
> red-elemdef", true);
>       parser.setFeature("http://xml.org/sax/features/validation", true);
>       parser.setFeature("http://apache.org/xml/features/validation/dynamic",
> false);
> 
> parser.setFeature("http://apache.org/xml/features/dom/include-ignorable-whit
> espace", false);
> 
> ---------------------------------------------------------------------
> In case of troubles, e-mail:     webmaster@xml.apache.org
> To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
> For additional commands, e-mail: general-help@xml.apache.org