xsl-list
[Top] [All Lists]

RE: Constructing Simple Content and Built-in Template Rules

2005-04-13 02:29:15
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/



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>