Searching XML file

Hi All,
I have xml file where in i am parsing(using jaxb) it and showing it as html table using(af:iterator).
Using XSD i have generated all the classes with jaxb
my xmlfile:
<?xml version="1.0" encoding="UTF-8" ?>
<dvm name="ACCTTYPE" xmlns="http://xmlns.oracle.com/dvm">
<description/>
<columns>
<column name="Id"/>
<column name="COMMON"/>          
</columns>
<rows>
<row>
<cell>Amarnath</cell>
<cell>2</cell>
</row>
     <row>
<cell>chari</cell>
<cell>2</cell>
</row>
     <row>
<cell>jagan</cell>
<cell>2</cell>
</row>     
</rows>
</dvm>
my Table:
Id          COMMON     
Amarnath 2
chari     2
jagan 2
Is their any way where i can show only rows which has certain string specified by the user.like is user specifies "jagan".i need to show only one row which has jagan
i am using jdeveloper 11.1.1.5
Thanks in advance

the logic for that should be done in the UI.. if you u group the htlp components using the adf component - af:panelgrouplayout.. you can set the visibility based on the string entered.. initially you will parse all the xml.. and then you willl show only one row which matches the criteria.
if you want only to fiter the name and have xml generated only for that then you will have to change the parsing logic to include this filter. to retrieve the specific rows..

