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

apply-templates - A doubt.

Subject: apply-templates - A doubt.
From: Nirmala R <nirmala.r@xxxxxxxxxx>
Date: Mon, 14 Apr 2003 11:12:07 +0530
 apply-templates - A doubt.
Hello,

I am looking for a method to overcome my problem. Thanks for your help.

I have an xml a.xml file like this:

	<?xml version="1.0"?> // root
	<?xml-stylesheet type="text/xsl" href="a.xsl"?>
	<first>
	<puid>abc</puid>
	<suid>123<suid/>
	<suid>456<suid/>
	</first>

For this I have a stylesheet like this:
	<?xml version="1.0" encoding="UTF-8"?>
	<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:template match="first">
	<html>
	<body>
	<i>puids:</i><br/>
	<xsl:apply-templates select="puid"/><br/>
	<i>suids:</i><br/>
	<xsl:apply-templates select="suid"/><br/>
	</body>
	</xsl:template>

	<xsl:template match="puid">
	<xsl:value-of select="."/>
	</xsl:template>

	<xsl:template match="suid">
	<xsl:value-of select="."/>
	</xsl:template>


Now, the question is
	
It is possible that, my xml file sometime does not contain any suid. In this
case, i should not even print the suids: heading also. I cannot put this
within the template match since
it will be printed then for each suid. 

How do I overcome this problem?

Please help me in solving this problem,
Regards,
Thanks,
Nirmala


 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.