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

Re: Apply-template printing text from parent before ap

Subject: Re: Apply-template printing text from parent before applying template tochild
From: "Vasu Chakkera" <vasucv@xxxxxxxxxxx>
Date: Tue, 13 Aug 2002 15:04:16 +0000
insufficient funds letter
Hi Michel,
Its a bit difficult to guess what you actually want..
but if you change the apply-templates in your Letter Template to
<xsl:apply-templates select="nsf"/> (here u are asking the processor to look for the template which matches the element nsf )
Then you would get the following result..


***********************************************

2002-01-01

Firstname  Lastname
101 MyRoad
Apt 8
MyCity,  MyProv
A1A 1A1

Dear Member:

We wish to advice you that your chequing account currently has insufficient funds to cover the cheque / MasterCard debit of 60.00 received today.

****************************************************
hope this helps ( if the above result is what you are expecting )

Vasu


From: Michel Gallant <michel@xxxxxxxxx>
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: "'XSL List (XSL-List@xxxxxxxxxxxxxxxxxxxxxx)'" <XSL-List@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Apply-template printing text from parent before applying template to child
Date: Tue, 13 Aug 2002 11:18:32 -0300


Hello,
I`m new to XSL and I`m having a bit of problems.
I have the following files:

XML:
<letterGen date="2002-01-01">
	<letter langPref="e">
		<surname>Lastname</surname>
		<givenName>Firstname</givenName>
		<address1>101 MyRoad</address1>
		<address2>Apt 8</address2>
		<city>MyCity</city>
		<province>MyProv</province>
		<postalCode>A1A 1A1</postalCode>
		<accountNum>023498287</accountNum>
		<nsf letterAmount="5">
			<currentBalance>-23.11</currentBalance>
			<chequeTo>My company</chequeTo>
			<chequeAmount>60.00</chequeAmount>
		</nsf>
	</letter>
</letterGen>

XSL:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
	<xsl:template match="letterGen">
		<html>
			<head>
				<title>Test</title>
			</head>
			<body>
				<p>
					<xsl:value-of select="@date"/>
				</p>
				<xsl:apply-templates/>
			</body>
		</html>
	</xsl:template>
	<xsl:template match="letter">
		<p>
			<xsl:value-of
select="givenName"/>?<xsl:value-of select="surname"/>
			<br/>
			<xsl:value-of select="address1"/>
			<br/>
			<xsl:value-of select="address2"/>
			<br/>
			<xsl:value-of select="city"/>,?<xsl:value-of
select="province"/>
			<br/>
			<xsl:value-of select="postalCode"/>
			<br/>
		</p>
		<p>Dear Member:</p>
		<xsl:apply-templates/>
	</xsl:template>
	<xsl:template match="nsf">
		<p>
			We wish to advice you that your chequing account
currently has insufficient funds to cover the cheque / MasterCard debit of
<xsl:value-of select="chequeAmount"/> received today.
		</p>
	</xsl:template>
</xsl:stylesheet>

The problem that I'm having is that in my template for LETTER, when I do the
apply-templates, hoping to get the template for NSF, it prints out the text
contents of LETTER before the template for NSF, giving me the following :


<html xmlns:fo="http://www.w3.org/1999/XSL/Format">
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-16">
<title>Test</title>
</head>
<body>
<p>2002-01-01</p>
<p>Firstname Lastname<br>101 MyRoad<br>Apt 8<br>MyCity, MyProv<br>A1A
1A1<br></p>
<p>Dear Member:</p>LastnameFirstname101 MyRoadApt 8MyCityMyProvA1A
1A1023498287<p>
			We wish to advice you that your chequing account
currently has insufficient funds to cover the cheque / MasterCard debit of
60.00 received today.
		</p>
</body>
</html>

I'm sorry for not being able to explain very well, but I'd appreciate any
help.  Thank you

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




_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx



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.