Similar Messages

  • How to search xml file data based on the given keyword from html form

    hi,
    i'm new to XML. I have this problem regarding searching within a XML file.
    the
    idea is that my search will be based on the keyword entered
    in
    by the user from a HTML form. the keyword is then used to search all
    the
    question nodes and the choice nodes within a XML file. once the match
    is
    found, i will have to display the results.
    But i don't know how to do so - especially the part of searching xml file.
    Can
    anyone help me in this? Your help is much appreciated.
    Edited by: Moti_Lal.D on Apr 4, 2008 7:28 AM

    yeah.. what i was trying to do is
    i have one xml fine. then i have to read all the tag values say
    <book>
    <title>Java</title>
    <author>agarwal</author>
    <price>200</price>
    </book>
    <book>
    <title>Xml</title>
    <author>saxmann</author>
    <price>300</price>
    </book>
    i can read the tag values like this
    File file = new File("dom.xml");
    try {
    DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
    Document doc = builder.parse(file);
    NodeList nodes = doc.getElementsByTagName"book");
    for (int i = 0; i < nodes.getLength(); i++) {
    Element element = (Element) nodes.item(i);
    NodeList title = element.getElementsByTagName("title");
    Element line = (Element) title.item(0);
    what i want is i may give any xml file
    like File file = new File("xxx.xml");
    (it may be one level/two level/3level tagged one)
    then the i should read all the tag values and store them in some array. Then when i enter some character from keyboard (say "a") then it has to show all the tag values starts with "a" and display them.
    i guess u understand my problem.

  • How to search XML file for specific attributes ...

    Hi, Im trying to design a XML driven billboard. Is there an easy way to seach attributes of all elements using DOM parser and return the element with attribute that matched search criteria?

    Yes. Are you using jsdk1.4? If true then look at the XPathAPI.
    I wrote a package for working with XML vocabularies. If you are interested on it, here is an example that uses amic-util.jar to find nodes with the id-user attribute:
    XmlReader xr = new XmlReader("vocabulary.xml");
    NodeSet ns = new XPathFinder(xr).findNodes("*[@id-user]");
    while(ns.hasNextNode()) {
      XmlReader node = ns.nextNode();
    }Send me an e-mail and I will send you back the amic-util.jar and the javadocs.

  • Search in XML files

    Hi,
    We have an requirement where our SharePoint intranet site needs to search content in XML files and display the result. The XML file has different attributes associated content nodes and search should allow faceted search using these attributes. The
    XML structure would be as follows
    <contents>
    <content version="" language="" region="" country="" attributeN="" attributeM="">content goes here</content>
    <content version="" language="" region="" country="" attributeN="" attributeM="">content goes here</content>
    <content version="" language="" region="" country="" attributeN="" attributeM="">content goes here</content>
    </contents>
    I would like to know what is best option available to search XML files in SharePoint. These are option that I can think of
    Store the XML files in SharePoint document library or in a shared folder. Write a custom Search Indexing Connector using
    SharePoint Search Connector framework to crawl and index the XML files.
    Parse and store the XML files in SharePoint list and allows SharePoint search engine to crawl and index the SharePoint list content.
    Parse and store the XML files in a custom database (e.g. SQL Database), and use BCS (Business Connectivity Service) external content type feature to crawl and index the content.
    Parse and store the XML files in a custom database (e.g. SQL Database), and use the SQL query and a business layer component to fetch the content from database. And use the custom web part to fetch and display the content. Note, there is no SharePoint
    search feature is used for this approach.
    Thanks,
    Pat

    Hi Patni,
    Thanks for posting your query here, I would suggest you option 2. I have implementation the same thing in one of my solution so its more proven Technic.
    Let me tell you the implementation part of it.
    1. Save your XML files in in SQL Server DATABASE .
    2. Create a WCF or Windows Server to fetch the XML files and segregate the Metadata based on your XML attributes
    3. Use implementation WCF in Custom .NET BCS or SharePoint Designer BCS to get the Data in SharePoint.
    4. Now, you can configure your BCS for crawling in SharePoint Search application.
    5. Check out the Crawl log for verify the Data
    Also, you can test the Search result using Mossman tool that is freely available on below mentioned URL 
    http://fastforsharepoint.codeplex.com/
    I hope this is helpful to you. If this works, Please mark it as Answered. 
    Regards, 
    Dharmendra Singh (MCPD-EA | MCTS) 
    Blog :
    http://sharepoint-community.net/profile/DharmendraSingh

  • Retrieve / Search specific Node from XML File

    Hello,
    i have a question about reading (searching) XML File within PL SQL:
    There is a XML file with following structure:
    <root>
      <Hnode1 attr1="value1" />
      <Hnode2 attr1="value1" />
         <node1_of_Hnode2 id="10" personname="Steven"/>
         <node2_of_Hnode2 id="20" personname="Christian"/>
         <node3_of_Hnode2 id="30" personname="Arnold"/>
      <Hnode2/>
    <root/>How it is possible to filter a node by one of its attribute value. For example:
    I know the id of a person - lets say id =20. In this case i would like to get the whole node (in this case node2_of_Hnode2) to get the personname => "Christian".
    Just like a SELECT statement (WHERE ID = 20)
    Is there a possibility the get this by one command or should it be looped over all Rows of the Document?. Can you please provide an example for me.
    Thank you in advice!

    Database version is 10.Sorry, that's not a version.
    For example :
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
    PL/SQL Release 10.2.0.5.0 - Production
    CORE     10.2.0.5.0     Production
    TNS for 64-bit Windows: Version 10.2.0.5.0 - Production
    NLSRTL Version 10.2.0.5.0 - Production
    How to use the extraction of values?
    1.Better in Select statement; assigning directli in a variable or using xmlquery function?.PL/SQL or SQL calls to XMLType methods such as extract() or getStringVal() should be equivalent (putting aside the context switch).
    However, none of them is the correct way to retrieve a scalar value from a given node.
    You must use extractValue() function instead (SQL only) for release < 11.2 and XMLCast/XMLQuery starting with 11.2.
    One more Question:
    I have seen a lot of options to handle with XML Files.
    So in my case only querying data in XML Files is relevant.
    I have seen many APIs called XMLDOM, DMBS_XMLDOM, XMLTYPE...
    When to use these APIS. Can you give me some input on that please?That's a broad topic.
    A relevant answer will depend on your requirement.
    - Do you have to process large files, and if so how large?
    - Is performance/memory management a concern for you?
    - Do you want to extract single values, or process the XML content as relational data?
    If you have any specific test case to show us, please post in the {forum:id=34} forum, and make sure you include all the necessary details (see the FAQ).
    Edited by: odie_63 on 23 févr. 2012 11:35

  • Using JScript to search an XML File

    I have an XML file that has three fields in each section like the following:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <CapabilityData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <capability>
            <oem>A.I.D</oem>
            <PartNumber>1426-5A-A1</PartNumber>
            <Nomenclature>AIRSPEED</Nomenclature>
        </capability>
        <capability>
            <oem>A.I.D</oem>
            <PartNumber>1426-5A-B1</PartNumber>
            <Nomenclature>AIRSPEED</Nomenclature>
        </capability>
    </CapabilityData>
    and what i want to do is search the xml file to find if a part number exists.  All this has to do is return a Yes or No response...
    The problem I am experiencing is that i can get the script to read the xml and display it on the screen but once i try to add in code to actually do a search it goes all haywire... i don't know if i'm jsut doing something stupid or if i'm doing it all incorrectly.
    Please be gentle, this is my first time...
    ~~~~
    <html>
    <body>
    <h1>OEM Search 2</h1>
    <button onclick="myTestFunction()">Try it</button>
    <script>
    function myTestFunction()
        var sPNSearchFor = "18B331";
        if (window.XMLHttpRequest)
          {// code for IE7+, Firefox, Chrome, Opera, Safari
          xmlhttp=new XMLHttpRequest();
        else
          {// code for IE6, IE5
          xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
        xmlhttp.open("GET","capability.xml",false);
        xmlhttp.send();
        xmlDoc=xmlhttp.responseXML;
        document.write("<table border='1'>");
        var x=xmlDoc.getElementsByTagName("capability");
        for (i=0;i<x.length;i++)
          document.write("<tr><td>");
          var sOEM=xmlDoc.getElementsByTagName("oem")[i].childNodes[0].nodeValue;
            document.write(sOEM);
            document.write("</td><td>");
          var sPN=xmlDoc.getElementsByTagName("PartNumber")[i].childNodes[0].nodeValue;
            document.write(sPN);
            document.write("</td><td>");
          var sNom=xmlDoc.getElementsByTagName("Nomenclature")[i].childNodes[0].nodeValue;
            document.write(sNom);
            document.write("</td><td>");
            document.write(sPNSearchFor);
            document.write("</td><td>");
        document.write("</table>");
    </script>
    </body>
    </html>

    Hi Tom,
    Please post your question in this forum, you could get more helpful answers there:
    ASP.NET Forums >
    General ASP.NET >
    HTML, CSS and JavaScript
    Thanks for your understanding.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Searching an XML file and using getNextSibling()

    I apologise if this question has been answered before, but I haven't been able to find a precise answer to my problem.
    Here is a snippet of my XML file:
    <organization...>
    <title>
    <item...>
    <title>
    <adlcp:prerequisites>
    What I want to do is search this file based on item title (org->item->title). When I find the corresponding entry, I want to traverse back up the tree to retrieve an attribute of the <item> tag, the <title> belonging to the organisation, and I also want to record the sibling node <adlcp:prerequisites>.
    I have no trouble obtaining traversing up the tree from the item <title>, but as soon as I try calling getFirstChild() or getNextSibling(), my method throws an exception.
    Here is an excerpt of my (somewhat shoddy) code:
    try
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    DocumentBuilder db = dbf.newDocumentBuilder();
         docScorm = db.parse(strScorm);
         Element root = docScorm.getDocumentElement();
         NodeList children = root.getChildNodes();
         int n = children.getLength();
         String strTopicName = "";
         int i = 0 ;
         Node genericNode = null ;
         Node topicNode = null ;
         while(i < n)
              NodeList topicList = docScorm.getElementsByTagName("title");
              genericNode = topicList.item(i);
              strTopicName = genericNode.getFirstChild().getNodeValue();
              if (strTopicName.equals(strTopic))
                   topicNode = topicList.item(i) ;
              i++ ;
         //Save the information in the ScormInfo object.
         siItem.setTitle(strTopicName) ;
         //We have the topic name - get the other info.
         if (topicNode != null)
              Node itemNode = topicNode.getParentNode() ;
              NamedNodeMap nnmItemAtt = itemNode.getAttributes() ;
              Node itemIdentifierNode = nnmItemAtt.getNamedItem("identifier") ;
              //Fill in the ScormInfo object details.
              siItem.setIdentifier(itemIdentifierNode.getFirstChild().getNodeValue()) ;
    //I'd given up getting the organisation title, and settled for the identifier attribute instead.
    Node orgNode = itemNode.getParentNode() ;
              NamedNodeMap nnmOrgAtt = orgNode.getAttributes() ;
              Node orgTitleNode = nnmOrgAtt.getNamedItem("identifier") ;
              siItem.setOrganisation(orgTitleNode.getFirstChild().getNodeValue()) ;
              //Try to get the sibling.
              Node preReqNode = topicNode.getNextSibling() ;
    ====================================
    And this is the point where it all goes wrong. Can anyone shed some light on what I am doing wrong? Any help would be greatly appreciated.

    After a little more debugging, I discovered that you are correct - trying to access the Node is throwing a NullPointerException, and admittedly, I was not accounting for that.
    However, while I can easily take care of a NullPointerException, I am still bewildered as to why the getNextSibling function returns null in the first place. A quick snippet of the file in question shows:
    <organisation...>
    __<item identifier="ITEM-4E83F4CA-B846-67E5-48F1-C58732D13615" isvisible="true" identifierref="RES-74A66825-6926-3C1E-5D19-489856C9C280">
    ____<title>Topic_2_parallel_and_serial</title>
    ____<adlcp:prerequisites type="aicc_script">ITEM-5BE1806E-C38C-89A9-F2FC-BB51109259E3</adlcp:prerequisites>
    __</item>
    ====================================
    Considering my Node "topicNode" points to the "<title>Topic_2_parallel_and_serial</title> node, I am confused as to why getNextSibling does not return the <adlcp...> node. Is it not the next direct sibling?

  • How to search and replace in an xml file using java

    Hi all,
    I am new to java and Xml Programming.
    I have to search and replace a value Suresh with some other name in the below xml file.
    Any help of code in java it is of great help,and its very urgent.
    I am using java swings for generating two text boxes and a button but i am not able to search in the xml file thru the values that are entered into these text boxes.
    Thanks in advance.
    **XML File*
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <student>
    <stud_name>Suresh</stud_name>
    <stud_age>40</stud_age>
    </student>Also i am using SAX Parser in the java program
    any help of code or any tutorials for sax parisng is very urgent please help me to resolve this problem
    Edited by: Karthik84 on Aug 19, 2008 1:45 AM
    Edited by: Karthik84 on Aug 19, 2008 3:15 AM

    Using XPath to locate the elements you are after is very easy.
    Try something like this:
    import java.io.File;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import javax.xml.xpath.XPath;
    import javax.xml.xpath.XPathConstants;
    import javax.xml.xpath.XPathFactory;
    import org.w3c.dom.Document;
    import org.w3c.dom.NodeList;
    import org.xml.sax.InputSource;
    public class BasicXMLReplaceWithDOM4J {
         static String inputFile = "C:/student.xml";
         static String outputFile = "C:/studentRenamed.xml";
         public static void main(String[] args) throws Exception {
              // Read xml and build a DOM document
              Document doc = DocumentBuilderFactory.newInstance()
                        .newDocumentBuilder().parse(new InputSource(inputFile));
              // Use XPath to find all nodes where student is named 'Suresh'
              XPath xpath = XPathFactory.newInstance().newXPath();
              NodeList nodes = (NodeList)xpath
                   .evaluate("//stud_name[text()='Suresh']", doc, XPathConstants.NODESET);
              // Rename these nodes
              for (int idx = 0; idx < nodes.getLength(); idx++) {
                   nodes.item(idx).setTextContent("Suresh-Renamed");
              // Write the DOM document to the file
              Transformer xformer = TransformerFactory.newInstance().newTransformer();
              xformer.transform(new DOMSource(doc), new StreamResult(new File(outputFile)));
    }- Roy

  • Is it possible to search for keywords in an XML file?

    Hey all,
    I'm currently searching for ways to count the number of pre-defined keywords in an XML file. An example would be trying to find how many times "war" is mentioned in a news networks RSS feed <title></title> and adding it to a variable.
    I've found a few custom AS3 XML class files out there but nothing I've been able to adapt. I'm at the point of considering just taking the title of these news stories converting them all to strings and searching them that way...
    I'd be grateful for any help
    Thanks!

    An XML element can have multiple attributes such as:
    <title keyword="war" category="international">War Breaks Out in the Middle East!</title>
    In the above example, the XML element <title> has 2 attributes named keyword and category.
    So in my example I'm searching for the attribute named "keywords" within the element <newsItem>.
    The XML document could be formatted something as the following:
    ============
    <someNewsFeed>
         <items>
              <newsItem keyword="war" category="international" url="www.cnn.com/headline2010020111">War Breaks Out in the Middle East!</newsItem>
              <newsItem keyword="healthcare" category="politics" url="www.cnn.com/headline2010020321">Healthcare Bill Still Has Some Hurdles to Jump</newsItem>
              <newsItem keyword="lady gaga" category="entertainment" url="www.cnn.com/headline2010020981">Lady Gaga Has 360 Reach</newsItem>
         </items>
    </someNewsFeed>
    ===========
    So in my example, the if/else loop is looking through each XML node named <newsItem> and when it finds it, it then see if it has an attribute called "keyword" and if it does, it then looks to see if it contains the word "war". If it DOES, then it will do the proceeding actions.
    ===========
    if (newsFeed.items.newsItem[q].attribute("keyword") == "war") {
              warKeywordCounter == warKeywordCounter+1; //increase your keyword counter
              trace("Current value of warKeywordCounter = "+ warKeywordCounter);
    ==========
    I'm assuming you already know how to load external XML documents into flash.
    I hope this helps.
    Message was edited by: dchaparro
    Corrected if/else code to include right parentheses.

  • Efficient searching in a large XML file for specific elements

    Hi
    How can I search in a large XML file for a specific element efficiently (fast and memory savvy?) I have a large (approximately 32MB with about 140,000 main elements) XML file and I have to search through it for specific elements. What stable and production-ready open source tools are available for such tasks? I think PDOM is a solution but I can't find any well-known and stable implementations on the web.
    Thanks in advance,
    Behrang Saeedzadeh.

    The problem with DOM parsers is that the whole document needs to be parsed!
    So with large documents this uses up a lot of memory.
    I suggest you look at sometthing like a pull parser (Piccolo or MPX1) which is a fast parser that is program driven and not event driven like SAX. This has the advantage of not needing to remember your state between events.
    I have used Piccolo to extract events from large xml based log files.
    Carl.

  • Xml files in search results

    Hi Experts,
    When i search for string in EP 7.0 it shows all the links related to the search string. In the result i also found some xml files (which are related new items). when i click on this xml file it is showing xml code.
    Is it possible to open xml file with actual cotnent in the IE. I do not want to see the xml code in the browser.
    Thanks,
    Satyadev

    Hello Satyadev,
    I suppose by "XML-File", you mean "Files generated using the XML Forms Editor"? Otherwise you cannot expect magic rendering of contents ...
    If it is XML Forms, a Repository Filter renders the output that go/km/docs delivers, so if your Filter is configured correctly, all should work.
    Since that is not the case, go check if the repository containing you xml files is listed in the "xmlforms_filter" under SysAdm->SysConf->KM->CM->RepositoryFilter->XML Forms Repository Filter
    Jan

  • ITunes xml file search/ access {on user's computer} ~ step 1

    Building a RichMediaAnnotaion (RMA) JukeBox.
    This will be hosted in a PDF.
    Tools: Flash CS5.5 & Acrobat X Pro
    The Juke Box will read the User's iTunes Library.xml file
    (once JavaScript affirms it is present, i.e. User uses iTunes).
    Of many steps, I am researching a JavaScript to locate (gain access) to
    said iTunes Library.xml files (both PC / MAC).
    In this file-search objective the four (4) locations are known; iTunes Library.xml (see below).
    Thanks in advance for your help...
    This is Step 1... the current goal;
    How to construct a full script to address all known locations (4).
    1) enable search when PDF page is entered
    2) search for the appropriate iTunes Library.xml file
    3) if found pass path to "JukeBox" script (in development, future Step)
    4) else... stop
    iTunes Library.xml locations;
    Mac OS X:     /Users/username/Music/iTunes/iTunes Library.xml
    Windows XP     \Documents and Settings\username\My Documents\My Music\iTunes\iTunes Library.xml
    Windows Vista     \Users\username\Music\iTunes\iTunes Library.xml
    Windows 7     \Users\username\Music\iTunes\iTunes Library.xml
    That is the current task at hand......
    Thanks for your feedback!
    ~ ~
    As a reference, further researching Steps are noted below:
    display Artist list
              drill down to said Artist songs
    Display Album Artwork / when available, else JukeBox images.png(s)
    Play music
    Any an All insight is greatly appreciated.
    D~

    JavaScript embedded in a PDF cannot read arbitrary files from a local hard drive, neither can a SWF.

  • What is the best cheap/free search and replace software for .xml files?

    Transferring my iTunes library from PC to Mac I have reached the stage where I want to edit the .xml file from PC file paths to Mac ones - which would be the best preferrably free software to do this on?

    Perhaps my comment in your other thread will help.
    tt2
    PS I don't know about the Mac, but Notepad++ will probably do your search & replace on the PC if you have to edit the XML.
    Message was edited by: turingtest2

  • Searching for BLOB xml file content

    Hi Gurus,
    I am having a table with a blob type column which is holding xml files. Is there a way to select records of the table based on specific words contained in the xml?
    Many Thanks,
    Napster

    rp0428 wrote:
    But if OP really wants to search the 'content' of the xml elements I don't see that working for them.
    Sure, he can.  All you have to do is add auto_section_group to the index parameters, then you can search within any of the specific tags, as demonstrated below.
    SCOTT@orcl12c> CREATE TABLE a_table
      2    (id          NUMBER,
      3      blob_type_column  BLOB)
      4  /
    Table created.
    SCOTT@orcl12c> INSERT INTO a_table VALUES (1,
      2  UTL_RAW.CAST_TO_RAW (
      3  '<a><b>something different</b><c>whatever you are looking for</c></a>'))
      4  /
    1 row created.
    SCOTT@orcl12c> INSERT INTO a_table VALUES (2,
      2  UTL_RAW.CAST_TO_RAW (
      3  '<a><b>something else</b><c>something different</c></a>'))
      4  /
    1 row created.
    SCOTT@orcl12c> CREATE INDEX test_index ON a_table (blob_type_column)
      2  INDEXTYPE IS CTXSYS.CONTEXT
      3  PARAMETERS ('SECTION GROUP CTXSYS.AUTO_SECTION_GROUP')
      4  /
    Index created.
    SCOTT@orcl12c> SELECT id, UTL_RAW.CAST_TO_VARCHAR2 (blob_type_column)
      2  FROM   a_table
      3  WHERE  CONTAINS
      4            (blob_type_column,
      5             '(whatever AND looking) WITHIN c') > 0
      6  /
            ID
    UTL_RAW.CAST_TO_VARCHAR2(BLOB_TYPE_COLUMN)
             1
    <a><b>something different</b><c>whatever you are looking for</c></a>
    1 row selected.
    SCOTT@orcl12c> SELECT id, UTL_RAW.CAST_TO_VARCHAR2 (blob_type_column)
      2  FROM   a_table
      3  WHERE  CONTAINS
      4            (blob_type_column,
      5             '(something different) WITHIN b') > 0
      6  /
            ID
    UTL_RAW.CAST_TO_VARCHAR2(BLOB_TYPE_COLUMN)
             1
    <a><b>something different</b><c>whatever you are looking for</c></a>
    1 row selected.
    SCOTT@orcl12c> SELECT id, UTL_RAW.CAST_TO_VARCHAR2 (blob_type_column)
      2  FROM   a_table
      3  WHERE  CONTAINS
      4            (blob_type_column,
      5             '(something different) WITHIN c') > 0
      6  /
            ID
    UTL_RAW.CAST_TO_VARCHAR2(BLOB_TYPE_COLUMN)
             2
    <a><b>something else</b><c>something different</c></a>
    1 row selected.

  • Efficient way of searching multiple xml files for multiple entries

    As I�m quite new to using xml in java I can't figure out how to solve my problem.
    I've got about 20 xml files, each about 500-1000kB big. each files contains about 500 questions, each with a unique ID.
    A user had to be capable of entering any number of ',' separated id's, and the program needs to show the user the questions.
    Using a SQL server this would be easy, but in this situation I can't. As this had to be a small program I can't add a 10MB jar file either, nor can I ask the users to install an additional program.
    Creating a brute search will be easy, but searching 20MB of xml files multiple times will be hard even for a modern PC.
    So my question is: What will be the most efficient way of searching these files?
    Hope that someone will be kind enough to respond :)
    Rick

    I'd still go with a database. There are databases that are significantly more light-weight than MS SQL Server.
    More concretely there are databases that run completely in memory. HSQLDB is one, Java DB (formerly Derby) is another one.
    I'd parse the XML files once, add them to the database and query from there later on.
    If even that is to complicated for you, then you could simply parse the XML files once and put the Questions into a HashMap with the ID as the key.

Maybe you are looking for

  • Labview fpga module 2008 OR 2010 sp1

    i want to work with labview 2008 or 2010 thanks for your help

  • Weblogic.transaction.XAException: XAER_RMERR

    We have JMS adapter product which uses our own transaction manager to manage an XA global transaction. Using this product we can configure a XA connection and able to produce a message to JMS Queue. Our JMS adapter product works fine with almost all

  • Grub2 and Vertical Monitors

    I was able to snag a Dell 1703FP Monitor and was very pleased to discover that I could rotate the monitor by 90 degrees clockwise (or pi/2 if you prefer radians). I have been able to get the initial boot console text oriented correctly by changing my

  • Serialization using Base 64 and Hex Encoding... Which is Better

    I have serialized an object and stored in one of the Database column's. I had 2 options to choose from; Option 1: Serialization into the database using Base 64 Encoder public static void write(Object obj, PreparedStatement ps)                 throws

  • Is it possible to NOT sync apps ?

    Hi, i have an 11inch MacBooc Air ... 11 inch implies ... small hard drive. My issue, is syncing apps starts to take a lot, and I mean a lot of space when using iTunes. I have an IPad and iPhone ... and apps or games are now taking 1gb per app. Is it