OK here it is (I sent you 2 files to your Yahoo address so please disregard
them):
===XML====
<?xml version="1.0" ?>
<METRICSINFORMATION>
<Stateflow>
<chartName>chart_constant</chartName>
<numTransition>DIFFTAG_rem 3 DIFFTAG_add 4</numTransition>
<transitionData>
<labelString>?</labelString>
</transitionData>
</Stateflow>
</METRICSINFORMATION>
===============
====XSL=========
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<basefont face="Arial" size="4" />
</head>
<body>
<ol>
<xsl:apply-templates select="/METRICSINFORMATION/Stateflow"/>
</ol>
</body>
</html>
</xsl:template>
<xsl:template name="Stateflow" match="/METRICSINFORMATION/Stateflow">
<xsl:for-each select="*">
<xsl:call-template name="GlobalTemplateStateflow"/>
</xsl:for-each>
<xsl:for-each select="*/*">
<xsl:call-template name="GlobalTemplateStateflow"/>
</xsl:for-each>
</xsl:template>
<xsl:template name = "GlobalTemplateStateflow" match='/METRICSINFORMATION'>
<xsl:if test="boolean(contains(name(..),'Stateflow'))">
<xsl:variable name="chartNameBB" select="../chartName"/>
<xsl:variable name="chartName"
select="normalize-space($chartNameBB)"/>
</xsl:if>
<xsl:if test="boolean(contains(name,'Stateflow'))">
<xsl:variable name="chartNameBB" select="../../chartName"/>
<xsl:variable name="chartName"
select="normalize-space($chartNameBB)"/>
<xsl:variable name="machineN" select="../../machineName"/>
<xsl:variable name="machineName"
select="normalize-space($machineN)"/>
</xsl:if>
<li><xsl:value-of select="$chartName"/></li>
</xsl:template>
</xsl:stylesheet>
========================================
thanks,
-Nasos
"Dimitre Novatchev" <dn********@yahoo.com> wrote in message
news:bf************@ID-152440.news.uni-berlin.de...
Can't you just put them inline in your message?
=====
Cheers,
Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
"Nasos Makriyiannis" <nm******@mathworks.com> wrote in message
news:bf**********@ginger.mathworks.com... Sure thing. Do you have an e-mail where I can send you the files? I'm having trouble attaching documents to the newsgroup.
I'll provide an explanation in the e-mail also.
regards,
-Nasos
"Dimitre Novatchev" <dn********@yahoo.com> wrote in message
news:bf************@ID-152440.news.uni-berlin.de... Could you, please, provide a complete (but minimal example) -- the
source.xml, your xslt code.
=====
Cheers,
Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
"Nasos Makriyiannis" <nm******@mathworks.com> wrote in message
news:bf**********@ginger.mathworks.com...
> Hi,
>
> I'm new to XSL and I was wondering if there is a string-compare function > available. I am using the following IF statement but it does not
seem to be
> working:
>
> <xsl:if test="boolean(normalize-space(name(..))='Stateflow')">
> ...do something...
> </xsl:if>
> <xsl:if test="boolean(normalize-space(name(..)) != 'Stateflow')">
> ...do another thing...
> </xsl:if>
>
> One of the above two cases should be true but neither of them are
called. I
> displayed the value-of name(..) and it comes out as expected (i.e.
sometimes
> it's 'Stateflow' and other times it's not!).
>
> I also tried using the contain() function: <xsl:if
> test="contains(name(..),'Stateflow') = 'true'"> but that does not
work > either. Again I viewed the value-of contains(name(..),'Stateflow')
and it > does come out as true.
>
> Any ides why the none of the IF statements are run?
>
> thanks,
>
> -Nasos
>
>