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

Apply-template printing text from parent before applyi

Subject: Apply-template printing text from parent before applying template to child
From: Michel Gallant <michel@xxxxxxxxx>
Date: Tue, 13 Aug 2002 11:18:32 -0300
apply template
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"/>&#160;<xsl:value-of select="surname"/>
			<br/>
			<xsl:value-of select="address1"/>
			<br/>
			<xsl:value-of select="address2"/>
			<br/>
			<xsl:value-of select="city"/>,&#160;<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


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.