How do I take XML-encoded HTML and create a XSLT? I have the xml/html page linked to the XSLT file and it shows the text from the document but will not show the link or picture. The image in the XML/HTML is in a folder called images within the folder where the xml and xslt are.
<?xml version="1.0" ?> <?xml-stylesheet type="text/xsl" href="XLST.xslt"?> <html> <head> <title>CATS! CATS! CATS!</title> </head> <body> <h1>CATS</h1> <p> <a href=" www.google.com">Visit Google...</a> </p> Cats like milk! <p> <image> <img src="Cats.jpg" alt="Cats, so cute!"/></image> </p> </body> </html>
And the XSLT file:
<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="html"> <xsl:apply-templates select="body" /> </xsl:template> <xsl:template match="body"> <img alt=""> <xsl:attribute name="src"> <xsl:value-of select="//Cats"/> </xsl:attribute> </img> </xsl:template> </xsl:stylesheet>
No comments:
Post a Comment