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

XHTML + XSL -> HTML problem

Subject: XHTML + XSL -> HTML problem
From: Angeshwar Deepak <angeshwar@xxxxxxxxx>
Date: Mon, 24 May 2004 06:03:37 -0700 (PDT)
xhtml xsl
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>&#10;</xsl:text>
    </xsl:template>

    <xsl:template match="p">
        <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.

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

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.