|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: nesting xml
Please study this example before asking more questions like
your previous ones.
Regards,
Dan
-------------------------------------------------
File: Webquest.xml
<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet type="text/xsl" href="Webquest.xsl"?>
<webquest>
<text>
Hello, and welcome to my page!
</text>
<image>
<src>http://www.cwolves.com/images/menu/opt1_on.gif</src>
<border>0</border>
</image>
<hyperlink>
<url>http://www.yahoo.com</url>
<text>Yahoo!</text>
</hyperlink>
<hyperlink>
<url>/page2.html</url>
<image>
<src>http://www.cwolves.com/images/menu/opt2_on.gif</src>
<border>1</border>
</image>
</hyperlink>
</webquest>
File: Webquest.xsl
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<xsl:apply-templates select="webquest"/>
</body>
</html>
</xsl:template>
<xsl:template match="webquest">
<h1><xsl:value-of select="text"/></h1>
<img src="{image/src}" border="{image/border}"></img><br/>
<xsl:for-each select="hyperlink">
<a href="{url}">
<xsl:choose>
<xsl:when test="image">
<img src="{image/src}" border="{image/border}"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="text"/>
</xsl:otherwise>
</xsl:choose>
</a><br/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
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








