This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Newbie question - transforming 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@esri.com


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]