RE: [DM] Typed value for elements

> >The expression:
> >
> >  <xsl:value-of select="div/head"/>
> >
> >would break.
> >  
> >
> This is the kind of example I have seen most frequently in this 
> discussion - examples where formatting occurs in a string, and either 
> string comparisons or value-of are done.

Precisely. That's what mixed content is all about. The text is the
information, the markup is incidental. It's not just <xsl:value-of>,
it's any operation that cares more about the text than about the markup.
The expression contains(head, "H2O") should indeed return true, because
the markup is mere annotation.

Certainly such constructs shouldn't suddenly cause stylesheets to fail
because someone discovers that the DTD allows markup in a heading and
decides to exploit the capability.

The only other approach I could think of would be that atomization is
sensitive to the required type, and gives you the string value if the
required type is string. But this is piling up the complexities, in my
view unnecessarily.

Michael Kay

Received on Thursday, 12 February 2004 14:14:38 UTC