Skip to content

Home

Introduction

Development

IDEs

Services

API Explorer

Releases

Release notes

Martini Runtime

Martini Desktop

Martini Online

Feature requests

Bug reports

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 Navigator, expand the examples package 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  [Martini] Header details are: This is the header for 1000 random people records
24/04/18 15:44:12.424 INFO  [Martini] The name in record 1 is Wald Seys
24/04/18 15:44:12.434 INFO  [Martini] The name in record 2 is Rolland Matthieson
24/04/18 15:44:12.441 INFO  [Martini] The name in record 3 is Carey Nickolls
...
24/04/18 15:44:24.475 INFO  [Martini] The name in record 1000 is Justin Whye
24/04/18 15:44:24.554 INFO  [Martini] The trailer description is The trailer description goes here

Explanation

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.