Anyone here good with XSLT?

Rajinder Yadav devguy.ca-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Wed Aug 4 23:44:49 UTC 2010


On 10-08-04 06:54 PM, Evan Leibovitch wrote:
> OK, here goes. I have a stylesheet:
>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
> version="2.0">
> <xsl:output method="html"/>
>
> <xsl:template match="/">
> <xsl:message>Starting root</xsl:message>
> <xsl:apply-templates />
> <xsl:message>Ending root</xsl:message>
> </xsl:template>
>
> <xsl:template match="head">
> <xsl:message>Doing head</xsl:message>
> </xsl:template>
>
> <xsl:template match="body">
> <xsl:message>body</xsl:message>
> </xsl:template>
>
> </xsl:stylesheet>
>
>
> and an input file:
>
> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
> <head>
> <p>Hello World</p>
> </head>
> <body>
> <p>Goodbye World</p>
> </body>
> </html>
>
> When I process this I would expect to see the messages from the "head" 
> and "body" templates be executed (and the message showing). But they 
> don't. Any idea what I'm doing wrong?
>
> Thanks!
>
> - Evan
>
This might help http://www.w3schools.com/xsl/xsl_transformation.asp

I just noticed 2 obvious things
a) I know you can't put <p>Hello World</p> in the head section, your 
html is incorrect
b) where are you including your xsl sheet in your xml doc?

I suggest you do that example above to get an idea of how to transform a 
xml doc to an xhtml doc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gtalug.org/pipermail/legacy/attachments/20100804/c24c2da8/attachment.html>


More information about the Legacy mailing list