Groups > Design > Microsoft xsl > select another node in contains statement.




Re: select another node in contains statement.

Re: select another node in contains statement.
Fri, 07 Mar 2008 13:55:49 +010
zonghua wrote:
> Dear sir, I have below XML file, I am using "contains" to search
XML 
> file. besides a keyword search, I also need an exact match on one 
> special column.
> 
> I have below XSLT which I am using "Content/agenda/startdatum" to
search 
> this special column data. However it does not work out. mine:comparedate 
> is Script function which works fine.
> 
> Any one can point out what went wrong below XSLT?

"it does not work out" does not tell us exactly what goes wrong. Do
you 
get an error when trying to execute the stylesheet? Don't you get the 
result you want?
Please provide details of the XSLT processor you use and a minimal but 
complete XML input and XSLT stylesheet so that we know in which context 
the xsl:apply-templates is being exectuted and which value the variables 
$Keyword and $StartDate have.


-- 

	Martin Honnen --- MVP XML
Post Reply
select another node in contains statement.
Fri, 7 Mar 2008 17:55:12 +0800
Dear sir, I have below XML file, I am using "contains" to search XML
file. 
besides a keyword search, I also need an exact match on one special column.

I have below XSLT which I am using "Content/agenda/startdatum" to
search 
this special column data. However it does not work out. mine:comparedate is 
Script function which works fine.

Any one can point out what went wrong below XSLT?

Thanks in advanced.

-----------------------XSLT--------------------------------
    <xsl:apply-templates mode="search" 
select="Items/Item/Data[contains(translate(.,$UC,$lc), $Keyword)  and 
mine:comparedate(string(Content/agenda/startdatum),
string($StartDate))]">
    </xsl:apply-templates>
--------------------end XSLT -----------------------------

-------------------XML file -----------------------------
<Items>
  <Item>
    <Data>
      <Type>Normal</Type>
      <Content>
        <agenda>
         <titel>agenda 44444</titel>
          <startdatum>2008-03-07T09:55:00</startdatum>
          <aanvangstijd>gfdgfdg</aanvangstijd>
          <locatie>gfdgfdgdf</locatie>
        </agenda>
      </Content>
      <Metadata>
        <Metadata>
          <doelgroep>meta3</doelgroep>
        </Metadata>
      </Metadata>
    </Data>
  </Item>
......
</Items>
---------------- end XML ----------------------------  
Post Reply
about | contact