Encrypting an XML file data

Hi All
I am new to Java security. I am stuck where i need to write the handler for the webservice.
I need to encrypt/sign the XML data using the some certificate.
I am having the certificate (pfx) and JKS file with me which i got from the web service producer.
Could some one let me know how can i encrypt this XML with above certificate.
Please let me know if you need some more information.
Thanks
Navneet

Navneet_Nigam wrote:
In the means while could you please answer my one question what is the differecne between sign the xml and encrypting the xml.Sign - to indicate that the XML has not be tampered with.
Encrypt - to hide the content from prying eyes.
I want XMl to be signed and encryptedOK.
If you are serious about doing this work then you should learn a good bit more about cryptography. A good starting point is
"Beginning Cryptography with Java" written by David Hook and published by Wrox.

Similar Messages

  • Error while encrypting the xml file using asymmetric cipher...pls help

    i am encryption the xml file using asymmetric cyper....
    in one class , i am generating private key and public key using "RSA" algorithm..using 1024 byte initialization...
    it is generating properly...
    and after that in second class i am encrypting the xml file using "DESede" algorithm and i am using public key of above class..
    but i am getting exceptione :
    java.security.InvalidKeyException: Invalid key length: 162 bytes
    at com.sun.crypto.provider.DESedeCipher.engineGetKeySize(DashoA6275)
    at javax.crypto.Cipher.init(DashoA6275)
    at XmlEncryption.getEncryptedData(XmlEncryption.java:147)
    at XmlEncryption.encryptCompleteXmlFile(XmlEncryption.java:123)
    at demoXmlEncApp.simulateBookSellersEnd(demoXmlEncApp.java:72)
    at demoXmlEncApp.main(demoXmlEncApp.java:29)
    so, what is that ?
    i want to use RSA algo for key generatiion and DESede for cipher initialization .
    is there any site for where source code of xml file encryption using asymmetric cipher is available?
    pls, help me.....

    Sachin,
    What sabre150 is trying to explain to you, is that encrypting data (such as an XML file) is a 2-step process. In the first step, you generate a symmetric key (such as DES, 3DES, AES) and encrypt your file with this key (and the appropriate mode and padding).
    In order to ensure that your encrypted data cannot be decrypted by unauthorized individuals, you now need to protect the symmetric key. Encrypting your symmetric key with another symmetric key does not solve the problem, since you have a chain of symmetric keys that need to be encrypted into infinity.
    Cryptographers solve this problem by encrypting the symmetric key with an asymmetric key, such as as RSA. To perform this second step, you generate an RSA key-pair, encrypt the symmetric key you generated in step 1 with the Public key of the RSA key-pair, and give the recipient of the encrypted XML file, access to the Private key of the RSA key-pair as well as the encrypted symmetric key.
    The recipient, then uses the RSA Private key to decrypt the symmetric key first, and then uses the "plaintext" symmetric key to decrypt the XML file.
    What sabre150 was also attempting to explain to you, is the traditional way of transporting an encrypted "blob" that consists of data + symmetric key. With a modern key-management system, combining the two would be unnecessary.

  • XML file data load to NW2004s-BI

    HI,
    I am trying to load the XML file data to NW2004s-BI .
    I have created the file Data source, infosoucrce and data store object. I have maintained the transformation rule for data source and info source also for infosource and data store object.
    But I am not able to create the XML DataSource (BW DataSource with SOAP Connection)
    Could any one please help me
    Thanks in advance.
    Amit

    Amit 
    Welcome to SDN.
    I don't know whether you checked this or not
    Select your Infosource>right click change>goto Extras-->and select Create BW Data source with SOAP Connection. It will crete Datasource.
    Hope this helps
    Thanks
    Sat
    PS: Don't forget to assign points if the answer is useful. This is the way of telling thanks in SDN

  • XML Processing (XML file data to ABAP internal table).

    Hi,
    I have a an XML file and i need to send the data to internal table. I suppose i have written the program correctly.
    But the transformation program may not be correct.
    So can one please tell me the transformation program c o d e or guide me to write the transformation code. Below are details of XML file and my program.
    XML File
    <?xml version="1.0" encoding="UTF-8" ?>
    - <aeRequestOutputType>
    + <trackingInfo>
    + <JMSHeaders>
    - <ns:__caret_reply_caret_ZBAPI xmlns:ae="http://www.tibco.com/" xsi:type="ns:__caret_reply_caret_ZBAPI_">
    + <RETURN>
    - <T__TRADE__DATA>
    - <item>
      <BUKRS>1111</BUKRS>
      <HKONT>22222</HKONT>
      </item>
    - <item>
      <BUKRS>3333</BUKRS>
      <HKONT>44444</HKONT>
      </item>
      </T__TRADE__DATA>
      </ns:__caret_reply_caret_ZBAPI__TRADE__ACC__DOC__POST_caret_ZBAPI__TRADE__ACC__DOC__POST>
      </aeRequestOutputType>
    My Program
    REPORT  ZTEST13.
    DATA : BEGIN OF itab OCCURS 0,
              f(255) TYPE c,
         END OF itab.
    DATA : t001 TYPE TABLE OF ZTEST_ST_UB. "(structure has few variables like hkont,bukrs)
    DATA: xmlupl TYPE string .
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename                       =  'c:\sap_output_xml.txt'
       FILETYPE                        = 'ASC'
      tables
        data_tab                      = itab          .
    LOOP AT itab.
    CONCATENATE xmlupl itab-f INTO xmlupl.
    ENDLOOP.
    CALL TRANSFORMATION ZTEST_ST_UB2
    SOURCE XML xmlupl
    RESULT root = t001.

    Hi,
    use class cl_xml_document and method import_from_file inorder to read the xml file to internal table.
    go trough this [LINK|http://wiki.sdn.sap.com/wiki/display/ABAP/UploadXMLfiletointernal+table] for detial code.
    Regards,
    Shanmugavel chandrasekaran

  • Reading XML file using BAPI and then uploading that xml file data into SAP

    I am getting a xml file from Java server. I need to take
    data from this file using BAPI and need to upload into SAP using SAP.
    Please tell me how to read XML files using BAPI's.

    <b>SDIXML_DATA_TO_DOM</b> Convert SAP data (elementary/structured/table types) into DOM (XML
    <b>SDIXML_DOM_TO_XML</b>  Convert DOM (XML) into string of bytes that can be downloaded to PC or application server
    <b>SDIXML_DOM_TO_SCREEN</b> Display DOM (XML)
    <b>SDIXML_DOM_TO_DATA</b>
    data: it_table like t001 occurs 0.
    data: l_dom      TYPE REF TO IF_IXML_ELEMENT,
          m_document TYPE REF TO IF_IXML_DOCUMENT,
          g_ixml     TYPE REF TO IF_IXML,
          w_string   TYPE XSTRING,
          w_size     TYPE I,
          w_result   TYPE I,
          w_line     TYPE STRING,
          it_xml     TYPE DCXMLLINES,
          s_xml      like line of it_xml,
          w_rc       like sy-subrc.
    start-of-selection.
      select * from t001 into table it_table.
    end-of-selection.
    initialize iXML-Framework          ****
      write: / 'initialiazing iXML:'.
      class cl_ixml definition load.
      g_ixml = cl_ixml=>create( ).
      check not g_ixml is initial.
      write: 'ok'.
    create DOM from SAP data           ****
      write: / 'creating iXML doc:'.
      m_document = g_ixml->create_document( ).
      check not m_document is initial.
      write: 'ok'.
      write: / 'converting DATA TO DOM 1:'.
      CALL FUNCTION 'SDIXML_DATA_TO_DOM'
        EXPORTING
          NAME               = 'IT_TABLE'
          DATAOBJECT         = it_table[]
        IMPORTING
          DATA_AS_DOM        = l_dom
        CHANGING
          DOCUMENT           = m_document
        EXCEPTIONS
          ILLEGAL_NAME       = 1
          OTHERS             = 2.
      if sy-subrc = 0.  write  'ok'.
      else.             write: 'Err =', sy-subrc.
      endif.
      check not l_dom is initial.
      write: / 'appending DOM to iXML doc:'.
      w_rc = m_document->append_child( new_child = l_dom ).
      if w_rc is initial.  write  'ok'.
      else.                write: 'Err =', w_rc.
      endif.
    visualize iXML (DOM)               ****
      write: / 'displaying DOM:'.
      CALL FUNCTION 'SDIXML_DOM_TO_SCREEN'
        EXPORTING
          DOCUMENT          = m_document
        EXCEPTIONS
          NO_DOCUMENT       = 1
          OTHERS            = 2.
      if sy-subrc = 0.  write  'ok'.
      else.             write: 'Err =', sy-subrc.
      endif.
    convert DOM to XML doc (table)     ****
      write: / 'converting DOM TO XML:'.
      CALL FUNCTION 'SDIXML_DOM_TO_XML'
        EXPORTING
          DOCUMENT            = m_document
        PRETTY_PRINT        = ' '
        IMPORTING
          XML_AS_STRING       = w_string
          SIZE                = w_size
        TABLES
          XML_AS_TABLE        = it_xml
        EXCEPTIONS
          NO_DOCUMENT         = 1
          OTHERS              = 2.
      if sy-subrc = 0.   write  'ok'.
      else.              write: 'Err =', sy-subrc.
      endif.
      write: / 'XML as string of size:', w_size, / w_string.
      describe table it_xml lines w_result.
      write: / 'XML as table of', w_result, 'lines:'..
      loop at it_xml into s_xml.
        write s_xml.
      endloop.
      write: / 'end of processing'.
    end of code
    Hope this will be useful.
    regards
    vinod

  • Converting text String to XML file data

    need some guidance. I have to create a XML file of a huge Text File.
    I am parsing the text file according to relevance and passing a set of data each element and attribute seperated by "_".
    I need to create to Xml file out this. It has to be current process as I need to keep on adding new elements and attributes.
    e.g.
    Passing this string
    String temp("Name_Age_Birthdate_Birthplace_Place_teleNumber");
    Need to add this to XML of format
    <Directory>
    <Person>
    <Name>
    <Age>
    <Birthdate>.....
    </Person>
    <Person>
    </Person>
    </Directory>
    The problem not all attributes may be present at some time..
    e.g.
    the person's age may be absent some times.. during that time the xml file should look like <Age/>
    I will need to keep on updating Person list concurrently after the file has been created..
    Need Urgent guidance.. I am still New to java
    A guidance code or link is awaited..
    Thanks.. a Lot

    Do you need to stick to the XML support that comes with Java 1.4 or can you use Third-Party stuff? I'm asking, 'cause I think JDOM is much easier to use for a newbie than the build-in XML API ... and it comes with a VERY easy to use class XMLOutputter that creates XML files!
    Take a look at JDOM:
    http://www.jdom.org/

  • Encrypt & Decrypt XML files

    Hi All,
    I am new to the cryptography. I have one application which will transfer XML files from the machines which uses Windows/Java platform to the machines which uses Linux/C and also vice versa.
    I want to encrypt the files before transfer and decrypt the files after transfer on both the sides. Is there a common technology for handling this? Any info? Thanks in adv.
    -Bh_t_76

    So, I thought of getting ideas from the people who
    have already done similar work. I think the forums
    are meant for that. The topic is too broad. The forums are normally for specific problems and your request requires at least one book as an answer.
    If you know nothing about encryption then you need to find and read books on the subject. Not just Java books, but general encryption books. There are plenty out there of various standards.
    One of the books in my library is http://www.schneier.com/book-applied.html but you may want to start with something a little less weighty. Visit http://www.crypteon.co.uk/cryptography-books.htm to get some ideas.
    Once you have a basic understanding of modern cryptography then study the JCE tutorial and come back with specific questions.

  • Loading XML file data

    Hello
    I am using Spry.Widget.AutoSuggest to sort the data from an
    external XML file
    In the XML there are some url-s pointing to pictures to be
    loaded but the problem is that they all loads in the cache as the
    page initializes.
    Although they are not shown at the begining i can see them
    caching ( firebug for mozilla)
    Is there any way to load the appropriate pictures (data) just
    after it matches the AutoSuggest search criteria.
    the example files are :
    http://www.evtinobg.com/newWebSite/_search.php
    http://www.evtinobg.com/newWebSite/models.xml
    thanx a lot

    Please read the FAQ thread and posting guidelines... Also please see the XML DB basic demo.. And try forum search, this question (or variant's of it) have been asked and answered so many times that it's really not worth starting (another) new thread on this issue.
    Edited by: mdrake on Jan 19, 2011 10:33 AM

  • Most efficient way to load XML file data into tables

    I have a complex XML file running into MBs. I want to load it's data into 7-8 tables.
    Which way will be better:
    1) Use SQL Loader to actually load directly into the 7-8 tables directly by modifying the control card.
    Is this really possible and feasible? I am not even sure about it
    2) Load data as XML Type in a table and register it. Then extract from there to load into various tables.
    Please help. I have to find the most efficient way of doing it.
    Regards,
    Sudhir

    Yes it is possible to use SQL*Loader to parse and load XML, but that is not what it was designed for and so is not recommended. You also don't need to register a schema, just to load/store/parse XML in the DB either.
    So where does that leave you?
    Some options
    {thread:id=410714} (see page 2)
    {thread:id=1090681}
    {thread:id=1070213}
    Those talk some about storage options and reading in XML from disk and parsing XML. They should also give you options to consider. Without knowing more about your requirements for the effort, it is difficult to give specific advice. Maybe your 7-8 tables don't exist and so using Object Relational Storage for the XML would be the best solution as you can query/update tables that Oracle creates based off the schema associated to the XML. Maybe an External Table definition works better for reading the XML into the system because this process will happen just once. Maybe using WebDAV makes more sense for loading XML to be parsed (I don't have much experience with this, just know it is possible from what I've read on the forums). Also, your version makes a difference as you have different options available depending upon the version of Oracle.
    Hope all that helps as a starter.
    Edited by: A_Non on Jul 8, 2010 4:31 PM
    A great example, see the answers by mdrake in {thread:id=1096784}

  • Load xml file data in oracle 9i table

    Hi,
    I have oracle 9i R2 (9.2.0.8) and currently i am loading data using sql*loader as i am getting text file. I will be getting file in XML format shortly.
    I would like tp know if there is a sql*loader way to load xml file or another easy method that i can use it?
    If you can provide me very simplest way, i will really appreciate it.
    Thanks,

    Please refer
    http://download-uk.oracle.com/docs/cd/B12037_01/appdev.101/b10790/xdb25loa.htm

  • Processing XML File Data

    Hi,
    I have to process a XLM file data from the application server. Could anyone give me any idea how to put the XML file from application server into an internal table in a proper way? I know there is a class CL_XML_DOCUMENT, but I have never handled a XML file before.If anyone could give me a sample code (my id is [email protected]), that would be very helpful.

    check out this weblog where in the code sample i am showing how a xml file can be converted to itab using XSLT (XSLT code is also given)
    /people/durairaj.athavanraja/blog/2004/09/20/consuming-web-service-from-abap
    Usefule linkg for learning XSLT
    http://www.w3schools.com/xsl/
    http://help.sap.com/saphelp_erp2005/helpdata/en/a8/824c3c66177414e10000000a114084/frameset.htm
    also check out these packages from txn se80
    SXSLT              
    SXSLT_APP          
    SXSLT_COMP         
    SXSLT_COMPMSG      
    SXSLT_DEBUGGER     
    SXSLT_DEMO         
    SXSLT_TEST         
    SXSLT_TOOL         
    SXSLT_TRAINING     
    Regards
    Raja
    Reward the helpful answers by clicking the radiobutton and if you question is answered mark it as answered

  • Upload XML file data into internal table

    Hi,
    I need help from you.
    I am uploading XML file from Application server.
    1.In application server under directory it may have several XML files and i need to upload all the XML files  when we gave only directory name. So, what is the function module for that logic . If possible code also.
    2.Once we get the files into some internal table we need to upload data from that files to internal table.
    So what is the logic for that , if possible code also.
    I am giving sample directory:    
    For example in this directory assume 3 xml files are there.
    I need to upload those files and data from that in to internal table.
    Thanks & Regards
    VSR

    Below code will give you an idea.
    TYPE-POOLS: ixml. "iXML Library Types
    *TABLES : rbkp.
    TYPE DECLERATIION
    TYPES: BEGIN OF type_tabpo,
    ebeln TYPE ekko-ebeln, "PO document number
    ebelp TYPE ekpo-ebelp, "PO line item
    END OF type_tabpo.
    TYPES: BEGIN OF type_ekbe,
    belnr TYPE rbkp-belnr, "Invoice document
    gjahr TYPE rbkp-gjahr, "fiscal year
    END OF type_ekbe.
    TYPES: BEGIN OF type_invoice,
    belnr TYPE rbkp-belnr, "PO document number
    gjahr TYPE rbkp-gjahr, "Fiscal Year
    rbstat TYPE rbkp-rbstat, "invoice status
    END OF type_invoice.
    TYPES: BEGIN OF t_xml_line, "Structure for holding XML data
    data(256) TYPE x,
    END OF t_xml_line.
    INTERNAL TABLE DECLERATIION
    DATA: gi_tabpo TYPE STANDARD TABLE OF type_tabpo,
    gi_ekbe TYPE STANDARD TABLE OF type_ekbe,
    gi_invoice TYPE STANDARD TABLE OF type_invoice,
    gi_bapiret2 TYPE STANDARD TABLE OF bapiret2.
    DATA: l_ixml TYPE REF TO if_ixml,
    l_streamfactory TYPE REF TO if_ixml_stream_factory.
    DATA: l_xml_table TYPE TABLE OF t_xml_line, " XML Table of the structure
    l_xml_line TYPE t_xml_line, " Record of structure t_xml_line
    l_xml_table_size TYPE i. " XML table size
    DATA: l_filename TYPE string.
    WORK AREA DECLARATION
    DATA: gw_tabpo TYPE type_tabpo,
    gw_ekbe TYPE type_ekbe,
    gw_invoice TYPE type_invoice,
    gw_bapiret2 TYPE bapiret2.
    BEGIN OF SELECTION SCREEN
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
    PARAMETERS: p_file TYPE pathintern LOWER CASE DEFAULT '/usr/sap/tmp/'.
    Validation of XML file: Only DTD included in XML document is supported
    SELECTION-SCREEN END OF BLOCK blk1.
    SELECTION SCREEN VALIDATION
    AT SELECTION-SCREEN.
    To validate p_file is not initial
    PERFORM sub_validate_file.
    PERFORM sub_validate_path.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    Request for filename for xml file from the application server
    PERFORM sub_get_filename_appl USING p_file.
    START OF SELECTION SCREEN
    START-OF-SELECTION.
    PERFORM sub_fetch_po_details.
    PERFORM sub_get_invoice.
    PERFORM sub_rel_invoice.
    END OF SELECTION SCREEN
    END-OF-SELECTION.
    *& Form sub_validate_file
    To Validate the file
    FORM sub_validate_file .
    IF p_file IS INITIAL.
    MESSAGE e000. "specify the file path
    ENDIF.
    ENDFORM. " sub_validate_file
    *& Form sub_get_filename_appl
    form sub_get_filename_appl USING l_fname TYPE any.
    DATA: l_fname TYPE filename-fileintern. " File name
    *GET THE FILENAME FROM THE APPLICATION SERVER
    CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
    EXPORTING
    directory = l_fname
    filemask = '*'
    IMPORTING
    serverfile = l_fname
    EXCEPTIONS
    canceled_by_user = 1
    OTHERS = 2.
    IF sy-subrc 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM. " sub_get_filename_appl
    *& Form sub_fetch_po_details
    To fetch the PO details from the application server
    Format of file is XML
    FORM sub_fetch_po_details .
    TYPE DECLERATIION
    l_ixml = cl_ixml=>create( ).
    Creating a stream factory
    l_streamfactory = l_ixml->create_stream_factory( ).
    PERFORM get_xml_table.
    LOOP AT gi_tabpo INTO gw_tabpo.
    WRITE:/ gw_tabpo.
    ENDLOOP.
    ENDFORM. " sub_fetch_po_details
    *& Form get_xml_table
    Read from the xml file
    FORM get_xml_table .
    Local variable declarations
    DATA: l_len TYPE i,
    l_len2 TYPE i,
    l_tab TYPE tsfixml,
    l_content TYPE string,
    l_str1 TYPE string,
    c_conv TYPE REF TO cl_abap_conv_in_ce,
    l_itab TYPE TABLE OF string.
    l_filename = p_file.
    code to upload data from application server
    OPEN DATASET l_filename FOR INPUT IN BINARY MODE.
    IF sy-subrc 0.
    WRITE:/ 'invalid file path'.
    ENDIF.
    DO.
    READ DATASET l_filename INTO l_xml_line.
    IF sy-subrc EQ 0.
    APPEND l_xml_line TO l_xml_table.
    ELSE.
    EXIT.
    ENDIF.
    ENDDO.
    CLOSE DATASET l_filename.
    code to find the table size
    DESCRIBE TABLE l_xml_table.
    l_xml_table_size = ( sy-tleng ) * ( sy-tfill ).
    *code to convert hexadecimal to XML
    LOOP AT l_xml_table INTO l_xml_line.
    c_conv = cl_abap_conv_in_ce=>create( input = l_xml_line-data
    replacement
    = space ).
    c_conv->read( IMPORTING data = l_content len = l_len ).
    CONCATENATE l_str1 l_content INTO l_str1.
    ENDLOOP.
    l_str1 = l_str1+0(l_xml_table_size).
    SPLIT l_str1 AT cl_abap_char_utilities=>cr_lf INTO TABLE l_itab.
    LOOP AT l_itab INTO l_str1.
    REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>horizontal_tab IN
    l_str1 WITH space.
    ENDLOOP.
    CALL TRANSFORMATION ('ID') " code to put in internal table
    SOURCE XML l_str1
    RESULT tab = gi_tabpo[].
    ENDFORM. " get_xml_table

  • How to load xml file data

    hi ,
    I know how to load data from csv file...
    Anyone can guide me for how to load data from xml file
    i need step by step guidence
    from
    naman

    hi naman shah,
    you can used XML DOM in SAP in order to read data from xml file
    first step to do that, you need to read the xml file using OPEN DATASET
    after that you convert the content of the file to XML DOM class in SAP using function modul SDIXML_XML_TO_DOM
    after that you can read / manipulate the data from xml.
    for the XML DOM class documentation in SAP, please refer to http://help.sap.com/saphelp_crm50/helpdata/en/bb/576637dca511d4990b00508b6b8b11/frameset.htm
    hopes it helps
    regards
    eddhie

  • XML file data

    Hello
    The attached xml file contains data that I would like to extract. The data value has the tag (ubchild???/)name of "mean'. This can occur quite a number of times within the file for different child names.  e.g.
    <Key>SENS0710:10951:IntSolIrr</Key> has the value as
    <Mean>742.320755</Mean>
    and
    <Key>SMBAU008:154000347:m_S0 kWh</Key> has the value as
    <Mean>227.458679</Mean>
    and so on....
    The attached vi is very very simple and uses the JKI EasyXML vi to parse the file to a labview data type.
    This is the point at which I need some guidance as to move forward. I have looked at using variant to data, clusters etc, but can't seem to get anything near working.
    Would somebody be so kind as to give me some advice or tips as to extract these values to an array.
    Thankl you
    Regards
    Ray
    Solved!
    Go to Solution.
    Attachments:
    XMLReader.vi ‏8 KB
    xml file for forum.pdf ‏151 KB

    Hey Ray,
    Here's how you use EasyXML to parse your data (Parse WebBox XML.vi):
    Attachments:
    Parse WebBox XML.vi ‏12 KB

  • 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.

Maybe you are looking for

  • Pc will not work with Airport Extreme LAN connection

    I have setup my Aiport Extreme Base Station and my Mac and phone work just fine with the setup. However, I connected a PC directly to one of the LAN ports on the back, and the PC doesn't see the network. Above the port the light is blinking green. An

  • Why 1.3bios the only one that works???

    1st Question: When i install a new bios my system fails to completely boot to XP-PRO. It flashes me a blue screen of then and restarts.... whats up with that? Must try to reinstall XP op is this a genral issue that can be fixed? 2nd Question: Do the

  • External sound console quit working on aud

    i have an audigy 2 zs platinum pro. the external console is model sb0290. one day (and i dont know exactly when) the console quit working. as if it gets no power. i used to be able to turn down the volume from it and one day just noticed it ceases to

  • Cannot commit or rollback  a JDBC Connection from CAF project

    Hi Everybody, I'm working in CE 7.10. I have a CAF Project that gets a JDBC connection from a Custom Datasource to an external Database. Here is the code:   try     Context ctx = new InitialContext();     DataSource ds = (DataSource) ctx.lookup("jdbc

  • Quick create option in CRM portal

    Hai Guys, In PCUI we have the Quick Create IView there are three options like E-mail, Phone call, task, Appointment but when i am trying to open the Phone call, task appointment link it is not opening it is throwing some error like BSP error i kindly