xsl-list
[Top] [All Lists]

RE: more elegant way to process element with default value?

2003-06-13 15:11:04

Umm... I just looked this up in the XML 1.0 spec (3.3.3 Attribute-Value
Normalization) and I don't understand how it is reconciled with what you 
said...

I think it's fair to assume that if there's a discrepancy between what I
said and what's in the spec, then the spec is right (blame it on my lack
of typing skills:-)

attribute value normalisation goes through a sequence of slightly
bizarre steps which I didn't want to go into so simplified greatly but
the end result most of the time is that newlines in attribute values get
reported as spaces, this is why, in XSLT if you go
<xsl:attribute name="x">
1
2
3
</xsl:attribute>
it will get output as
  x="@#10;1(_at_)#10;2(_at_)#10;3(_at_)#10;"

(with & not @ I substitued to avoid some stupid mailers interpretting
the character refs)  This attribute, because the newlines are quoted
has newlines in its value, but
x="
1
2
3
"

which you might expect to be the result of the xsl:attribute would not
work as the xml parse will report those as spaces not newlines.

David

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list