This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Need a confirmation of a difference between WD-xsl and 1999/XSL/Transform


Hi all,

I'm generating an XSL from an XML template, using the DOM, for the WD-xsl
version (IE5 client) !!!
In my application, depending on the value of an attribute (@LOGIC = 'and' or
@LOGIC='or'), I have to write a different output :

If the value is 'and', i must write an xsl:if test with few tests depending
on the number of specific childnodes. For example if I have three childnodes
:

<xsl:if test='(test1) and (test2) and (test3)'>

Of course with a value of 'or', I should write :

<xsl:if test='(test1) or (test2) or (test3)'>

My first problem is that it seems the WD-xsl version can't handle that, I
can only make one test : example :

<xsl:if test='/ELEMENT1[@Attrib1 = 'val1' $and$ @Attrib2 = 'val2']'> (this
works)

This doesn't work :

<xsl:if test='(/ELEMENT1[@Attrib1 = 'val1' $and$ @Attrib2 = 'val2']) and
(test2) and (test3)'>

So first question : Is this "normal" and does it depends on the XSL Parser
version ?
Second question : How can i handle it with the WD-xsl version ?

I started looking for a serie of <xsl:if> such as :
<xsl:if test='test1'>
    <xsl:if test='test2'>
        <xsl:if test='test3'>
            This is okay in the case of a 'and' for my @LOGIC attribute
        </xsl:if>
    </xsl:if>
</xsl:if>

But how to do it for the 'or'

I can't do this (the output file would be too large)

<xsl:if test='test1'>
     write my XML bloc
</xsl:if>
<xsl:if test='test2'>
     write my XML bloc
</xsl:if>
<xsl:if test='test3'>
     write my XML bloc
</xsl:if>

And it's the same with the xsl:choose/xsl:when.

If someone feels inspired... Don't hesitate

Thanks a lot

Jean-Christophe


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]