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

Re: HOW TO CHECK FOR EXISTENCE OF A NODE

Subject: Re: HOW TO CHECK FOR EXISTENCE OF A NODE
From: Rick Taylor <taylor@xxxxxxxx>
Date: Fri, 14 Mar 2003 10:32:33 -0700
asp check if table exists
First, read some tutorials in depth.
Then try using an 'if' or a 'choose/when'

<TABLE BORDER="4" WIDTH="100%" VALIGN="TOP" CELLPADDING="5">
<!-- put the if at the appropriate level--I'm assuming this is where you might want it.-->
<xsl:if test="header_notes">
<TR>
<TD WIDTH="100%" VALIGN="TOP" COLSPAN="2">
<H4 ALIGN="LEFT">HEADER NOTES AREA</H4>
<xsl:value-of select="header_notes_text" /><BR/>
</TD>
</TR>
</xsl:if>
</TABLE>


At 10:54 AM 3/14/03 -0600, you wrote:

Newbie here.  I am looking for the proper element to evaluate the existence
of a node in order to suppress the generation of an HTML display 'box' if a
particular node does not exist.  So, instead of producing a box with a
caption of 'HEADER NOTES' when there are no header notes, I would rather not
produce the box at all to cut down on the clutter.  Here is the code which
makes the box and displays any header_notes_text if it exists.   For
example,


<TABLE BORDER="4" WIDTH="100%" VALIGN="TOP" CELLPADDING="5"> <TR> <TD WIDTH="100%" VALIGN="TOP" COLSPAN="2"> <H4 ALIGN="LEFT">HEADER NOTES AREA</H4> <xsl:for-each select="header_notes"> <xsl:value-of select="header_notes_text" /><BR/> </xsl:for-each> </TD> </TR> </TABLE>



I tried wrapping the above with xsl:template but got this error:
Keyword xsl:template may not be used here.

I have not had any ah-ha experiences yet, so I don't see the obvious.

----------

Mike Rudolph - EDI Coordinator
Green Bay Packaging Inc.
Phone: 920.433.5426
Fax:   920.438.5426
Email: mrudolph@xxxxxxx


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

Rick Taylor XML Developer PPDM Association


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



Current Thread
  • XSL and ASP, (continued)
    • Luke Ambrogio - Fri, 14 Mar 2003 12:09:45 -0500 (EST)
    • Rick Taylor - Fri, 14 Mar 2003 12:30:44 -0500 (EST) <=
    • Bix - Fri, 14 Mar 2003 13:05:51 -0500 (EST)
    • XSLList - Fri, 14 Mar 2003 12:56:30 -0500 (EST)

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.