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

Re: [xsl] problem with xsl:when test


Subject: Re: [xsl] problem with xsl:when test
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 30 Jan 2004 13:34:11 GMT

This list is for XSL, but your stylesheet is written in

xmlns:xsl="http://www.w3.org/TR/WD-xsl"

which is a totally different microsoft-specific language which is not
supported ebven in current Microsoft products, as sine msxml3 and IE6
they have used the standard xslt language.

Actually I don't think the syntax <xsl:when test=" was available in the
IE5 transformation language, so perhaps you really did intend to write
in xslt, in which case change the first line to say

  <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">


Assuming you do change to xslt, then,

<xsl:template match="//Output_List/*" >

You never need to start a match with //
probably you just want

<xsl:template match="*" >
here although it's hard to guess given your description.

I would guess that you intended here to test the current element but
actually this test ignores the current element and searches the whole
document to find nodes with the given names. Or at least it would if
you changed nodeName() to name() there is no nodeName() function in xslt.

  <xsl:when test="//Output_List/*[nodeName()='Struct_Element' or
  nodeName()='Array_Element']">

so you probbably just want

  <xsl:when test="self::Struct_Element or self::array_Element">

to test if the current node is either of those node types.

David

-- 
http://www.dcarlisle.demon.co.uk/matthew

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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



Current Thread
Keywords