Altova Mailing List Archives


RE: [xsl] New to XSLT: problem with passing param

From: Sanjukta Mitra <sanmit27@--------->
To:
Date: 2/3/2005 4:54:00 PM
Thanks Michael. This was very helpful
--- Michael Kay <mike@xxxxxxxxxxxx> 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@xxxxxxxxx] 
> > Sent: 03 February 2005 15:48
> > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> > 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
> > [@answer='yes']][1]"/>
> >         <xsl:param name="Cnt"
> >
>
select="count(ancestor::decisiontree_answer[@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[@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
> 
> 



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

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.