[Home] [By Thread] [By Date] [Recent Entries]
Hi,
Tempore 16:08:22, die 08/08/2005 AD, hinc in xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit Steven Hughes <shughes@xxxxxxxxxxxxxxxxx>: I am trying to convert a simple html page with css to an xml page with xsl.
All those headerlinks and '<link><a href="#top" >back to top</a></link>' belong in the XSL. Here you have a basic stylesheet that tries to make something useful out of the provided XML <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" indent="yes"/> <xsl:template match="acadguide"> <html> <head> <title><xsl:value-of select="title"/></title> </head> <body> <xsl:apply-templates/> </body> </html> </xsl:template> <xsl:template match="figures/*">
<a href="{full_src}" title="Click to enlarge this image">
<img src="{thumb_src}" title="{caption}"/>
</a>
</xsl:template><xsl:template match="link[href]">
<a href="{href}">
<xsl:value-of select="label"/>
</a>
</xsl:template><xsl:template match="a"> <xsl:copy-of select="."/> </xsl:template> <xsl:template match="section"> <p><xsl:apply-templates/></p> </xsl:template> <xsl:template match="title"> <h1><xsl:apply-templates/></h1> </xsl:template> <xsl:template match="section/title"> <h1><a> <xsl:attribute name="name"> <xsl:text>section_</xsl:text><xsl:number count="section" format="001"/> </xsl:attribute> <xsl:apply-templates/> </a></h1> </xsl:template> <xsl:template match="subtitle"> <h2><xsl:apply-templates/></h2> </xsl:template> </xsl:stylesheet> regards, -- Joris Gillis (http://users.telenet.be/root-jg/me.html) Vincit omnia simplicitas Keep it simple
|

Cart



