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

RE: Newbie: easy one.

Subject: RE: Newbie: easy one.
From: Didier PH Martin <martind@xxxxxxxxxxxxx>
Date: Tue, 08 Jul 2003 10:18:37 -0400
RE:  Newbie: easy one.
Hi Rudi,

I tried my little utility to check the output of the XSLT stylesheet and
noticed that the template wasn't fired and this is why you get the two links
sitting side by side, they where simply dumped and not processed through
your template.

Here is a modified version that will resolve the problem. It is also simpler
than the original one. Notice that since the current context is on the node
webapps
  |____ website

and since address is a child element of website, we have only to select
"address" elements in the apply-templates.

webapps
  |____ website
           |____ address
           |____ address

 This will create a node list containing only "address" elements. Then,
these nodes could be "matched" against a template associated to "address"
elements.

Hope this will help

OK now its time for my bicycle ride, I have some calories to burn :-)
Cheers
Didier PH Martin
http://didier-martin.com

<?xml version="1.0" encoding="UTF-8"?>
<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="/">
<html>
<head><title>Web applications list</title></head>
<body>
<xsl:for-each select="webapps/website">
 <table border="1" summary="Web Application Table">
 <tr>
  <td>Site Name:</td>
  <td><xsl:value-of select="@name"/></td>
 </tr>

 <xsl:apply-templates select="address"/>

 </table>

</xsl:for-each>

</body>
</html>
</xsl:template>

<xsl:template match="address">
 <tr>
  <td>URL:</td>
  <td><xsl:value-of select="."/></td>
 </tr>
</xsl:template>

</xsl:stylesheet>


 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.