Results 1 to 3 of 3
  1. #1
    renu is offline Senior Member
    Join Date
    May 2010
    Rep Power

    Default How to get the value inside the node from an XML File in JAVA.


    I need to fetch the values inside the tag/node of an XML file.

    The xml.file looks like this,

    <data cc="100" ln="58">2291</data>
    <data cc="100" ln="59">2291</data>
    <data cc="105" ln="58">2389</data>
    <data cc="105" ln="59">2389</data>
    <data cc="110" ln="59">1</data>
    <data cc="110" ln="57">1</data>
    <data cc="115" ln="58">18436</data>
    <data cc="120" ln="59">20825</data>
    <data cc="115" ln="59">18436</data>
    <data cc="120" ln="58">20825</data>

    I need the value of cc and ln.
    For example the first line contains cc = 100 and i need to fetch 100 and ln = 58 and i need the value 58.

    Anyhelp is appreciated.

  2. #2
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Rep Power

    Default Re: How to get the value inside the node from an XML File in JAVA.

    Help with what? You have XML data, so you need to parse the XML data. There is no mystery behind that, a simple Google will provide you all you need to know.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  3. #3
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Northern Virginia, United States
    Rep Power

    Default Re: How to get the value inside the node from an XML File in JAVA.

    There is a complete section devoted to XML parsing in the Java tutorials. See my signature for the link.

    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

Similar Threads

  1. Replies: 1
    Last Post: 04-11-2014, 02:40 AM
  2. Replies: 1
    Last Post: 08-12-2012, 03:15 AM
  3. xml file merging, based on the node.
    By pranavkulkarni in forum XML
    Replies: 1
    Last Post: 07-07-2012, 07:21 AM
  4. How to use .cer file inside Java Code
    By koolking in forum Advanced Java
    Replies: 6
    Last Post: 10-06-2011, 01:21 PM
  5. random node from an xml file
    By matthew.parse in forum New To Java
    Replies: 1
    Last Post: 04-13-2010, 08:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts