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

Select previous sibling where attribute is not empty

Subject: Select previous sibling where attribute is not empty
From: Mathieu Malaterre <mathieu.malaterre@xxxxxxxxx>
Date: Tue, 13 Apr 2010 17:03:19 +0200
 Select previous sibling where attribute is not empty
Hi there,

  I am trying to select preceding-sibling::row[1] or
preceding-sibling::row[2] in the following example. Of course '1' or
'2' are hardcoded, and instead I need to express instead " where
entry/@morerows != '' "

Here is my Input.xml:

   <informaltable frame="all">
      <tgroup cols="3.782608695652174"><tbody><row>
            <entry morerows="2">
               <para>Study</para>
            </entry>
            <entry>
               <para>General Study</para>
            </entry>
            <entry>
               <para>C.7.2.1</para>
            </entry>
            <entry>
               <para>M</para>
            </entry>
         </row>
         <row>
            <entry>
               <para>Patient Study </para>
            </entry>
            <entry>
               <para>C.7.2.2</para>
            </entry>
            <entry>
               <para>U</para>
            </entry>
         </row>
         <row>
            <entry>
               <para>Clinical Trial Study</para>
            </entry>
            <entry>
               <para>C.7.2.3</para>
            </entry>
            <entry>
               <para>U</para>
            </entry>
         </row></tbody></tgroup>
   </informaltable>


My current xsl script is:

  <xsl:template match="row">
    <xsl:message>
    <xsl:if test="count(entry) = 3">
      <xsl:value-of select="preceding-sibling::row[entry/@morerows != '' ]"/>
    </xsl:if>
    </xsl:message>
  </xsl:template>


Thanks for suggestions,
-- 
Mathieu

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.