Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xml

Status
Not open for further replies.

spara

Programmer
Jul 4, 2001
2
TW
Iam writing a search with XML and ASP means instead of using a database I stored the data in an xml file and trying to search it with XSL . for that i need to find a string lies in the description or not . instring like function I need
could any one help me?
for example

<row>
<lk>one<lk>
<desc>This is a test</desc>
</row>


if I search for &quot;test&quot; I should diplay the desc whole content

now iam success to the extent that if i search for the whole &quot;This is a test&quot; Iam getting.


is it boring?
 
Hello,
XSL has a function contains(firstarg, secondarg) which returns True if the first argument string contains the second argument string; otherwise returns False.

For example
<xsl:value-of select=&quot;//desc[contains(., 'test')]&quot;/>
will print the text of desc tag, only if it contains string test.
. is shortcut to current node. It could be
<xsl:value-of select=&quot;//desc[contains(//desc, 'test')]&quot;/>

You have to figure out how to do in your case, because I suppose that 'test' value will come from a input box in a form.
Hope this helps.
D
 
hi,

Thank U dianal for the Nice Reply, iam still doing R&D to implement this in my application.


Actually iam using freethrededdom instead of xmldom, because my browser is not supporting it.
so for that iam getting only single matches with method selectSingleNode
is there any otherway to select more matches with
it

where can i refer all the metjodsof FreeThreadedXMLDOM

thank u once again

spara

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top