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 "Peter A. Volchek" <Pe...@ti.com.od.ua> on 2001/06/18 13:34:09 UTC

internalSubset: continue (to Xerces team)

In my previous message I reported an error when extra whitespaces appear in
the docType internal subset.
The problem is in DTD\DTDScanner.cpp
Method: void DTDScanner::scanAttListDecl()

I've slightly modified this function (see attachments) to get rid of this
bug.

The following problem(?) I've discovered in this area, Is not equal
appearance of attribute decalrations
as they appear in internal subset from how they were declared. For example:

Input File:

<!DOCTYPE A [
    <!ELEMENT A ANY>
    <!ATTLIST A
        name1 CDATA #IMPLIED
        name2 CDATA #IMPLIED
    >
]>
<A/>

Output File
<!DOCTYPE A [
    <!ELEMENT A ANY>
    <!ATTLIST A name1 CDATA #IMPLIED>
        <!ATTLIST A name2 CDATA #IMPLIED>

]>
<A/>


Actually it is not a problem to write each element's attribute as a separate
ATTLIST declaration,
but most of the users will agree with me, that it would be better to keep
the original layout.
If you decided to keep separate attlist declarations, then you need to
revise your code that deals with whitespaces (skipping, docType notifying,
and so on)

>From my point of view, you'd better ignore all whitespaces and format on
your own.
(Not a bad idea to provide the options, like

DTD_FORMAT                    // Ignores all whitespaces and make own
formatting
DTD_KEEP_LAYOUT          // Keep DTD as in the input source
DTD_NO_WHITESPACES   // Do not add to inertrnal subset any whitespaces.
(Very usefull feature)
)


Peter A. Volchek
Software Engineer
Metis International, Inc.
PeterV@ti.com.od.ua