How to read XML tags in a file, one at a time?

My file format is:
<main>
<section>
(many tags, some including CDATA)
</section>
<section>
(many tags, some including CDATA)
</section>
many more <section>s (over a million)
</main>
To avoid reading all the <section>s into memory, how can I read one <section> at a time?
Thanks in advance.

sunmhe wrote:
To avoid reading all the <section>s into memory, how can I read one <section> at a time?If you really want to process huge XML's; you can use SAX or STAX API.

Similar Messages

  • How to Read XML tags....

    Hi guys...
    Can any one here tell me how to read the XML tag in PL/SQL.
    In table Enquiry there are following fields.
    Id          number
    Status          varchar2(5)
    Request          XML
    Reply          XML
    Error          varchar2(10)
    Now the following XML will be in request column from the requester.
    I have to get the,
    ->request which is in BODY tag,
    ->ID number which is in from tag (its the persons unique ID to check his BILL)
    Fetch the request from the database and updates it into the REPLY field with the same syntax.
    <message>
    <to> 123 </to>
    <from>789</from>
    <body> unbill </body>
    <messagenumber> 01 </messagenumber>
    </message>
    Can any one have the solution to this, how can I read the XML tags, process & again inserts as an XML.
    Thanks.

    Maybe something like this will be a pointer...
    SQL> CREATE TABLE t AS
      2  select 1 as id, 'C' as status, XMLTYPE('<message><to>123</to><from>789</from><body>unbill</body><messagenumber>01</messagenumber></message>') as request, XMLTYPE('<reply/>') as reply, 'NO ERROR' as error from dual
      3  ;
    Table created.
    SQL>
    SQL> SELECT * from t;
            ID S
    REQUEST
    REPLY
    ERROR
             1 C
    <message><to>123</to><from>789</from><body>unbill</body><messagenumber>01</messagenumber></message>
    <reply/>
    NO ERROR
    SQL>
    SQL> UPDATE t
      2  SET reply = updateXML(request,'/message/body/text()','bill')
      3  ;
    1 row updated.
    SQL>
    SQL> SELECT * from t;
            ID S
    REQUEST
    REPLY
    ERROR
             1 C
    <message><to>123</to><from>789</from><body>unbill</body><messagenumber>01</messagenumber></message>
    <message><to>123</to><from>789</from><body>bill</body><messagenumber>01</messagenumber></message>
    NO ERROR
    SQL>

  • How to read xml data in ajava file?

    Hi,
    I am very new to web servies. I am having a xml file, which has some data. I want to get tht data in my java class.How can I do tht? i would appreciate if anyone help me out.

    http://java.sun.com/webservices/docs/1.6/tutorial/doc/index.html

  • How to read a tag of a video file

    i try to create an application that can read audio and video file with java.
    But my probleme now is that ican't read the tag of video file.
    can you help me about how to read the tag of video file like the duration of video and frame rate and the other information about the video file.Thanks

    i try to create an application that can read audio and video file with java.
    But my probleme now is that ican't read the tag of video file.
    can you help me about how to read the tag of video file like the duration of video and frame rate and the other information about the video file.Thanks

  • How to read xml file and place it into an internal table...

    hello all,
    can any one help me in - how to read xml data file (placed in application server) and placing the same into an internal table (remove the xml tags or say fetching the xml data without xml tags).

    Hi Murashali,
    use this.
    TYPES: BEGIN OF day,
    name TYPE string,
    work(1) TYPE c,
    END OF day.
    DATA: BEGIN OF week,
    day1 TYPE day,
    day2 TYPE day,
    day3 TYPE day,
    day4 TYPE day,
    day5 TYPE day,
    day6 TYPE day,
    day7 TYPE day,
    END OF week.
    DATA xml_string TYPE string.
    DATA result LIKE week.
    week-day1-name = 'Monday'. week-day1-work = 'X'.
    week-day2-name = 'Tuesday'. week-day2-work = 'X'.
    week-day3-name = 'Wednesday'. week-day3-work = 'X'.
    week-day4-name = 'Thursday'. week-day4-work = 'X'.
    week-day5-name = 'Friday'. week-day5-work = 'X'.
    week-day6-name = 'Saturday'. week-day6-work = ' '.
    week-day7-name = 'Sunday'. week-day7-work = ' '.
    CALL TRANSFORMATION ...
    SOURCE root = week
    RESULT XML xml_string.
    CALL TRANSFORMATION ...
    SOURCE XML xml_string
    RESULT root = result.
    Regards,
    Vijay

  • How to read the data from Excel file and Store in XML file using java

    Hi All,
    I got a problem with Excel file.
    My problem is how to read the data from Excel file and Store in XML file using java excel api.
    For getting the data from Excel file what are all the steps i need to follow to get the correct result.
    Any body can send me the code (with java code ,Excel sheet) to this mail id : [email protected]
    Thanks & Regards,
    Sreenu,
    [email protected],
    india,

    If you want someone to do your work, please have the courtesy to provide payment.
    http://www.rentacoder.com

  • How to read .xml file from embedded .swf(flash output) in captivate

    I have been trying to read .xml file from the .swf (Flash output) that is embedded within the captivate file but no luck yet . Please if anyone got any clue on how get this thing done using Action script 3.0 then let me know. I am using Adobe Captivate 5.5 at present and Flash CS 5.5.
    I am well aware about how to read .xml file through action script 3.0 in flash but when insert the same flash in captivate and publish nothing comes in captivate output. I would higly appreciate if anyone could help me out with that.
    Here is is graphical demonstration of my query :
    Message was edited by: captainmkv

    Hi Captainmkv,
    Does the information in this post cover what you're trying to do: http://forums.adobe.com/message/5081928#5081928
    Tristan,

  • How to read xml file as shown below.

    Hello,
    I am using flash builder 4 and currently working on implementing AIR application.
    I need to read xml file data.
    Normal xml files are easy to read and i am much more aware of it.
    But can any one have idea how to read XML file which is given below.
    <node>
    <key>ID</key>
    <integer>1</integer>
    <key>Name</key>
    <string>Dhwani</string>
    <key>Postno</key>
    <integer>20</integer>
    <key>deskname</key>
    <string>flex</string>
    <key>empid</key>
    <integer>25</integer>
    <key>projectname</key>
    <string>abc</string>
    </node>
    Here i have xml file in form of key value pair. <key> node shows name of the key and after that <integer> or <string> node are the value for that specific key.
    if i select node.key then it shows me all the keys. and from that i cant make out what is the value for key ID.
    Is there any way to take first node and then second. i mean first i ll take value of key and store it into some arraycollection. and then value will be stored.
    Any help is appreciated.. Looking for positive reply.
    Thanks
    Dhwani

    There are different methods to access XML data which have pro's and cons. Let us know more about what you want to do and we can help you.

  • How to read XML file and write into another XML file

    Hi all, I am new to JAVAXML.
    My problem is I have to read one XML file and take some Nodes from that and write these nodes into another XML file...
    I solved, how to read XML file
    But I don't know how to Write nodes into another XML.
    Can anyone help in this???
    Thanks in advance..

    This was answered a bit ago. There was a thread called "XML Mergine" that started on Sept 14th. It has a lot of information about what it takes to copy nodes from one XML Document object into another.
    Dave Patterson

  • How to read XML file and update the data in MS CRM 2011?

    Hi Folks,
    Can anyone please help me finding some references to read XML files and push the data to MS CRM 2011 preferably by using a console application.
    Please let me know if any ways of handling it in simple ways.
    Thanks,
    Sri

    HI,
    How to read XML file:
    https://social.msdn.microsoft.com/Forums/en-US/5dd7261b-86c4-4ca8-ba87-95196ef3ba50/need-to-display-xml-file-in-textboxes-edit-the-data-and-save-the-new-xml-file?forum=csharpgeneral
    How to work with CRM:
    ClientCredentials credentials = new ClientCredentials();
    credentials.Windows.ClientCredential = new System.Net.NetworkCredential("USER", "Password", "Domain");
    Uri uri = new Uri("http://server/Organization/XRMServices/2011/Organization.svc");
    OrganizationServiceProxy proxy = new OrganizationServiceProxy(uri, null, credentials, null);
    proxy.ServiceConfiguration.CurrentServiceEndpoint.Behaviors.Add(new ProxyTypesBehavior());
    IOrganizationService service = (IOrganizationService)proxy;
    //using "service" you can create, update and retrieve entities.
    More information here about service functions:
    https://msdn.microsoft.com/en-us/library/gg328198.aspx

  • How to read MG1, MGU, SG1, SGU files?

    I have copies of Band in a Box and Aebersold music software, from an older PC.
    How to read MG1, MGU, SG1, SGU files on my MacBook Air?
    Many thanks, Antoine

    I believe in Linux/Unix, everything is treated as a file descriptor, be it a disk, socket, hardware device or an actual file. Since Java will simply call the appropriate method (length() for example) on the descriptor, I would imagine it would be up to the operating system to determine what to return. If I ask for the length() of a socket, I'm not sure what it would return. The bytes not flushed in the buffer? Total transmitted? Some random uid? I'm sure it is defined somewhere but the behavior may not be what you expect. See if you can use a 'vanilla' command-line method to get the file length from that device. If it too returns zero, you know it's not your program.
    - Saish

  • How to read the complete path in file upload UI

    Hi,
    I want to know how to read the complete path in file upload UI in java web dynpro.
    I have created 1 file upload UI and than when i do browse and select some file say small.jpg from my local PC, desktop , its path is coming in file upload UI like E:\small.jpg,
    I want to know how to get this path in java webdynpro code.
    please let me know..

    Hi Satyam,
    In webdynpro java, first file stores in server location then it reads from server.
    Create a button with upload and write this code OnAction
    Resource is the attribute name in context of type com.sap.ide.webdynpro.uielementdefinitions.Resource, this attribute is for Resource property for Upload UI Element.
    Then in OnAction of button
    InputStream text = null;
           int temp=0;
           try{
                File file = new File(wdContext.currentContextElement().getResource().getResourceName().toString());
               String path = file.getAbsolutePath();
                wdComponentAPI.getMessageManager().reportSuccess(path);
           }catch(Exception e){
                e.printStackTrace();
        //@@end
    Regards,
    Pradeep
    Edited by: pradeep_546 on May 11, 2011 12:22 PM

  • How to read xml

    I'm getting xml from   customFieldsFeed.getEnumerationValues()  it is comming from  a web services looks like this
    <xml-fragment xmlns:b=""http://schemas.microsoft.com/2003/10/Serialization/Arrays""
    xmlns:i=""http://www.w3.org/2001/XMLSchema-instance""
    xmlns:a=""http://schemas.xxxxxxxx""
    xmlns:u=""http://docs.oasis-open.org/wss/xxxxxxx-utility-1.0.xsd""
    xmlns:s=""http://schemas.xmlsoap.org/soap/envelope/"">
      <b:anyType i:type=""a:Enumeration"">
        <a:EnumerationID>AAAAA</a:EnumerationID>
        <a:Name>A3 MFD</a:Name>
      </b:anyType>
      <b:anyType i:type=""a:Enumeration"">
        <a:EnumerationID>BBBBB</a:EnumerationID>
        <a:Name>A3 Printer</a:Name>
      </b:anyType>
      <b:anyType i:type=""a:Enumeration"">
        <a:EnumerationID>CCCCC</a:EnumerationID>
        <a:Name>A4 MFP</a:Name>
      </b:anyType>
    </xml-fragment>"
    I need to read EnumerationID ex if AAAAA need to retrive Name value " A3 MFD"
    java 1.6
    Thanks,
    HJ

    This could be a starting point:
    http://stackoverflow.com/questions/2811001/how-to-read-xml-using-xpath-in-java
    bye
    TPD

  • How to read and upload microsoft word file into database using forms9i

    Hi,
    How to read and upload microsoft word file into oracle database using forms9i. I appretiate if anyone can send me example or atleast a sujjetion.
    Thanks in advance
    Mahesh Ragineni

    The webutil package includes the ability up upload from the client to the database. See otn.oracle.com/products/forms and click on webutil for more details.
    Regards
    Grant Ronald
    Forms Product Management

  • How to read ID3-tags

    Hi,
    Is there somebody who can explain me how to read ID3tags from a mp3-file.
    I searched whole google and didn't find a clear explanation.
    Sorry for my bad english.
    Maybe someone got an example?
    Thnx

    The source contains examples:
    http://www.ueberdosis.de/java/id3/download.html
    regards
    Christian

Maybe you are looking for

  • Can you see which timeline clips are being used in Media Browser?

    I'm a relatively new user and may not be familiar enough with cs5.5 but is there a way to see what clips are being used on the editing timeline in the media browser. I open premiere pro - Project is loaded. I edit the scene until it is finished. When

  • General users can't open web analysis reports as html

    Hi guys, I am facing an issue about Web Analysis. When I use the version pre-9, I can access web analysis directly with html client or java client.Then I set each user with each POV. Now I am using EPM11.1.1.3, I can just access web analysis by works

  • Business Partner Relationship

    Hi All, I have requirement when in I need to store single value fields, multi-value fields and also standard BP fields (like Address, telecom) within a BP Relationship. Requirement: A student and university are two business partners. Student and univ

  • Error Handling for JSF!

    Hi, i have a third party jar file, and in some code of it, methods are not declared to throw any exception, but actually, in the method, there is a try-catch block, and in the catch block, it does some logging work, and then just throw the exception

  • About database file size

    Hi, I have created a database with size of 1000MB and log file1000MB by default. After database created, my data load failed because the db size has exceed 1GB, I try to increase the size but not success. Then I try to create a new database with 1000