Parsing XML feed

I have codes as follows:
SET SERVEROUTPUT ON
SET DEFINE OFF
DECLARE
feedURL VARCHAR2 (500);
xmlparser parser. Analyzer;
feedXML xmldom. DOMDocument;
titles xmldom. DOMNodeList;

titles_found NUMBER;
curNode xmldom. DOMNode;
textChild xmldom. DOMNode;

BEGIN

feedURL: = '3Aproject % http://192.168.2.30/cgi-bin/query-meta?v%3Asources=cansumtest & v = query-meta & query = HOOD & render.function = xml-feed-display & content-type = text/xml';

Parser: = xmlparser.newParser;
feedXML: = xmlparser.parse (feedURL);
xmlparser.freeParser (parser);

titles: = xmldom.getElementsByTagName(feedXML,'*');

FOR j IN LOOP 1.xmldom.getLength (titles)
curNode: = xmldom.item(titles,j-1);
textChild: = xmldom.getFirstChild (curNode);

dbms_output.put_line ('('||) LPAD(j,2) |') '|| xmldom.getNodeValue (textChild));

END LOOP;
xmldom.freeDocument (feedXML);

END;

Above codes generate result:
(1)
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10)
(11) 150
* (12) H0OH18101 *.
(13) < span class = "vivbold qt0" > </span > HOOD, RONALD E
(14)
(15)
(16) 155
* (17) H8OH07073 *.
(18) < span class = "vivbold qt0" > </span >, RONALD EDWARD HOOD
(19)
(20)
(21)
(22)
(23) H0oh18101, hood, Ronald
(24)
(25) Edward, Hood, Ronald
PL/SQL procedure successfully completed.

You can see by browsing, oracle shows all items in the feed url. From the results above, I need to display only items 12 and 17, and ignore the rest. I also provide XML feed below:

<? XML version = "1.0"? >
-vce >
< param name = "v: sources" value = "cansumtest" / >
< param name = "v: project ' value = 'query-meta' / >
< param name = "query" value = "HOOD" / >
< param name = "render.function" value = "xml-feed-display" / > "
< param name = "content-type" value = "text/xml" / >
-added source = test-strictly 'test-strictly"name ="cansumtest"type ="vse"modified"1355412925"="1.3"over-request = num = '200' status 'questioned' = asked ="200"query-xml-Jack in charge ="query-xml-support' vse - vse = 'vse - vse"total-results = '2' admin-url ="http://velocity/vivisimo/cgi-bin/admin"stem"depluralize"stem2 = 'none' = list of stopwords = 'none' search-ms ="1"recovery-ms = '0' total-results-with-duplicates = '2' retrieved '2' = >
< parse url = "http://127.0.0.1:7205/search?query-xml=%3cterm%20field%3d%22query%22%20str%3d%22HOOD%22%20position%3d%220%22%20processing%3d%22strict%22%20input-type%3d%22user%22%20%2f%3e & mode = normal & strength-binning binning = 0 & max = 300 & start = 0 & num = 200 & staging = 0 & collection = cansumtest & r-o-p = 0 & sort keys = 1 & shingles = 1 & sum = 1 & = 1 & cache-data cache = 0 & score = 0 & show-duplicates =" 0 & gen - key = 0 & n-collapse = 0 & is is collapsed binning = 0 "start time"57"end of time = = http ="64"status" 200 OK"status =" "read treated analysis ' recovered '2' = / >" "
< / source added >
-< path list = "" num = "2" level = '0' start '0' by = '10' = > "
-document url = "oracle://192.168.2.19:1521 / orcl /?" key - val = 9' rank = '0' source = "cansumtest" score = "0.111111" truncated url = "oracle://192.168.2.19:1521 / orcl /?" key - val = 9"context =" 3astate % http://192.168.2.30/cgi-bin/query-meta?v%3afile=viv_MLtzUk & v = % 28root % 29% 7croot & v % 3aframe = tree & subquery = id % 3aNdoc0 & % active 3d = root & v % 3asubsearch = 1 & ">
< = "size" type = "text" > 150 happy name < / content >
< happy name = "CAND_ID" type = "text" > H0OH18101 < / content >
< happy name = "CAND_NM" type = "text" > < span class = "vivbold qt0" > </span > HOOD, RONALD E < / content >
< happy name = "extract" type = "html" / >
< / document >
-document url = "oracle://192.168.2.19:1521 / orcl /?" key - val = 4015"="1"source ="cansumtest"rank score = '0.1' truncated url =" oracle://192.168.2.19:1521 / orcl /? " key - val = 4015"context =" 3astate % http://192.168.2.30/cgi-bin/query-meta?v%3afile=viv_MLtzUk & v = % 28root % 29% 7croot & v % 3aframe = tree & subquery = id % 3aNdoc1 & % active 3d = root & v % 3asubsearch = 1 & ">
< happy name = "size" type = "text" > 155 < / content >
< happy name = "CAND_ID" type = "text" > H8OH07073 < / content >
< happy name = "CAND_NM" type = "text" > < span class = "vivbold qt0" > </span >, RONALD EDWARD HOOD < / content >
< happy name = "extract" type = "html" / >
< / document >
< / list >
-< tree base-url = "" http://192.168.2.30/cgi-bin/query-meta?v%3afile=viv_MLtzUk & v: state = ' recluster-base-url = "http://192.168.2.30/cgi-bin/query-meta?v%3afile=viv_MLtzUk &" > "
-< node type = 'high' level = '0' Sindocs = '2' active = '1' subnodes = '0' ts = "|" root' ls = "root |" root' bs = "|" root">
-< node type = 'document' level = '1' Sindocs = '1' ts = "(root) |" root' ls = "root |" N0"bs =" (root) | " N0 ">"
< description > H0oh18101, hood, Ronald < / description >
< / node >
-< node type = 'document' level = '1' Sindocs = '1' ts = "(root) |" root' ls = "root |" N1"bs =" (root) | " N1 ">"
< description > Edward, Hood, Ronald < / description >
< / node >
< / node >
< / tree >
< / vce >

