Subject: RE: [xsl] XHTML + XSL -> HTML problem From: "Joe Fawcett" <joefawcett@xxxxxxxxxxx> Date: Mon, 24 May 2004 14:10:05 +0100 |
</xsl:text>From: Angeshwar Deepak <angeshwar@xxxxxxxxx> Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: [xsl] XHTML + XSL -> HTML problem Date: Mon, 24 May 2004 06:03:37 -0700 (PDT)
Hi,
I have a XHTML file as follows
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> <html xmlns="http://www.w3.org/1999/xhtml";> <head> <title> XHTML sample </title> </head>
<body>
<p name="who">Anand</p> <p name="job">Web Developer</p> <p name="area">California</p>
</body> </html>
My xsl file is as follows
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; xmlns:xhtml="http://www.w3.org/1999/xhtml";>
<xsl:output method="text"/>
<xsl:template match="xhtml:title">
<xsl:text>title: </xsl:text> <xsl:value-of select="."/> <xsl:text>
</xsl:template></xsl:text>
<xsl:template match="p"> <xsl:text>paragraph "</xsl:text> <xsl:value-of select="@name"/> <xsl:text>": </xsl:text> <xsl:value-of select="."/> <xsl:text>
</xsl:template </xsl:stylesheet>
I want to parse it and get the result as a HTML page.
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.
When I parse it thro Ant build, I get the error as
[xslt] Processing D:\deepak\buildProcess_2\_tools\test.xhtml to D:\deepak\buildProcess_2\_tools\test.html [xslt] Loading stylesheet D:\deepak\buildProcess_2\_tools\test.xsl [xslt] [Fatal Error] test.xsl:2:51: Element type "xsl:stylesheet" must be followed by either attribute specifications, ">" or "/>". [xslt] : Fatal Error! org.xml.sax.SAXParseException: Element type "xsl:stylesheet" must be followed by either attribute specifications, ">" or "/>". C ause: org.xml.sax.SAXParseException: Element type "xsl:stylesheet" must be followed by either attribute specifications, ">" or "/>". [xslt] Failed to transform using stylesheet D:\deepak\buildProcess_2\_tools\test.xsl [xslt] Failed to process D:\deepak\buildProcess_2\_tools\test.xhtml
BUILD FAILED file:D:/deepak/buildProcess_2/_setup/docs.xml:198: Fatal error during transformation
Can some one suggest some solution.
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?
bye, with regards, Deepak.
__________________________________ Do you Yahoo!? Yahoo! Domains Claim yours for only $14.70/year http://smallbusiness.promotions.yahoo.com/offer
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] XHTML + XSL -> HTML probl, Michael Kay | Thread | RE: [xsl] XHTML + XSL -> HTML probl, Andrew Welch |
Re: [xsl] XHTML + XSL -> HTML probl, G. Ken Holman | Date | Re: [xsl] XHTML + XSL -> HTML probl, David Carlisle |
Month |