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]

xpath expression


"if I'm not last, and the next input/type isn't select"

i.e.

<input>
    <type>whatever</type>
</input>

<input>
    <type>text</type> <-- I'm here
</input>

<input>
    <type>select</type> <-- I need to know what the value of this element is
</input>

<input>
    <type>something</type>
</input>


------

xsl:

        <xsl:if test="not(position()=last()) and
not(input[position()+1]/type = 'select')">
            <br />
        </xsl:if>

I _think_ the above expression doesn't work because the 'pointer' is at

<input>
    <type>text</type> <-- here
</input>

but I can't figure out a way to "go up" on level. there has to be a way :)

I tried this:

        <xsl:if test="not(position()=last()) and
not(parent[position()+1]/type = 'select')">

with the exact same result as the above.

but I'm getting there!

_alex



 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]