[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: XHTML + XSL -> HTML problem

Subject: RE: XHTML + XSL -> HTML problem
From: <Jarno.Elovirta@xxxxxxxxx>
Date: Mon, 24 May 2004 16:15:05 +0300
xsl greather than
Hi,

> <xsl:stylesheet version="1.0"
>   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
>   xmlns:xhtml="http://www.w3.org/1999/xhtml";>

There's a SEMICOLON before the GREATHER-THAN SIGN, that makes your XSLT stylesheet ill-formed XML.

>     <xsl:output method="text"/>

Your question subject says you want to generate HTML, but here you're using text output method. It should be html if you want to generate HTML.
 
>    <xsl:template match="xhtml:title">
> 
>         <xsl:text>title: </xsl:text>
>         <xsl:value-of select="."/>
>         <xsl:text>&#10;</xsl:text>
>     </xsl:template>
> 
>     <xsl:template match="p">

This will not match your source because in your source the p elements are in XHTML namespace.

>         <xsl:text>paragraph "</xsl:text>
>         <xsl:value-of select="@name"/>
>         <xsl:text>": </xsl:text>
>         <xsl:value-of select="."/>
>         <xsl:text>&#10;</xsl:text>
>     </xsl:template
> </xsl:stylesheet>
> 
> I want to parse it and get the result as 
> a HTML page.

Then you need to generate the html etc. elements in one of your templates.

> I parse it via msxsl parser, but I get this error
> 
> D:\deepak\buildProcess_2\_tools>msxsl test.xhtml
> test.xsl -o test.html
> 
> Error occurred while parsing document.
> 
> Code:   0xc00ce50a
> URL:   
> file:///D:/deepak/buildProcess_2/_tools/test.xhtml
> Line:   2
> Column: 70
> The character '>' was expected.

Parser reports the well-formedness errors in your stylesheet.
 
> Also how and where should I include the statement
> manually inside the
> xhtml file to indicate to parse via the xsl file.
> 
> In xml files we include the statement 
> <?xml-stylesheet type="text/xsl" href="bcel-fb8.xsl"?>
> 
> Is parsing a XHTML via xsl a similar process?

Just serve the XHTML document using MIME-type "application/xhtml+xml" or e.g. "text/xml" and the browsers will process it as an XML document-if they support XML and XSLT.

Cheers,

Jarno

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.