Re: [xsl] Selecting First Direct Sibling

Subject: Re: [xsl] Selecting First Direct Sibling
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 22 Aug 2007 18:06:23 +0100
> I take it that "DTD-specified element content" relies on a DOCTYPE 
> declaration

possibly implictly added by a catalog of some sort.

The XSLT engine of course doesn't know nuffin about what markup was
there, it just (typically) gets a sax stream of events which (may) tag
white space as being insiginficant which may have come from a dtd
specifiying element content, but it may have come from some tag soup
html parser just knowing about certain elements and "faking" a sax
stream.with teh appropriate properties set.

> And that this would apply to all 
> XML-parsed input, not just the main source document.

Yes it comes from the XDM specification so underpins all of the
XSLT/XPath/Xquery processing.

http://www.w3.org/TR/xpath-datamodel/#auto-const-infoset-text

The wording doesn't actualy mention dtd at all, just infoset properties:

  If the resulting Text Node consists entirely of whitespace and the
  [element content whitespace] property of the character information items
  used to construct this node are true, the content of the Text Node is
  the zero-length string.

note that initially a text node with a zero length string is
constructed, then later in the tree building process, any such nodes are
discarded while (not) being added to a parent node. So the quoted text
somewhat indirectly has the effect of causing white space text nodes to
be stripped in declared element content.


David

________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 
________________________________________________________________________

Current Thread