Adam there's no "dynamic" xpath expression evaluation in XSLT - you'll probably want 
to find some other way to identify the nodes you want to deal with since writing a 
generic xpath evaluator in XSLT is not going to be easy. It would be feasible though 
to parse some standard type of expressions rather than any arbitrary xpath. e.g. if 
you could ensure that all the xpaths were like: "foo[1]/blah[2]" - but this may not be 
feasible since you say you don't know the possible values that your xpath expression 
may have? Where do they come from?

Con

> -----Original Message-----
> From: Adam Flegman [mailto:[EMAIL PROTECTED]
> Sent: Thursday, 24 July 2003 12:18 p.m.
> To: [EMAIL PROTECTED]
> Subject: Re: dynamic node selection
> 
> 
> > Well, if you have your xpath in $targetnode, wouldn't it simply be:
> > 
> > <xsl:apply-templates select="$targetnode"/>    ?
> > 
> > or
> > 
> > <xsl:for-each select="$targetnode">
> >     <xsl:apply-templates/>
> > </xsl:for-each>
> > 
> > To go along with your code.   I haven't done XSLT in a 
> while, so I'm a 
> > little rusty.
> > 
> Hi Tony,
> 
> The value of $targetNode is some arbitrary string value that 
> (hopefully) looks
> like an xml node path. At design time I dont know all the 
> possible values that
> the $targetNode string may have. 
> 
> I have tried to use the <xsl:for-each select="$targetNode"> 
> approach but it
> seems that the 'select' part doesnt like using a string 
> parameter. I get the
> following error report from cocoon:
> 
> ----------------------------------------------------
> Exception in creating Transform Handler 
> 
> More precisely:
> 
> org.apache.cocoon.ProcessingException: Exception in creating 
> Transform Handler:
> java.lang.NullPointerException
> ----------------------------------------------------
> 
> 
> If I could find a way to take the string value of $targetNode 
> and actually
> select the corresponding nodes then I think the problem is solved.
> 
> 
> Ad.
> 
> =====
> Adam Flegman - Senior Software Engineer
> 
> Mobile:     (0414) 375 735
> Phone:     (07) 5547 8530
> Facsimile: (07) 5547 8532
> Email #1: [EMAIL PROTECTED] 
> Email #2: [EMAIL PROTECTED]
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to