xsl-list
[Top] [All Lists]

[xsl] Re: populate nodelist variable with a variable in select statement

2008-12-02 17:30:41
Hi Michael, David,
Thanks for the suggestions and clarifying my questions.
Will try the extension route.
 
 Thanks

--- On Mon, 12/1/08, Lara Brian <lara_bc(_at_)yahoo(_dot_)com>
wrote:

From: Lara Brian <lara_bc(_at_)yahoo(_dot_)com>
Subject: populate nodelist variable with a variable in
select statement
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Date: Monday, December 1, 2008, 4:45 PM
Hi,
I am trying to populate a variable with a nodelist
that
takes a variable in its select statement.

For example,
<xsl:variable name="myNodeSet"
select="site/assets/asset[(type/@code =
'aaa')
and starts-with(@vpath,'my/path/')  and
(lang='us_en') and $SEARCH_STRING]"/>

and SEARCH_STRING is defined as
<xsl:param
name="SEARCH_STRING"> and (
(related/@code =
'111') or
(related/@code = '222') or (related/@code =
'333') )</xsl:param>

My xml is of the form,
<site>
<assets>
<asset vpath="my/path/and/more">
<lang>eng</lang>
<featured-item>No</featured-item>
<type code="aaa"/>
<related code="111"/>
<related code="777"/>
</asset>
<asset>
  ...
</asset>
</assets>
<site>

Is
this even possible? I can do this using <xsl
choose>
and checking
each condition and setting the variable accordingly,
but in
future if i
have more conditions for the variable, i need to add
more
conditions in
all my xsls. It would be nice if i can set this
variable in
one place
and then use it use it as a replace string.

Thanks for any help or pointers in this regard.




--~------------------------------------------------------------------
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>
--~--

<Prev in Thread] Current Thread [Next in Thread>
  • [xsl] Re: populate nodelist variable with a variable in select statement, Lara Brian <=