Subject: Re: Design question
From: Antonio Fiol <fiol@xxxxxxxxxx>
Date: Wed, 10 Jul 2002 10:50:41 +0200
|
The reason Jay couldn't use that is that for some arrangements of
parameters this would lead to attributes being added after child
elements have already been added to the da:Positive element, which is
an error in XSLT.
I thought there was no concept of "before" and "after" on XSLT.
For example, with the input specified:
<test type="positive" name="Test 1">
<param name="p1">123</param>
<param name="date1">July 9</param>
<param name="p2">false</param>
</test>
Your code is equivalent to:
<da:Positive name="@name"> <!-- [sic -- forgot {}s] -->
Oops!
<xsl:attribute name="p1">123</xsl:attribute>
<xsl:element name="da:Date">
<xsl:attribute name="number">1</xsl:attribute>
</xsl:element>
<xsl:attribute name="p2">false</xsl:attribute>
</da:Positive>
I know, but I thought this would work.
Processors that don't halt when they encounter an attribute being
added after element content ignore the attribute, so either you get an
error or erroneous output; either way it's not much good.
Indeed, bad luck...
Antonio Fiol
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|