OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] SGML default attributes.

On Fri, Apr 29, 2016 at 8:54 AM, Norman Gray <norman@astro.gla.ac.uk> wrote:

In the XML world, the DTD is just for validation

That turns out not to be the case.  There are a number of XML DTD features which affect the infoset returned by a compliant parser.  If they are in the internal subset, the parser MUST respect them; if they are in the external subset, then any parser that reads the external subset likewise MUST respect them.

Long ago I wrote a Java program called dtdcrunch <http://home.ccil.org/~cowan/dtdcrunch.zip> that takes an arbitrary DTD external subset and reduces it to just what is meaningful to non-validating parsers.  In particular, default attribute values are preserved, as is any attribute declaration for a type other than CDATA.  Entity declarations are also kept, and simplified element declarations of the form <!ELEMENT foo (foo)> are created for all elements whose content model consists only of child elements, and in which whitespace is ignorable.

John Cowan          http://www.ccil.org/~cowan        cowan@ccil.org
Business before pleasure, if not too bloomering long before.
        --Nicholas van Rijn

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS