Subject: RE: [xsl] preceding-sibling question and node set as param to tem plate From: TSchutzerWeissmann@xxxxxxxxxxxxxxxx Date: Wed, 11 Dec 2002 14:05:26 -0000 |
Hi Matt 1) nearly. > count(preceding-sibling::node()/@ss:Index/preceding-sibling::node()) you're asking for the preceding sibling of an attribute... Make the test for the attribute part of how you select the first node, and just select the first... count(preceding-sibling::node()[@ss:Index][1]/preceding-sibling::node()) 2) yes. Don't use copy-of, just use select. <xsl:with-param name="pp" select="preceding-sibling::node()"/> have fun Tom SW > -----Original Message----- > From: Matts Isuls [mailto:matts.isuls@xxxxxxxxxxx] > Sent: 11 December 2002 13:54 > To: 'XSL-List@xxxxxxxxxxxxxxxxxxxxxx' > Subject: [xsl] preceding-sibling question and node set as param to > template > > > Hi list > > > Working with MS-Excel XML files and has run into something i > can't resolve > on my own. > > q1:: > > What i would like to do is this: > > Get first preceding-sibling of current node that has the > ss:Index attrib > set. Then count the 'ss:Index' node's preceding-siblings. I hope you > understand what i mean. > > count(preceding-sibling::node()/@ss:Index/preceding-sibling::node()) > but it doesn't work. result = 0 > > > q2:: > > Is it possible to send a node set to a template as param? > Something like > this below? > > <xsl:template match="/"> > ... > ... > <xsl:for-each select="ss:Cell"> > <xsl:call-template name="testlate"> > <xsl:with-param name="pp"><xsl:copy-of > select="preceding-sibling::node()"/></xsl:with-param> > </xsl:call-template> > </xsl:for-each> > ... > ... > </xsl:template> > > > <xsl:template name="testlate"> > <xsl:param name="pp"/> > <!-- do this and that --> > <xsl:value-of select="count($pp)"/> > </xsl:template> > > > Matts Isuls > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] preceding-sibling questio, David Carlisle | Thread | [xsl] Allow document(...) use in fr, Jerome Louvel |
[xsl] preceding-sibling question an, Matts Isuls | Date | Re: [xsl] preceding-sibling questio, David Carlisle |
Month |