Where's the data?

Creating the first XML file.

Now create a simple text file with an .xml extension and insert the following start code:

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="codehelp.xsl"?>

Remember to specify your .xsl file in place of codehelp.xsl

The XML file only contains the tags you entered in the .xsl stylesheet. Start with your main tag, making sure all other tags are enclosed within it. Then include each tag, matching the layout you planned:

<DESC>All the HTML help your website needs</DESC>

To get this sample .xml file to operate, try a cut down version of codehelp.xsl: (Reproduced here only for comparison. There is a link to the file itself on the next page.)

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">

<xsl:template match="/">

<li><a href="anyfile.xml"
title="home page?">Your home page?</a></li>
<xsl:apply-templates select="CODEHELP/NAVIGATE" />
<li><a href="../links/index.html"
title="the mandatory link page">Links</a></li>

<xsl:template match="CODEHELP/NAVIGATE">
<xsl:attribute name="href">
<xsl:value-of select="FILE"/>
<xsl:attribute name="title">
<xsl:value-of select="DESC"/>
<xsl:value-of select="CLICK"/>

This is part of www.codehelp.co.uk Copyright © 1998-2004 Neil Williams
See the file about.html for copying conditions.