How to use XML engine XQEngine
Hi everybody,
Recently I have been looking for XML search tools, I write applications that require regular search a number of associated XML documents, I was meant to see whether the document with the data I want to match the data, but there are time, I also want to find out the data output. so I carefully look forward to the implementation of various versions of XQL, just found a little tool called XQEngine to solve this problem. I would like to know how to use the XQEngine to XML files in my search for the string us want to find the data. Please suggest. Thanks in advance.
How to use XML engine XQEngine
XQEngine can be found under website, it is a JavaBean, using a SAX parser to index one or more XML documents, and then you can be carried out in these documents searched the compound. It uses a search language is a superset of XQL with similar XPath syntax.Use XQEngine The Java class must implement a result () method, the search is complete, the engine will call this method to search results transmitted result () method. Check and reply.
How to use XML engine XQEngine
I use XQEngine given a routine, now let's analyze. First of all, main () method instantiates a search engine: XmlEngine engine = new XmlEngine (), and then it obtained from the command line file name, format and the search request to return the results of these three parameters, and then use a variety of configuration methods to set the engine , and then call the setSaxParserName () method to set the SAX parser's full name, because we are using the Xerces parser, so use the "org.apache.xerces.parsers.SAXParser". Then we need to set search parameters, then in this case, we will not index numbers, or any words of less than 3 characters. Check this process and reply.
How to use XML engine XQEngine
Use the command-line arguments specify the search parameters you need, for example, if you can specify a file that contains the word stop, they will not be indexed; and if you can ignore the parameters of the command engine that is below the specified number of words the child. XQEngine engine will use three kinds of search results are returned in different formats: STANDARD, SUMMARY, and comma separated values for simplicity sake, I return to the results for each type defines a figure to replace the (1,2,3), and then use the appropriate parameters called setListenerType () method. There is a method printSessionState () is used. Best of luck.
How to use XML engine XQEngine
You need to download the XQEngine and the SAX parser. I have downloaded from the xml.apache.org to the Xerces parser. I use the operating system is Windows 2000 Professional, JDK 1.3 version is good, Set up the CLASSPATH after it, in the "Environment Variables" and modify the CLASSPATH, add the "c: \ xql \ XQEngine.jar; c: \ xql \ antlr.jar; c: \ xerces \ xerces.jar ". Now you can compile the code, but in order to be able to run the program, we also need an XML file, I used the Apache Tomcat inside the web.xml file. Best of luck.