The easiest way is probably to apply a regular expression, either by post-processing of the column:

SQL> select cand_id
  2       , regexp_replace(cand_nm, '<[^>]+>') as cand_nm
  3  from xmltable(
  4         '/vce/list/document'
  5         passing xdburitype('/public/feed.xml').getxml()
  6         columns
  7           cand_id   varchar2(30)  path 'content[@name="CAND_ID"]'
  8         , cand_nm   varchar2(80)  path 'content[@name="CAND_NM"]'
  9       )
 10  ;

CAND_ID                        CAND_NM
------------------------------ --------------------------------------------------------------------------------
H0OH18101                      HOOD, RONALD E
H8OH07073                      HOOD, RONALD EDWARD
 

or directly in XMLTable:

SQL> select cand_id
  2       , cand_nm
  3  from xmltable(
  4         '/vce/list/document'
  5         passing xdburitype('/public/feed.xml').getxml()
  6         columns
  7           cand_id   varchar2(30)  path 'content[@name="CAND_ID"]'
  8         , cand_nm   varchar2(80)  path 'ora:replace(content[@name="CAND_NM"], "<[^>]+>", "")'
  9       )
 10  ;

CAND_ID                        CAND_NM
------------------------------ --------------------------------------------------------------------------------
H0OH18101                      HOOD, RONALD E
H8OH07073                      HOOD, RONALD EDWARD
 

Tags: Oracle Development

