R
R
Hello everybody.
I hava a trouble with variables.
Value of my variable depends on count() if count() returns a number
less then 2
my variable ($width) use default value: 2
here is my XSLT code:
<xsl:choose>
<xsl:when test="count(../group[@style='inline']/*) > 2">
<xsl:variable name="width">
<xsl:value-of select="count(../group[@style='inline']/*)"/>
</xsl:variable>
</xsl:when>
<xsltherwise>
<xsl:variable name="width">2</xsl:variable>
</xsltherwise>
</xsl:choose>
and later on:
<tr>
<th colspan="{$width}">....
and when my PHP5 DOM Parser reaches this moment i receive error:
Warning: runtime error: file
/home/xh/workspace/ERS_new/stylesheets/utils/xform.xsl element th in
Warning: unregistered variable width in
if I replace $width with count(...) everything is OK - but I need a
variable
to handle it when for example count() < 2
and by the way - one more question
count(../group[@style='inline']/*) returns number of children of all
group
elements with attribute style.
How can I select ony the maximal count of children of groups elements?
thanks in advance for any help
best regards
R
I hava a trouble with variables.
Value of my variable depends on count() if count() returns a number
less then 2
my variable ($width) use default value: 2
here is my XSLT code:
<xsl:choose>
<xsl:when test="count(../group[@style='inline']/*) > 2">
<xsl:variable name="width">
<xsl:value-of select="count(../group[@style='inline']/*)"/>
</xsl:variable>
</xsl:when>
<xsltherwise>
<xsl:variable name="width">2</xsl:variable>
</xsltherwise>
</xsl:choose>
and later on:
<tr>
<th colspan="{$width}">....
and when my PHP5 DOM Parser reaches this moment i receive error:
Warning: runtime error: file
/home/xh/workspace/ERS_new/stylesheets/utils/xform.xsl element th in
Warning: unregistered variable width in
if I replace $width with count(...) everything is OK - but I need a
variable
to handle it when for example count() < 2
and by the way - one more question
count(../group[@style='inline']/*) returns number of children of all
group
elements with attribute style.
How can I select ony the maximal count of children of groups elements?
thanks in advance for any help
best regards
R