|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








