Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
XML
data.xmlanalysis
mappoint.webservice
msf
msxml-webrelease
netmyservices.sdk
passport.sdk
soap
soapsdk
uddi.general
uddi.programming
uddi.specification
xml
xmlsqlwebrelease
xsl
  
 
date: Fri, 7 Mar 2008 17:55:12 +0800,    group: microsoft.public.xsl        back       


select another node in contains statement.   
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 ----------------------------
date: Fri, 7 Mar 2008 17:55:12 +0800   author:   zonghua

Re: select another node in contains statement.   
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
	http://JavaScript.FAQTs.com/
date: Fri, 07 Mar 2008 13:55:49 +0100   author:   Martin Honnen

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us