Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

select another node in contains statement.

0 views
Skip to first unread message

zonghua

unread,
Mar 7, 2008, 4:55:12 AM3/7/08
to
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 ----------------------------

Martin Honnen

unread,
Mar 7, 2008, 7:55:49 AM3/7/08
to
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/

0 new messages