xsl-list
[Top] [All Lists]

Re: Flagging for No records found?

2004-02-11 10:47:48
Michael

That fixed it thanks. For everyone's reference here is the finished product.

Thanks again

Andrew

----------------------------------------------------------------------------
------------------------

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="1.0">

 <xsl:variable name="lowercase" select="'abcdefghijklmnopqrstuvwxyz'"/>
 <xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>

 <xsl:param name="product"/>
 <xsl:param name="var_content_type"/>
 <xsl:param name="technology"/>
 <xsl:param name="product_version"/>
 <xsl:param name="title"/>
 <xsl:param name="para"/>
 <xsl:param name="para_length"/>
 <xsl:param name="view_para"/>

 <xsl:variable name="uppertitle"
select="translate($title,$lowercase,$uppercase)"/>
 <xsl:variable name="upperpara"
select="translate($para,$lowercase,$uppercase)"/>

 <xsl:variable name="p" select="xdql/object/content/content_chunk [((product
= $product) or ($product = 'All')) and ((content_type = $var_content_type)
or ($var_content_type = 'All')) and ((technology = $technology) or
($technology = 'All')) and ((product_version = $product_version) or
($product_version = 'All')) and
(contains(translate(content_link,$lowercase,$uppercase), $uppertitle) or
($title = 'All')) and (contains(translate(para,$lowercase,$uppercase),
$upperpara) or ($para = 'All'))]"/>

  <xsl:template match="/">

     <xsl:for-each select="$p">


         <a>
          <xsl:attribute name="href"><xsl:value-of
select="content_link/@ref"/></xsl:attribute>
          <xsl:value-of select="content_link"/>
         </a>

         (Version: <xsl:value-of select="product_version"/>)

         <xsl:choose>
          <xsl:when test="$view_para = 'true'">
           <br/>
           <xsl:choose>
            <xsl:when test="$para_length = '-1'">
              <xsl:value-of select="para"/>
            </xsl:when>
            <xsl:when test="$para_length != '-1'">
              <xsl:value-of select="substring(para,1,$para_length)"/>

              <xsl:choose>
               <xsl:when test="string-length(para) &gt; $para_length">
                ...
               </xsl:when>
              </xsl:choose>


            </xsl:when>
           </xsl:choose>
         </xsl:when>
        </xsl:choose>

        <br/>

     </xsl:for-each>



   <xsl:if test="not(string($p))">
    <b>No records found.</b>
  </xsl:if>


  </xsl:template>
</xsl:stylesheet>

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



<Prev in Thread] Current Thread [Next in Thread>