• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

xslt/search xml document  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

I am working on xslt/xml/java for the past few weeks.
I have a problem in parsing the xml through xslt.
My task is to design a search engine.
The root structure of xml is "A/B/C/<title> expense card </title>
<title> credit card </title>
<title> expense report </title>
</C></B></A>

Now I am searching for a keyword called "expense" and its displaying the right title that i need. here in this case it displays 1 and 3 titles.
When i search for the keyword called "card" its displaying 1 and 2 titles which is perfect.

Now the problem is when i search for a keyword called "expense card" its displaying nothing. Here in this case i need to display the result titles that has the words involved either "expense" or "card".
Here in this case it should display all the 3 titles since, all the 3 have either expense keyword or card keyword.

How to solve xsl OR condition?

Please reply ASAP.
[ June 20, 2006: Message edited by: Gopal Kumar Chivkula ]
 
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is just a wild idea. (I'm posting while pondering a solution for an XSL problem I'm stuck on so forgive my lack of focus.) If you can somehow tokenize the search criteria splitting it on white space and build a list of string nodes then you might get away with something like this:


The example assumes that you have already defined a template that will turn a space delimited string into an XML fragment such like: <elem>credit</elem><elem>card</elem>
The template would have to be a recursive function of course.
 
Do you pee on your compost? Does this tiny ad?
ScroogeXHTML - small and flexible RTF to HTML converter library
https://coderanch.com/t/710903/ScroogeXHTML-RTF-HTML-XHTML-converter
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!