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

xslt and xsl:if

Subject: xslt and xsl:if
From: "Priya Pinto" <itfresher@xxxxxxxxxxxxxx>
Date: 22 Sep 2000 06:30:26 -0000
xsl if value of select
I've been working on using XML as a database and get the following xml file after deleting the childnodes of <bm> where id is b2. My XSL displays the list available along with edit and delete options but I need to ba able to check if bm has any child nodes and if not to avoid display of the deit and delete options!

XML File
<?xml version="1.0" ?>
<?xml:stylesheet type="text/xsl" href="try.xsl"?>
<bookmarks Autonumber="3">
<bm id="b1">
<title>arzoo</title>
<description>khjmhjkh</description>
<urls>http://www.arzoo.com</urls>
<category>hjjhkj</category>
</bm>
<bm id="b2">
</bm>
<bm id="b3">
<title>Mailcity</title>
<description>fgdhfgh</description>
<urls>http://www.mailcity.com</urls>
<category>jhjk</category>
</bm>
</bookmarks>

XSL File
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
  <html>
<style type="text/css">.input {
	BACKGROUND: #ffffcc; COLOR: #000000; FONT-WEIGHT: normal
}
A.nav:link {
	COLOR: #b03060; TEXT-DECORATION: none
}
A.nav:visited {
	COLOR: #b03060; TEXT-DECORATION: none
}
A.nav:hover {
	COLOR: #ba55d3; TEXT-DECORATION: none TEXT-SIZE: +2
}
</style>
  <body bgcolor="#eed5d2" link="#eed5d2" vlink="#eed5d2" alink="#eed5d2">

    <center>
      

      <font size="5" color="#b03060">Welcome 
</font>
<br/><br/>
<font size="3" color="#b03060">
Your Bookmarks!
</font>
<br/><br/>
<font size="4" color="#b03060">
Click here to 
<b>
<a class="nav">
<xsl:attribute name="HREF">
http://evereadi:8080/bookmark/jsp/Addform.jsp
</xsl:attribute>
Add New Bookmark
</a>
</b>
</font>
<br/><br/>
<table>
      <xsl:for-each select="bookmarks/bm">
<tr>
<td>
<input type="hidden" name="name">
<xsl:attribute name="value">
<xsl:value-of select="@id"/>
</xsl:attribute>
</input>
<b>
<a class="nav">
<xsl:attribute name="HREF">
<xsl:value-of select="urls"/>
</xsl:attribute>
<xsl:value-of select="title"/>
</a>
</b>
</td>

<td>
<b>
<a class="nav">
<xsl:attribute name="HREF">
http://evereadi:8080/bookmark/jsp/Editform.jsp?id=<xsl:value-of select="@id"/>&amp;title=<xsl:value-of select="title"/>&amp;description=<xsl:value-of select="description"/>&amp;urls=<xsl:value-of select="urls"/>&amp;category=<xsl:value-of select="category"/>
</xsl:attribute>
<img src="http://evereadi:8080/bookmark/images/edit.gif"/>
</a>
<a class="nav">
<xsl:attribute name="HREF">
http://evereadi:8080/bookmark/jsp/Delete.jsp?id=<xsl:value-of select="@id"/>&amp;title=<xsl:value-of select="title"/>&amp;description=<xsl:value-of select="description"/>&amp;urls=<xsl:value-of select="urls"/>&amp;category=<xsl:value-of select="category"/>
</xsl:attribute>
<img src="http://evereadi:8080/bookmark/images/delete.gif"/>
</a>
</b>
</td>
</tr>

</xsl:for-each>
 </table>
<br/>
<br/>

     
    </center>


  </body>
  </html>
</xsl:template>
</xsl:stylesheet>


Thanks
Priya

_________________________________________________
Get Your Free Email At, http://www.rediffmail.com

For fabulous shopping deals visit: http://www.rediff.co.in/shopping/index.html




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


Current Thread
  • xslt and xsl:if
    • Priya Pinto - 22 Sep 2000 06:30:26 -0000 <=
      • <Possible follow-ups>
      • Kay Michael - Fri, 22 Sep 2000 11:49:03 +0100

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.