RE: [xsl] Constructing Simple Content and Built-in Template Rules

Subject: RE: [xsl] Constructing Simple Content and Built-in Template Rules
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 13 Apr 2005 10:29:15 +0100
> Why does atomization of an element-only node raises an error? 
> Wouldn't it be
> better to concatenate the typed value of all node 
> descendants, as it is done
> with the string value?


The thinking is that in data-oriented XML, values are meaningless without
knowing the containing element tags. For example, it would be misleading to
consider

<person>
  <first>Henry</first>
  <last>James</last>
</person>

and

<person>
  <last>Henry</last>
  <first>James</first>
</person>

as equivalent. This contrasts with document-oriented XML, where the
convention is that the textual content is meaningful even if you strip away
all the tags. The implicit assumption is that element-only content indicates
data orientation, while mixed content indicates text orientation. This isn't
always true in practice, of course: look at the schema for XSLT 2.0
stylesheets for a counter-example. But even with element-only content, you
can get the string-value of any element node if you really want it by using
the string() function.

Michael Kay
http://www.saxonica.com/

Current Thread