[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
RE: Problem with Xalan processing
Subject: RE: Problem with Xalan processing From: "Steve Brown" <prospect@xxxxxxxxxxx> Date: Tue, 22 Feb 2000 16:12:16 +1100 |
Look at <xsl:apply-templates select="???"/> where ??? is the name of the element that you want to match. eg the section reading: <H3>Policy Summary</H3> <HR /> <xsl:apply-templates /> should probably be: <H3>Policy Summary</H3> <HR /> <xsl:apply-templates select="BENEFITS"/> and <xsl:template match="BENEFIT"> <H4>Benefit: - $<xsl:value-of select="INSTALLMENT" /></H4> <BR /> <xsl:apply-templates /> </xsl:template> should probably be <xsl:template match="BENEFIT"> <H4>Benefit: - $<xsl:value-of select="INSTALLMENT" /></H4> <BR /> <xsl:apply-templates select="RIDER"/> </xsl:template> . Something like that anyway... -----Original Message----- From: owner-xsl-list@xxxxxxxxxxxxxxxx [mailto:owner-xsl-list@xxxxxxxxxxxxxxxx]On Behalf Of pbingley@xxxxxxxxxxx Sent: Tuesday, 22 February 2000 12:56 To: xsl-list@xxxxxxxxxxxxxxxx Subject: 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 XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Problem with Xalan processing, pbingley | Thread | Updated XSL support in IE5?, Norman Walsh |
RE: using XT to process Web resourc, Richard Lander | Date | RE: Node with maximum attribute val, Richard Birkby |
Month |