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

Problem with Xalan processing

Subject: Problem with Xalan processing
From: pbingley@xxxxxxxxxxx
Date: Tue, 22 Feb 2000 14:56:23 +1300
Problem with Xalan processing
I have been trying to get the Xalan processor going and processing some XML
from within a JSP and the actual processing seems to be working but the end
result is puzzling me with a few strange additions to the HTML that should
not be there.  I am relatively new to XSLT so maybe my style sheet is
incorrect but if someone could explain what is going wrong here?

The resulting HTML seems to have things added in each time apply-templates
is encountered

here is the XML:
<?xml version="1.0"?>
<POLICY>
     <INSTALLMENT>805.75</INSTALLMENT>
     <PAYMENT_FREQ>2</PAYMENT_FREQ>
          <BENEFIT>
          <INSTALLMENT>805.75</INSTALLMENT>
          <NUMBER>1</NUMBER>
               <RIDER>
                    <INSTALLMENT>385.54</INSTALLMENT>
                    <NUMBER>1</NUMBER>
                    <RATE>7.2040</RATE>
               </RIDER>
               <RIDER>
                    <INSTALLMENT>378.20</INSTALLMENT>
                    <NUMBER>2</NUMBER>
                    <RATE>7.2040</RATE>
               </RIDER>
               <RIDER>
                    <INSTALLMENT>42.01</INSTALLMENT>
                    <NUMBER>3</NUMBER>
                    <RATE>8.0000</RATE>
               </RIDER>
          </BENEFIT>
</POLICY>


and the XSL:

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version
="1.0">

<xsl:template match="/">
<xsl:apply-templates />
</xsl:template>

<xsl:template match="POLICY">
<HTML>
<HEAD>
<TITLE>the quote</TITLE>
</HEAD>
<BODY>
<H1>Your Policy Installment Premium is $<xsl:value-of select="INSTALLMENT"
/></H1>
<BR />
<H1>To be paid <xsl:value-of select="PAYMENT_FREQ" /> times per year.</H1>
<BR />
<BR /><BR />
<H3>Policy Summary</H3>
<HR />
<xsl:apply-templates />
</BODY>
</HTML>
</xsl:template>

<xsl:template match="BENEFIT">
<H4>Benefit: - $<xsl:value-of select="INSTALLMENT" /></H4>
<BR />
<xsl:apply-templates />
</xsl:template>

<xsl:template match="RIDER">
Rider #<xsl:value-of select="NUMBER" /> .......... $<xsl:value-of select
="INSTALLMENT" />
<BR />
</xsl:template>

</xsl:stylesheet>

and this is the HTML result:


<HTML>
<HEAD>
<TITLE>the quote</TITLE>
</HEAD>
<BODY>

<H1>The Policy Installment Premium is $805.75</H1>
<BR>
<H1>To be paid 2 times per year.</H1>
<BR>
<BR>
<BR>
<H3>Policy Summary</H3>
<HR>
     805.75

     2

          <H4>Benefit: - $805.75</H4>
<BR>
          805.75
          1

Rider #1 .......... $385.54<BR>

Rider #2 .......... $378.20<BR>

Rider #3 .......... $42.01<BR>

</BODY>
</HTML>



Thanks in advance

Phil


 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.