Re: [xsl] xsl:variable and node list

Subject: Re: [xsl] xsl:variable and node list
From: "Luke Ambrogio" <luke.ambrogio@xxxxxxxxxxxx>
Date: Wed, 15 Oct 2003 10:11:28 +0200
ok guys that was amazing thanks a lot, hope fully one last thing

i need to do a search (as u might have realized) on the name and address and
other fields.
Im firstly storing the result on each field seperately in a variable then i
need need to combine them again into one sorted node-list and display them

i've got

<xsl:for-each select="$withname">
  <xsl:if test="position() &lt;= $recordsPerPage * number($pageNumber) and
position() &gt;= $recordsPerPage * number(($pageNumber)-1)">
    <xsl:apply-templates select="."/>
  </xsl:if>
</xsl:for-each>
<xsl:for-each select="$withaddress">
  <xsl:if test="position() &lt;= $recordsPerPage * number($pageNumber) and
position() &gt;= $recordsPerPage * number(($pageNumber)-1)">
    <xsl:apply-templates select="."/>
  </xsl:if>
</xsl:for-each>
...

how can i combine them into one, always keeping them sorted?

thanks

----- Original Message ----- 
From: "Anton Triest" <anton@xxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Friday, October 15, 2004 9:55 AM
Subject: Re: [xsl] xsl:variable and node list


> Jarno.Elovirta@xxxxxxxxx wrote:
>
> >But, if you just want a set, then
> >
> >  <xsl:copy-of
select="tblMIMCompanies[contains(translate(@building,$upperCase,$lowerCase),
translate($address,$upperCase,$lowerCase))
> >                                   and
contains(translate(@number,$upperCase,$lowerCase),translate($address,$upperC
ase,$lowerCase))
> >                                   and
contains(translate(@street,$upperCase,$lowerCase),translate($address,$upperC
ase,$lowerCase))
> >                                   and
contains(translate(@town,$upperCase,$lowerCase),translate($address,$upperCas
e,$lowerCase))
> >                                   and
contains(translate(@postcode,$upperCase,$lowerCase),translate($address,$uppe
rCase,$lowerCase))
> >                                   and
contains(translate(@country,$upperCase,$lowerCase),translate($address,$upper
Case,$lowerCase))
> >                                   and
contains(translate(@address,$upperCase,$lowerCase),translate($address,$upper
Case,$lowerCase))]"/>
> >
> >
> Jarno,
> shouldn't that be 'or' instead of 'and'?
>
> Also, if you can be sure there are no other attributes that might
> contain $address, you can do this:
>
> <xsl:variable name="withaddress"
>
select="tblMIMCompanies[contains(translate(@*,$upperCase,$lowerCase),transla
te($address,$upperCase,$lowerCase))]"/>
>
> (that would include all elements where *any* attribute contains $address)
>
> Anton

Current Thread