Hi Endre,

It looks like XMLSPY's XSLT processor doesn't work right in this case. When
processor goes inside
    <xsl:for-each select='@subTypes'>

Current context node should be set to attribute node "subTypes". So when you
call 
                <xsl:with-param name='str'
select="normalize-space(@subTypes)"/>
There's no way, that attribute node "subTypes" could have attribute
"subTypes" inside of it.

You should change this line to:
                <xsl:with-param name='str' select="normalize-space(.)"/>

Or, since situation, when there're more than one attribute named "subTypes",
is impossible, I would change this code to:

    <xsl:if select="@subTypes">
            <xsl:call-template name='tokenize'>
                <xsl:with-param name='str'
select="normalize-space(@subTypes)"/>
                ....
            </xsl:call-template>
    </xsl:if>

xsl:if doesn't change context node.

Thanks,
Dimitry

-----Original Message-----
From: Endre Magyari [mailto:[EMAIL PROTECTED]]
Sent: Saturday, November 30, 2002 15:10
To: [EMAIL PROTECTED]
Subject: normalize-spaces()


Dear list,

    I'm using XMLSPY with both it's internal XSLT processor and XALAN as
external XSLT processor.

    this piece of code:

<xsl:for-each select='Class'>
    <xsl:variable name='base' select='@_id'/>
    <xsl:for-each select='@subTypes'>
            <xsl:call-template name='tokenize'>
                <xsl:with-param name='str'
select="normalize-space(@subTypes)"/>
                <xsl:with-param name='base' select='$base'/>
            </xsl:call-template>
    </xsl:for-each>
</xsl:for-each>

    works with XMLSPY internal XSLT processor, and doesn't work with XALAN.
    The problem is with normalize-space(). While XMLSPY's proc. does the
right thing,
the str passed to the named template will contain the subTypes attribute of
the Class element whenever such an attribute exists.
    When running  it with Xalan, the named template tokenize gets an empty
string.

Any Idea?
Thanks,
Endre

Reply via email to