[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: XHTML to XHTML transform
> -----Original Message----- > From: Jeffrey Moss [mailto:jeff@xxxxxxxxxxxx] > <snip /> > I have tried a number of different approaches already. I played > around with the xmlns:xhtml namespace in my XSL file (not sure if I ever did this > correctly, I don't think I fully understand what namespaces do). > Hi, What exactly is it that is not working? If your supplied source and desired target format were plain XML the solution would look like: <xsl:template match="BODY"> <xsl:copy> <xsl:apply-templates /> </xsl:copy> </xsl:template> <xsl:template match="BOX"> <DIV ID="box"> <xsl:apply-templates /> </DIV> </xsl:template> <xsl:template match="TITLE"> <DIV ID="top"> <DIV ID="topleft" /> <DIV ID="topright" /> <SPAN ID="title"> <xsl:apply-templates /> </SPAN> </DIV> </xsl:template> <xsl:template match="FOOTER"> <DIV ID="bottom"> <DIV ID="bottomleft" /> <DIV ID="bottomright" /> <SPAN ID="footer"> <xsl:apply-templates /> </SPAN> </DIV> </xsl:template> If you really want to you could combine the latter two templates, since they output something very similar. The 'Hello World' text will be copied because of the default template rule for text-nodes (same as the content of the TITLE / FOOTER nodes) Now, depending upon your source files (prefixed elements / namespaces), you may need to make it something like: <xsl:template match="html:BODY"> or <xsl:template match="*[local-name()='BODY']"> > I also played with the xsl:output tag to see if I could get that to do > something cool, but no. > In XSLT 1.0 the options are: xml / text / html As you want to ouput XHTML, if you use xsl:output, you need to specify XML as your output target. Hope this helps! Cheers, Andreas
|
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
|