Author: Eyvind Axelsen
Posted: 2007-06-13 at 02:20:11
An xsl is not the schema (while an xsd file is). The xsl is a style sheet, that as you mention allows for a browser to pretty-print the xml. To use an xsl style sheet, include a line like the following at the top (after the <?xml version="..."?> tag) of the xml file:
<?xml-stylesheet type="text/xsl" href="your_xsl_file_here.xsl"?>
For example:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="simple.xsl"?>
<breakfast_menu>
<food>
<name>Belgian Waffles</name>
<price>$5.95</price>
<description>
two of our famous Belgian Waffles
</description>
<calories>650</calories>
</food>
</breakfast_menu>
And the corresponding xsl:
<?xml version="1.0" encoding="ISO-8859-1"?>
<html xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="" target="_blank">http://www.w3.org/1999/xhtml">
<body style="font-family:Arial,helvetica,sans-serif;font-size:12pt;
background-color:#EEEEEE">
<xsl:for-each select="breakfast_menu/food">
<div style="background-color:teal;color:white;padding:4px">
<span style="font-weight:bold;color:white">
<xsl:value-of select="name"/></span>
- <xsl:value-of select="price"/>
</div>
<div style="margin-left:20px;margin-bottom:1em;font-size:10pt">
<xsl:value-of select="description"/>
<span style="font-style:italic">
(<xsl:value-of select="calories"/> calories per serving)
</span>
</div>
</xsl:for-each>
</body>
</html>
>From http://w3schools.com/xml/xml_xsl.asp.
Now, show me the money! <g>
Eyvind.
-----Opprinnelig melding-----
Fra: profox-bounces@leafe.com [mailto:profox-bounces@leafe.com] PÃÂ¥ vegne av Sytze de Boer
Sendt: 13. juni 2007 00:11
Til: profox@leafe.com
Emne: VFP9 - cursortoxml
I previously posted a question re converting a small stand-a-lone dbf
to xml file, using a schema (xsl file) supplied by my client.
Creating an xml file is simple
What I can't get my head around is to use the schema "thingee" to ALSO
produce the xml file in a format so that when you double click on it,
it looks all neatly formatted.
almost like a (frx) report from a color printer.
Is there someone here who is prepared to assist me conclude this process.
I am willing to PAY for the help you provide.
Regards
Sytze
[excessive quoting removed by server]