XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
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] What does it mean to lexically distinguish significantand insignificant whitespace?



On Wed, Sep 13, 2017 at 7:45 AM, Michael Kay <mike@saxonica.com> wrote:

What I meant by the phrase is that when you see

<a>
  <b/>
</a>

there is nothing within the document itself to tell you whether the whitespace is significant; you typically need external information (e.g. a schema or DTD, or just outside knowledge) to know.

Well, if xml:space="preserve" is present you know it's significant, and if both non-whitespace children and element children are present, the betting is that it's significant.  Otherwise, you're right, you don't know.

My utility DTDcrunch reduces an external DTD subset to just enough declarations, suitable for use as an internal subset, to provide the infoset effects of the DTD (as opposed to validation information).  Specifically:

1) An internal general entity declaration is preserved.

2) A non-CTEXT attribute declaration is preserved.

3) A CTEXT attribute declaration with a default or fixed value is preserved.

4) An element declaration with element-only content is preserved in the reduced form <!ELEMENT foo (foo)>.

The resulting document has the same infoset as the original when parsed with a non-validating parser.

-- 
John Cowan          http://vrici.lojban.org/~cowan        cowan@ccil.org
Man has no body distinct from his soul, for that called body is a portion
of the soul discerned by the five senses, the chief inlets of the soul
in this age.  --William Blake



[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