|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] XSL newbie needs help.
Hi ,
I am a XSL newbie and I am trying to write my first XSL stylesheet for a
simple
xml document:.
<?xml version="1.0"?>
<?xml:stylesheet type="text/xsl" href="personal.xsl" ?>
<!DOCTYPE personal SYSTEM "personal.dtd" [
]>
<personal>
<name>Joe Orange</name>
<street>Blueberry Road</street>
<town>Apple town</town>
<phone>12 34 56 78</phone>
</personal>
Using the KOALA XSL engine and the appended stylesheet 1 got the desired
result.
Then I liked to open my document with the IE5.0, but I was disappointed,
because
I only got an error message telling me "Keyword xsl:process may not be used
here."
I had a quick look to Microsoft XSL Reference and to the W3 Working draft
of XSL and
I changed my style-sheet to the appended stylesheet 2. Unfortunatly it's
still wrong.
With the KOALA XSL engine <xsl:apply-templates select="..."> is treated as
text.
Opening my document with IE5.0 only dislplay an empty screen. So I
wondering
what I am doing wrong.
In future I will process my xml using xsl stylesheet within a Java program.
Therefor I'd like
to use the KOALA XSL engine. But I'd like to use the xsl language elements
as described
in the w3 woring draft.
For any help I'd be grateful. Thanks.
Regards
Anette Engel
Stylesheet 1:
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/TR/WD-xsl"
xmlns="http://www.w3.org/TR/REC-html40"
result-ns="">
<xsl:template match="/">
<html>
<xsl:process select="name" />
<xsl:process select="street" />
<xsl:process select="town" />
<xsl:process select="phone" />
</html>
</xsl:template>
<xsl:template match="name">
<h1><xsl:process-children /></h1>
</xsl:template>
<xsl:template match="street">
<p><xsl:process-children /></p>
</xsl:template>
<xsl:template match="town">
<p><xsl:process-children /></p>
</xsl:template>
<xsl:template match="phone">
<p><strong><xsl:process-children /></strong></p>
</xsl:template>
</xsl:stylesheet>
Stylesheet 2:
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/TR/WD-xsl"
xmlns="http://www.w3.org/TR/REC-html40"
result-ns="">
<xsl:template match="/">
<html>
<xsl:apply-templates select="street" />
<xsl:apply-templates select="street" />
<xsl:apply-templates select="town" />
<xsl:apply-templates select="phone" />
</html>
</xsl:template>
<xsl:template match="name">
<h2><xsl:apply-templates /></h2>
</xsl:template>
<xsl:template match="street">
<p><xsl:apply-templates /></p>
</xsl:template>
<xsl:template match="town">
<p><xsl:apply-templates /></p>
</xsl:template>
<xsl:template match="phone">
<p><strong><xsl:apply-templates /></strong></p>
</xsl:template>
</xsl:stylesheet>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