Similar Questions

  • How to parse RSS feeds using QML (waterfalls)?

    Hallo native devs! I am a beginner in native development and I want to know how to parse RSS feeds using QML cascading?

    I see the example like this:

    Page {
        content: Container {
            background: Color.White
            ListView {
                rootIndexpath: [1]
                dataModel: XmlDataModel { source: "model.xml" }
            }
        }
    }
    

    but, can I to ' source: ' use 'http://example.com/rss.xml'?

    If Yes, how can I analyze?

    Thanks for the help!

    The QML in your message assumes that the XML file is local, if you use a remote XML file then you will need to firstly using a few backend Qt C++ network code, download, then you can use QML.

    I would recommend from the Cascades sample quotes to get an idea of how XmlDataModel analysis work can start to look into the network access code and the file.

  • Interception of artifacts in parsing XML w / SAXParser

    I'm working on an application of XML parser for a Web site. It contained generated by users and they like put in "hearts" ("like in")<3') and="" the="" like.="" my="" parser="" is="" a-okay="" until="" it="" hits="" one="" of="" these="" inside="" a="" comment,="" then="" has="" a="" fatal="" error="" (fatalerror:="" expecting="" a="" name).="" how="" do="" you="" guys="" handle="" these?="" thanks="" in="">

    My XML feed looks like:

       12345  ParserCrasher1999  omg i luv parsers esp crashing them lol <3 omgkittenz
    
     Jul 1, 2009 9:46pm
    

    What component xml replace the following symbols in the xml (shown in blue) node/attribute values

    <    to  ="">

    > to &rt;

    & to &

    "     to   "

    '     to   '

    For example, the value <> must be converted to < 3

    It is important to avoid confusion to the xml parser.

  • Parsing XML in ColdFusion 5

    Hello there,

    It's not like there is a native way to parse XML in ColdFusion version 5.0. ColdFusion MX makes it easier to work with XML, but unfortunately I am working under Windows with a CF5 server.

    I've gotten to the point of use CFHTTP to retrieve XML content in a variable, but I don't know the best way to decompress the data in a query, or another structure that I can use to feed the rest of the model. I thought to save the content of a file and then a loop top, but something tells me that it is an inefficient way to do the job.

    I would like to avoid having to install any additional software, but if it's the only way to process XML in CF5, then I would be grateful for any recommendations on the best tools to evaluate or buy. Or if there is a way to do it in JavaScript, it would be great, too.

    Thanks for any help!

    try to use SoXML, it is a custom tag, is free and can be downloaded from the Adobe Exchange website

    --> Adobe Exchange link

    M

  • Podcast XML Feed does not update

    Hello

    Since May 2009, I have the following podcast that ran (albeit with a 2 year hiatus):

    https://iTunes.Apple.com/GB/podcast/the-itsawinner-Poker-podcast/id344260020?MT= 2

    The XML of talkshoe is: http://recordings.talkshoe.com/rss72195.xml

    After our show "comeback" on March 22, it downloaded correctly. Unfortunately the shows on March 29 and April 5 are uploaded correctly and if you are a Subscriber came to watch to download in the iTunes client but do not appear in the iTunes store.

    In 'Apple Podcasts Connect' the food reads as having various errors. Oddly enough, a second podcast that I have has a talkshoe XML feed has been allowed a few days ago showed that the error, then was allowed again.

    Can someone help me? I sent to Apple who have said that they will study closer, but that was a week ago and I heard nothing. The show is a real body of works and we want to continue to use the feed.

    Thank you

    Malcolm

    I don't expect the 5th episode of April to show in the store again - it usually takes about 2 days for a new episode to appear. However, previous episodes of 29 March should have appeared. However, there has been cases recently of the Bank of failing to show the odd episodes. All you can do is to email them and request a re-indexing - it usually sorts out. It seem not to be serious errors in the food that can cause this.

  • Problem in parsing XML

    Hello

    Any1 can you please tell me how to do Xml parsing in Blackberry. I'm a bit confused by it.

    Assume that it is my link:

    {keyword: "keword", url: "videoUrl"}

    While parsing xml:

    String keyword1 ="";

    element.getName.equalsIgnoreCase ("keyword");

    keyword1 = Element.GetText ();

    is she writing?

    Hey its done.

  • Parsing XML and get the attributes of a tag

    Hello

    When parsing XML for application of Cascades in C++, I am able to get the value of a tag as follows:

    00000

    But I also want to get the attributes of a tag:

    But I don't know how to get the 'CA' and 'California' attributes with my current code.  Can anyone help?  Here is the code I use to parse the XML code:

    void CMController::requestFinished(QNetworkReply* reply) {
    
        if (reply->error() == QNetworkReply::NoError) {
    
            QXmlStreamReader xml;
    
            QByteArray data = reply->readAll();
            xml.addData(data);
    
            QString zip;
            QString id;
            QString location;
    
            while (!xml.atEnd() && !xml.hasError()) {
    
                /* Read next element.*/
                QXmlStreamReader::TokenType token = xml.readNext();
    
                /* If token is just StartDocument, we'll go to next.*/
                if (token == QXmlStreamReader::StartDocument) {
                    continue;
                }
    
                /* If token is StartElement, we'll see if we can read it.*/
                if (token == QXmlStreamReader::StartElement) {
    
                    if (xml.name() == "zip") {
                        zip = xml.readElementText();
                    }
    
                    if (xml.name() == "id") {
                        ???
                    }
    
                    if (xml.name() == "location") {
                        ???
                    }
    
                }
    
            }
    
            emit succeeded(result);
    
        } else {
            emit failed();
        }
    
        reply->deleteLater();
    
    }
    

    Thank you!

    I found a working example:

    if(xml.name() == "state"){
        QXmlStreamAttributes attrib = xml.attributes();
        QStringRef ref = attrib.value("location");
        qDebug() << "location: " << ref;
    }
    
  • Widget to the Web service, parsing XML

    I worked on the communication with my web services and back to my widget.

    By using the code below, I was able to perform a GET and repay the XML, but I can't find data where I expect it to be node-wise when parsing XML. I return an object with 3 variables attached to it. I expect to be child nodes 1, 2, and 3. They proved to be 1, 3 and 5 nodes.

    Any ideas on why or how? I feel I'm missing just a simple thing in all of this.

    XML response

    
    - http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/">
      1000
      Test Station
      105.285
      
    

    The widget code

    //****************** Ajax Logic ******************
    var xmlHttp;
    function getStationUpdate() {
    
        alert("in station update");
        xmlHttp = new XMLHttpRequest();
    
        var Posturl = "http://MachineIPGoesHERE:51107/Service1.asmx/HelloWorld2?";
        alert("after post url");
        xmlHttp.onreadystatechange = updateData;
        alert("after onReadyStateChange");
        xmlHttp.open("GET", Posturl, true);
        alert("after GET");
    
        xmlHttp.send(null);
    }
    
    function updateData() {
        if (xmlHttp.readyState == 4) {
            alert(xmlHttp.responseText);
            parser = new DOMParser();
            var xmlDoc = parser.parseFromString(xmlHttp.responseText, "text/xml");
    
            alert(xmlDoc.documentElement.childNodes[1].tagName + " " + xmlDoc.documentElement.childNodes[1].childNodes[0].nodeValue);
            //alert(xmlDoc.documentElement.childNodes[1].childNodes.length);
            //alert(xmlDoc.documentElement.childNodes[1].hasChildNodes());
            //alert(xmlDoc.documentElement.childNodes[2].hasChildNodes());
            //alert(xmlDoc.documentElement.childNodes[2].tagName + " " + xmlDoc.documentElement.childNodes[2].childNodes[0].nodeValue);
            alert(xmlDoc.documentElement.childNodes[3].tagName + " " + xmlDoc.documentElement.childNodes[3].childNodes[0].nodeValue);
            alert(xmlDoc.documentElement.childNodes[5].tagName + " " + xmlDoc.documentElement.childNodes[5].childNodes[0].nodeValue);
    
            alert(xmlDoc.documentElement.childNodes.length);
        }
    

    Web service

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.Services;
    using System.Xml.Serialization;
    
    namespace WebService1
    {
        /// 
        /// Summary description for Service1
        /// 
        [WebService(Namespace = "http://tempuri.org/")]
        [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
        [System.ComponentModel.ToolboxItem(false)]
        // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
         [System.Web.Script.Services.ScriptService]
        public class Service1 : System.Web.Services.WebService
        {
    
            [WebMethod]
            public string HelloWorld()
            {
                return "Hello World";
            }
    
            [WebMethod]
            public myTestObj HelloWorld2()
            {
                myTestObj test = new myTestObj();
                return test;
            }
        }
    
        [Serializable]
        public class myTestObj
        {
            private int _StationID;
            private string _StationName;
            private double _Volume;
    
            [XmlElementAttribute(Order = 0)]
            public int StationID
            {
                get
                {
                    return this._StationID;
                }
                set
                {
                    this._StationID = value;
                }
            }
    
            [XmlElementAttribute(Order = 1)]
            public string StationName
            {
                get
                {
                    return this._StationName;
                }
                set
                {
                    this._StationName = value;
                }
            }
    
            [XmlElementAttribute(Order = 2)]
            public double Volume
            {
                get
                {
                    return this._Volume;
                }
                set
                {
                    this._Volume = value;
                }
            }
    
            public myTestObj()
            {
                StationID = 1000;
                StationName = "Test Station";
                Volume = 105.285;
            }
        }
    }
    

    > Any ideas on why or how? I feel I'm missing just a simple thing in all of this.

    White space nodes?

  • Best way to Parse XML using Dreamweaver CC 2015.3

    I was on a wild goose chase - trying to figure out how to parse XML using DW CC

    every article I read, says something about XML & XSLT, but it is no longer available in the new CC - I read about using jQuery or php, but have not yet find a resource to learn specifically "using DW CC.

    I'm willing to learn how to parse XML with DW CC but I would get a definitive direction to go before I'm trying to learn something that adobe will put in 'end of life '.

    advice or links to resources that can parse XML DW CC 2015 would be LARGELY APPRECIATED, thank you

    x 126 has written:

    What I'm asking is...

    1. What is the best procedure to insert XML into a page using DW CC 2015 as my editor?
    a. what happened to spry? b. what happened to XSLT?

    As Nancy explained, Spry has been abandoned by Adobe, a few years ago.

    XSLT server behavior has been removed at the same time as other server behaviors Dreamweaver CC. The problem with most of the PHP server behaviors was that they were based on code that has been removed from PHP 7. The XSLT server behavior didn't rely on these features, but it was not the most friendly of server behaviors. XSLT is a complex language that is to be avoided when parsing XML unless you really know what you're doing.

    The easiest way to manipulate XML in Dreamweaver should use PHP SimpleXML. I've linked to the samples page in the PHP online documentation. Believe me, it's much easier than trying to do battle with XSLT. If you have a subscription to lynda.com, you can learn more about SimpleXML to my operational with SimpleXMLclass.

  • import data produced by xml feed

    BC agrees to import data through xml feeds?

    No thanks, I'll do it myself with this tutorial from the BC gurus and cross my fingers. Part 2 of creating a Migration Application of data of Business Catalyst

  • XML Feed as a source of data?

    Hello world

    I've been away from all CF and webdev world for a few years and I have some catching up to do - please bear with me :)

    I am putting together a site that attracts the lists of products from a third party XML feed and then use their site for transactions by credit card etc.. I've never worked with before XML streams, so I googled a bit looking for some basic information. I came across this page:

    http://www.Adobe.com/devnet/articles/xml_resource_feed.html

    and found this statement: "you can use the XML feed as a data source in ColdFusion to create dynamic content for an HTML page or a Macromedia Flash application.»

    This does mean that I can simply create a data source on my CF box, he points to the XML stream and then just question him like a normal mySQL or Access DB? Or (as I strongly suspect), am I missing something?

    If I get immersed in XML does anyone know of a good introduction to hang a stream in a CF XML site?

    Thank you
    Paul.

    .

    For example, run the following


    Query = "rssQuery."
    source =" http://rss.news.yahoo.com/rss/topstories" > "

  • Err: ORA-31011: failed to parse XML

    Hello

    While inserting the XML code in the table, I faced slot problem, Pls suggest a way out of the code.
    Your help is appreciate.
    I'm using the version of Oracle - 10.2.0.2.0

    Err: ORA-31011: failed to parse XML
    ORA-19202: an error has occurred in the processing of XML
    LPX-00234: the 'xsi' namespace prefix is not declared
    Error on line 1
    ORA-06512: at "SYS." XMLTYPE", line 254
    ORA-06512: at line 1

    -Step 1
    CREATE TABLE EMP (EMPCODE NUMBER (8), EMPNAME VARCHAR2 (100), THE NUMBER OF EMPDEPTNO (8), NUMBER EMPSAL (34.2));
    /
    -Step 2
    BEGIN
    FOR X IN (SELECT * FROM USER_OBJECTS S WHERE ROWNUM < = 50)
    LOOP
    INSERT INTO VALUES EMP (X.OBJECT_ID, X.OBJECT_NAME, 20, X.OBJECT_ID + 10);
    END LOOP;
    COMMIT;
    END;
    /
    -Step 3
    create the table EMPXML (XMLCLOB XMLTYPE);
    /
    -Step 4
    DECLARE
    v_xmldata CLOB.
    v_tmpdata CLOB.
    v_xmltype XMLTYPE.
    BEGIN
    DBMS_LOB.CREATETEMPORARY (v_tmpdata, false);
    v_xmldata: = ' <? XML version = "1.0" encoding = "UTF-8"? > ';

    SELECT Xmlelement ("employee",

    XmlAttributes ("http://ns.oracle.com.tw/XSD/ORACLE/ESB/Message/EMF/ServiceEnvelope" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" AS ")
    "xmlns:ns0,"
    ' http://ns.oracle.com.tw/XSD/ORACLE/ESB/Message/EMF/ServiceEnvelope ServiceEnvelope.xsd > ' AS
    ("xsi: schemaLocation").
    XMLAGG (Xmlforest (AS Empcode "EmpID",
    EmpName AS "EmpName",.
    Empsal AS 'EmpSal'))) BY v_xmltype
    FROM Emp
    WHERE Empdeptno = 20;

    SELECT v_xmltype.getCLOBVal () IN the v_tmpdata FROM dual;

    DBMS_LOB. Append (v_xmldata, v_tmpdata);

    BEGIN
    INSERT IN EMPXML VALUES (xmltype (v_xmldata));
    EXCEPTION WHEN OTHERS THEN
    dbms_output.put_line ('Err: ' |) SQLERRM);
    END;
    END;
    /
    -Step 5
    SELECT * from empxml;
    /
    -Step 6
    DROP TABLE EMP PURGE;
    /
    -Step 7
    DROP TABLE EMPXML PURGE;
    /
    Thank you and best regards,
    Yogesh Nagle
    India

    What? Pepijn you provided the correct use of Xmlattributes and showed that your script would go without errors. What is the problem with his answer or it does not that you need it?

  • XML Feed to Flash

    Hello Forum,
    I'm trying to parse an RSS feed which is a page of Flash. But Im having troubles, I wonder if someone could help me with some advice-entries/hits something out links for photo, text and attributes of the RSS so I can do flash with dynamic images.

    I found two components but I can't get it to work.
    http://code.Google.com/p/AS3corelib/
    http://code.Google.com/p/as3syndicationlib/

    Also this tutorial, but it seems confusing. Can someone help if I can get on some articles, tutorials or something. ? http://www.Ploem.be/blog/?page_id=105

    the RSS is here:

    Assuming that you have the XML in a variable named rss, you can get to the
    individual items as follows:

    trace (RSS. Channel.Item.length ());
    4

    trace (RSS. Channel.Item [3] .title);
    ProductName Delta

    trace (RSS. Channel.Item [3]. Description);
    //

    SRC="domain.dk/images/produktbilleder/foto-PAA-Vej-t.jpg" / >
    <>
    / > c

    at eros. SED porta, sapien, ornare dapibus feugiat,


    PRI:? 1.250,00? DKK

    HTH
    I let you do the string manipulation required to get the jpg file of
    it.

    --
    Dave-
    www.offroadfire.com
    Developer leader
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.Adobe.com/communities/experts/

  • parse xml timestamp labview in javascript

    Hi, im reading XML files created from labview7.1 with javascript and it works fine, the only problem is that I don't know how to parse the timestamp. For DS

    ...


    Date of Eximination


    4


    0



    0



    -916291696



    0


    ...

    should be the date of 2011-01-24 and

    ...


    Date of Eximination


    4


    0



    0



    -916205296



    0


    ...

    2011-01-25 indices?

    It seems to work

    
    
    
    
  • Problem of Parsing XML

    Hi all

    I have a XML Data...

    As

    
    
        
        
        
        
        
        
        
        
        
        
    
    
    

    I want to get the name of node and its values...

    But I'm not able to analyze and get access those.

    I tried using DOM parser.

    Everyone please help.

    Thanks and greetings

    Stephenson

    Similar to what manojkbaghela wrote:

    DocumentBuilderFactory docFact = DocumentBuilderFactory.newInstance ();
    DocumentBuilder docBuilder = docFact.newDocumentBuilder ();

    Doc document = docBuilder.parse ({inputSource file});
    doc.getDocumentElement () .normalize ();
    NodeList listOfRecords = doc.getElementsByTagName ("node");
    int totalElements = listOfRecords.getLength ();

    for (int s = 0; s< totalelements;="" s++)="">

    Element myElement = listOfRecords.item (s) (element);

    LinkID = myElement.getAttribute ("LinkID") string;
    String subject = myElement.getAttribute ("Topic");
    Position of the string = myElement.getAttribute ("heading");

    }

Maybe you are looking for