xsl-list
[Top] [All Lists]

RE: New to XSLT: problem with passing param

2005-02-03 09:53:15
Thanks Michael. This was very helpful
--- Michael Kay <mike(_at_)saxonica(_dot_)com> wrote:

In the expression


count(ancestor::decisiontree_question=$stop_question)

the argument to count() is a boolean, not a
node-set.

Perhaps you meant


count(ancestor::decisiontree_question[.=$stop_question])

or perhaps not, since ancestor elements don't
usually have a useful string
value.

Michael Kay
http://www.saxonica.com/ 

-----Original Message-----
From: Sanjukta Mitra [mailto:sanmit27(_at_)yahoo(_dot_)com] 
Sent: 03 February 2005 15:48
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] New to XSLT: problem with passing
param

Hi,

I am fairly new to XSLT and am trying to write a
stylesheet that will convert an XML decision tree
to a
flowchart in SVG. This is a binomial decisiontree
and
I am facing the problem of overlapping nodes.To
solve
this I am trying to use a parameter that
calculates
some positions in one template and passes it on to
another template.Can anyone please help me figure
out
what I am doing wrong here.

Thanks
Sanjukta

I am getting the following error:

Error at xsl:param on line 211 of
file:/C:/REDworks/src/xslt/red2svg_testtree.xsl:

           The value is not a node-set

         Transformation failed: Run-time errors
were
reported

 Line 211 is the line where I am defining the
parameter "Cnt"


Here goes the relevant portion of the code:




<xsl:template match="enumerated_type_ptr">
        <xsl:param name="XT"/>
        <xsl:param name="YT"/>
        <xsl:param name="XTxt"/>
        <xsl:param name="YTxt"/>
        <xsl:param name="rx" select="22"/>
        <xsl:param name="width" select="75"/>
        <xsl:param name="height" select="40"/>
        <xsl:param name="subtype"
select="id(@ptr)/title/@titleabbrev"/>
        <xsl:param name="subtype_length"
select="string-length($subtype)"/>
        <xsl:param name="stop_question"


select="ancestor::decisiontree_question[../decisiontree_answer
[(_at_)answer='yes']][1]"/>
        <xsl:param name="Cnt"


select="count(ancestor::decisiontree_answer[(_at_)answer='no'][coun
t(ancestor::decisiontree_question=$stop_question)
&gt;0])"/>
        <xsl:param name="Ctr" select="($Cnt)-1"/>
        <xsl:param name="X1"
select="($XT)-80-($Ctr)*140"/>
        <xsl:param name="Y1" select="($YT)-78"/>
        <xsl:param name="Variable_width"
select="($XT)+10"/>
        
      <svg:rect..../>
..................
      <svg:text..../>
        
        <xsl:apply-templates
select="./decisiontree_answer[(_at_)answer='no']"
mode="No">
                <xsl:with-param name="X1"
select="($XT)-80-($Ctr)*140"/>
                <xsl:with-param name="Y1"
select="($YT)-78"/>
                <xsl:with-param name="Variable_width"
select="($XT)+10"/>
        </xsl:apply-templates>
        
        
    </xsl:template>





            
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Find what you need with new enhanced
search.
http://info.mail.yahoo.com/mail_250



--~------------------------------------------------------------------
XSL-List info and archive: 
http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to:
http://lists.mulberrytech.com/xsl-list/
or e-mail:
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




--~------------------------------------------------------------------
XSL-List info and archive: 
http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to:
http://lists.mulberrytech.com/xsl-list/
or e-mail:
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





                
__________________________________ 
Do you Yahoo!? 
Read only the mail you want - Yahoo! Mail SpamGuard. 
http://promotions.yahoo.com/new_mail 

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--