[Home] [By Thread] [By Date] [Recent Entries]

  • From: John Cowan <johnwcowan@g...>
  • To: Michael Kay <mike@s...>
  • Date: Fri, 15 Sep 2017 18:59:32 -0400



On Wed, Sep 13, 2017 at 7:45 AM, Michael Kay <mike@s...> 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@c...
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]


Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member