• Post Reply Bookmark Topic Watch Topic
  • New Topic

Searching XML Documents  RSS feed

 
Daniel Walker
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there everyone...
I am attempting to write a simple servlet which will allow me to query an XML document and return those records which meet my search criteria. For example, using the following XML file...

...I would like to return all "CCI_RECORD" elements (and, of course, their child elements) where, (as an example) "<OWNER>==hc00dw1". Am I correct in thinking that I can use an XSLT to acomplish this, or do I need to programatically extract the information in my servlet and then transform it? (I would much prefer to do it this way anyway).
I had assumed that this is a very common task to perform on XML documents, but my searching has just left me more confused than ever! I am using the JDOM API and Java 2 v1.3
Many thanks in advance for any and all responses.

------------------
daniel.walker
***i fear that i am ordinary...
...just like everyone...***

[This message has been edited by Daniel Walker (edited August 23, 2001).]
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are correct! Take a dive into XSL this makes it easy ;-)
I would advise to use Xalan and not JDom as it has a better (IMHO) xslt engine.
 
Sham Jowsaki
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, have a look on the below url to fulfilled your requirement with sample coding.
http://www.javaranch.com/ubb/Forum31/HTML/000057.html
 
Daniel Walker
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks very much for the help.

------------------
daniel.walker
***i fear that i am ordinary...
...just like everyone...***
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!