xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roytman, Alex" <roytm...@peacetech.com>
Subject Xerces 1.1 overlooks DTD/XML inconsistency. While v 1.0.3 finds t he bug
Date Tue, 30 May 2000 16:32:25 GMT
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);

Mime
View raw message