Re: [xsl] Re: XSLT for XHTML1 to XHTML2

Subject: Re: [xsl] Re: XSLT for XHTML1 to XHTML2
From: Alice Wei <ajwei@xxxxxxxxxxx>
Date: Tue, 1 Jan 2008 11:10:45 -0500
Hi, Vyacheslav:

If you only want to convert your XML to XHTML, all you need to do is to have a lot of <xsl:apply-templates/> nested like the one following:

<html>
<head> <!--you can insert your meta data here-->
</head>
<body>
<xsl:apply-templates/>
</body>
</html>

<xsl:template match="section">
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="p">
<p><xsl:apply-templates/>
</p>
<xsl:template/>

<xsl:template match="h">
<h1><xsl:apply-templates/>
</h1>
</xsl:template/>

However, I am not sure if the code here listed is XML or the intended output. There is no such thing now in the XHTML with <section>. If you want to, use something like a <div> to replace it for use in your XSLT conversion.

Cheers.

Alice Wei
MIS 2008
School of Library and Information Science
Indiana University Bloomington
ajwei@xxxxxxxxxxx
812-856-2659

Quoting Vyacheslav Sedov <vyacheslav.sedov@xxxxxxxxx>:

i should get something like this

<body>
<h>This is a top level heading</h>
<p>....</p>
<section>
   <p>....</p>
   <h>This is a second-level heading</h>
   <p>....</p>
   <h>This is another second-level heading</h>
   <p>....</p>
</section>
<section>
   <p>....</p>
   <h>This is another second-level heading</h>
   <p>....</p>
   <section>
       <h>This is a third-level heading</h>
       <p>....</p>
   </section>
</section>
</body>

On Jan 1, 2008 6:23 PM, Vyacheslav Sedov <vyacheslav.sedov@xxxxxxxxx> wrote:
hello,

i can`t find xslt for xhtml1 to xhtml2 convetring in www

maybe someone have this already?

i am mostly interested in automated converting flat h1..h8 structure
into nested sections structure.

with best wishes,
Slav

Current Thread