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

Newbie question - transforming XHTML to XML

Subject: Newbie question - transforming XHTML to XML
From: Jennifer Wrightsell <jwrightsell@xxxxxxxx>
Date: Fri, 28 Sep 2001 13:49:11 -0700
xhtml to xml
Hi,

I've been trying to figure out how to transform an XHTML document to an XML
document using an XSLT style sheet.  I'm using a freeware app called
Cooktop, which provides a choice of XSLT processors to use for your
transformation.

What I can't figure out is how/where to specify the name/path of the XSLT
style sheet.  I've been told this should be done externally, as opposed to
using a link in the input document.  Where do I do this and what syntax
should be used? 

The following are exerpts of my XHTML input (test.htm) and xsl stylesheet
(test.xsl).  Am I using the correct namespace, etc.?

Input -- test.htm:

<html xmlns:h="http://www.w3.org/1999/xhtml">

<head>
<link rel="stylesheet" type="text/css" href="81Help.css" />
<title>Test transformation</title>
</head>
<body>
<h1>Test transformation</h1>
<p>Text</p>
<p>More stuff</p>
</body>
</html>

XSL style sheet (test.xsl)

<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:h="http://www.w3.org/1999/xhtml">
<xsl:output method="xml"/>

<xsl:template match="title">
<title><xsl:value-of select="."/></title>
</xsl:template>

<xsl:template match="h1">
<heading><xsl:value-of select="."/></heading>
</xsl:template>

<xsl:template match="p">
<para><xsl:value-of select="."/></para>
</xsl:template>

</xsl:stylesheet>	


The output (test.xml) should look something like this:

<?xml version='1.0'?>
<title>Test transformation<title>
<heading>Test transformation</heading>
<para>Text</para>
<para>More stuff</para>

Can anyone help?  Please respond to me directly as I'm subscribed to the
digest only.

Thanks!

Jennifer	

Jennifer Wrightsell
ArcGIS Documentation
Online Help Team
ESRI
(909) 793-2853, ext. 1682
jwrightsell@xxxxxxxx


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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-2007 All Rights Reserved.