[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Elements of non-actual position

Subject: RE: Elements of non-actual position
From: "Michael Leditschke" <mike@xxxxxxxxxxx>
Date: Wed, 5 Jun 2002 11:46:50 +1000
xsl position of element
Hi Joerg. Isn't there a level missing here? Shouldn't it be
<xsl:template match="table/rows/row">
  <xsl:for-each select="col">

Otherwise pos is the row number not the column number.

Regards
Michael

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Joerg Heinicke
> Sent: Wednesday, 5 June 2002 5:55 AM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re:  Elements of non-actual position
> 
> 
> <xsl:template match="table/rows">
>    <xsl:for-each select="row">
>      <xsl:variable name="pos" select="position()"/>
>      <xsl:if test="/table/cols/col[$pos]/@visible = '1'">
>        do what you want
>      </xsl:if>
>    </xsl:for-each>
> </xsl:template>
> 
> Regards,
> 
> Joerg
> 
> Rudolf Pischek wrote:
> > Hi, 
> > I have a problem of searching in my XML data:
> > <table>
> >   <cols>
> >     <col visible="1"/>
> >     <col visible="1"/>
> >     <col visible="1"/>
> >     <col visible="0"/>
> >     <col visible="1"/>
> >     <col visible="1"/>
> >     <col visible="0"/>
> >   </cols>
> >   <rows>
> >     <row>
> >       <cell>1</cell>
> >       <cell>2</cell>
> >       <cell>3</cell>
> >       <cell>4</cell>
> >       <cell>5</cell>
> >       <cell>6</cell>
> >       <cell>7</cell>
> >     </row>
> >     <row>
> >       ...
> >     </row>
> >     ...
> >   </rows>
> > </table>
> > 
> > and if I have a template:
> > 
> > <xsl:template match="table/rows">
> >   <!-- and I want in for-each: Give me all elements cell which 
> position is the same as the position of elements cols which 
> attribute visible is 1 -->
> >   <xsl:for-each="...">
> >     <!-- than this for-each must contain: cell 1, cell 2, cell 
> 3, cell 5, cell 6 -->
> > 
> >   </xsl:for-each>
> > </xsl:template>
> > 
> > I have no idea how I can get elements, one element I can...
> > Thanks very much
> > Rudolf
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 
> 


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.