Re: Problem with example from faq

Subject: Re: Problem with example from faq
From: Scott Boag <sboag@xxxxxxxxxxxxx>
Date: Thu, 11 Nov 1999 18:50:53 -0500
I found the prefix for the xsl namespace missing, xsl:apply-templates
was xsl:apply-template, and "ancestor::*" was "acestor::*".

When I run the modified stylesheet:

<?xml version="1.0"?>
<!--
<xsl:stylesheet xmlns:="http://www.w3.org/1999/XSL/Transform";>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0";>
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<xsl:template match="/">
<xsl:apply-templates mode="start" select="//z"/>
</xsl:template>

<xsl:template mode="start" match="*">
<xsl:text>&#xa;Document order:</xsl:text>
<xsl:for-each select="ancestor::*">
       <xsl:text>&#xa;Element:</xsl:text>
</xsl:for-each>
<xsl:text>&#xa;&#xa;Axis Order:</xsl:text>
<xsl:apply-templates select="ancestor::*[1]"/>
</xsl:template>

<xsl:template match="*">
<xsl:text>&#xa;Element:</xsl:text>
<xsl:value-of select="name()"/>
<xsl:apply-templates select="ancestor::*[1]"/>
</xsl:template>

</xsl:stylesheet>

...it seems to work fine (at least from my quick glance).  This is with
LotusXSL 0.18.5.  You should have seen some output with the namespace
broken, or good error messages.

-scott

Esfandiar Mazdeh wrote:

> Hello,I have tried to run the following xml,xsl combination which I
> picked fromxsl-faq and modified a little. However, Lotusxsl does not
> show anything:xml file:<?xml version="1.0"?><test><a>this is a<b>this
> is b<c>this is c<d>this is d<e>this is e<f>this is f<g>this is
> g<h>this is h<i>this is i<j>this is j<k>this is k<l>this is l<m>this
> is m<n>this is n<o>this is o<p>this is p<q>this is q<r>this is
> r<s>this is s<t>this is t<u>this is u<v>this is v<w>this is w<x>this
> is x<y>this is y<z>this is
> z</z></y></x></w></v></u></t></s></r></q></p></o></n></m></l></k></j></i></h></g></f></e></d></c></b></a></test>xsl
> file:<?xml version="1.0"?><!--<xsl:stylesheet
> xmlns:="http://www.w3.org/1999/XSL/Transform";><xsl:stylesheet
> xmlns:xsl="http://www.w3.org/XSL/Transform/1.0";>--><xsl:stylesheet
> version="1.0" xmlns:="http://www.w3.org/1999/XSL/Transform";>
>  <xsl:template match="/"><xsl:apply-template mode="start"
> select="//z"/></xsl:template><xsl:template mode="start"
> match="*"><xsl:text>&#xa;Document order:</xsl:text><xsl:for-each
> select="acestor::*"><xsl:text>&#xa;Element:</xsl:text></xsl:for-each><xsl:text>&#xa;&#xa;Axis
> Order:</xsl:text><xsl:apply-templates
> select="ancestor::*[1]"/></xsl:template><xsl:template
> match="*"><xsl:text>&#xa;Element:</xsl:text><xsl:value-of
> select="name()"/><xsl:apply-templates
> select="ancestor::*[1]"/></xsl:template></xsl:stylesheet>Can anyone
> tell me why?Thanks.
> ====================================================================
> Esfandiar Steve Mazdeh         Informix
> Email: emazdeh@xxxxxxxxxxxx         4100 Bohanon Driver
> Phone: (650) 926-1062                     Menlo Park, CA
>                      http://www.informix.com
> ====================================================================


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


Current Thread