RE: [xsl] XHTML to XHTML transform

Subject: RE: [xsl] XHTML to XHTML transform
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Fri, 2 Apr 2004 19:34:38 +0100
If you want us to show you where you've gone wrong, you'll have to show us
your code.

Michael Kay

> -----Original Message-----
> From: Jeffrey Moss [mailto:jeff@xxxxxxxxxxxx] 
> Sent: 02 April 2004 17:56
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] XHTML to XHTML transform
> 
> I want to create XHTML files and run them through some 
> transforms to turn
> things like this:
> 
> <BODY>
> <BOX>
>     <TITLE>Title</TITLE>
>     Hello World
>     <FOOTER>Footer</FOOTER>
> </BOX>
> </BODY>
> 
> Into this:
> 
> <BODY>
> <DIV ID="box">
>     <DIV ID="top">
>         <DIV ID="topleft">
>         <DIV ID="topright">
>         <SPAN ID="title">Title</SPAN>
>     </DIV>
>     Hello World
>     <DIV ID="bottom">
>         <DIV ID="bottomleft">
>         <DIV ID="bottomright">
>         <SPAN ID="footer">Footer</SPAN>
>     </DIV>
> </DIV>
> </BODY>
> 
> ...using a one time build file, or one time XSL transform. I 
> all standard
> XHTML content to remain intact, even stuff inside the 
> "footer" element, and
> everything. I'm pretty sure this will require the 
> <apply-templates /> tag
> all over the place, which is fine.
> 
> 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).
> 
> I tried XSL copy in my templates but there doesn't seem to be 
> a way to say
> "apply templates or else copy node and apply templates"
> 
> I also tried to define a template that matches "*" for any 
> unmatched node,
> and copy the element and parameters and then apply templates 
> on the content.
> 
> I also played with the xsl:output tag to see if I could get that to do
> something cool, but no.
> 
> Please help!
> 
> -Jeff

Current Thread