Skip to content

Overview

Development

Overview

IDEs

API Explorer

examples Package: Reading a Large XML File Using an XML Cursor

It is practical to use cursors when reading large files. The examples package demonstrates how to use an XML cursor to read a large XML file; simply check out the xmlCursor.ReadLargeXmlFile.gloop service.

Related articles

Please see the following articles for more information:

Try It!

Under the Coder Navigator, expand the examples package entry and navigate to the code folder. Afterwards, look for the xmlCursor package. This package contains models and Gloop services shown below:

1
2
3
4
5
6
7
8
9
examples
├── ...
└── code
    └── xmlCursor
        ├── ReadLargeXmlFile.gloop
        └── models
            ├── Footer.model
            ├── Header.model
            └── Record.model

Open to inspect and run the xmlCursor.ReadLargeXmlFile.gloop service to learn how XML input cursors work.

Output of ReadLargeXmlFile.gloop

1
2
3
4
5
6
7
24/04/18 15:44:12.331 INFO  [Integrate] Header details are: This is the header for 1000 random people records
24/04/18 15:44:12.424 INFO  [Integrate] The name in record 1 is Wald Seys
24/04/18 15:44:12.434 INFO  [Integrate] The name in record 2 is Rolland Matthieson
24/04/18 15:44:12.441 INFO  [Integrate] The name in record 3 is Carey Nickolls
...
24/04/18 15:44:24.475 INFO  [Integrate] The name in record 1000 is Justin Whye
24/04/18 15:44:24.554 INFO  [Integrate] The trailer description is The trailer description goes here

How It Works...

Reading a large XML file would take quite some time to do. The example service provided demonstrates how easy and fast it is to read a large XML file using an XML cursor.