[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

XSL newbie needs help.


Subject: XSL newbie needs help.
From: anette.engel@xxxxxxxx
Date: Wed, 23 Dec 1998 11:20:17 +0100

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



Current Thread
Keywords