OS4 DepotLogo by Nickman 
(anonymous IP:,2219) 

   Bug tracker
   Locale browser


   o Audio (343)
   o Datatype (51)
   o Demo (203)
   o Development (600)
   o Document (22)
   o Driver (97)
   o Emulation (148)
   o Game (1005)
   o Graphics (499)
   o Library (116)
   o Network (233)
   o Office (66)
   o Utility (927)
   o Video (69)

Total files: 4379

Full index file
Recent index file



Support the site

 Readme for:  Utility » Text » Misc » arexxxml.lha


Description: Parse XML in ARexx
Download: arexxxml.lha       (TIPS: Use the right click menu if your browser takes you back here all the time)
Size: 205kb
Version: 1.1
Date: 06 Dec 2009
Author: Joakim Nordström
Submitter: Joakim Nordström
Email: joakim nordstrom/gmail com
Requirements: expat.library uni.library (http-handler, optional)
Category: utility/text/misc
Replaces: utility/text/arexxxml.lha
License: Other
Distribute: yes
Min OS Version: 4.0
FileID: 5191
Comments: 2
Snapshots: 0
Videos: 0
Downloads: 197  (Current version)
235  (Accumulated)
Votes: 1 (0/0)  (30 days/7 days)

Show comments Show snapshots Show videos Show content Show crashlogs Replace file 
Version:        1.1
Author:         Joakim Nordström
Date:           2009-12-03
Requirements:   OS4, expat.library, uni.library, [http-handler]

What is it?
ARexxXml is an ARexx interface for reading XML files.

How does it work?
When started, ARexxXml creates an ARexx-port, AREXXXML.

Assume a XML-file like below:
        <mojo temp="foo">Pop<mojo/>
        <mojo temp="bar">Funk<mojo/>

Now, with one simple ARexx-command:

GETTAG "test.mojo(temp)"

we would get the value "foo" which is the attribute "temp"
of element "mojo".

ArexxXml takes one optional argument:
NEWPORT/S               Should the ARexx-port create a new
    ARexx-port, like AREXXXML.1, AREXXXML.2 etc, or should
    AREXXXML always (tried to) be opened. The default is
    to always use AREXXXML.

The ARexx-port support these commands:
    Loads an XML-file into memory. Relative to ARexxXml home-drawer.
    Tries to retrieve a tag-structure from the XML-file.
    Each element is one string, child elements are preceded by
    a point. The content of <info> in test.xml would be returned
    with the command tag-string "test.info".
    Attributes are given in parentheses. the "temp" attribute of
    tag <mojo> would be "test.mojo(temp)"
    Multiple tags can be iterated with a []-notation and an index,
    starting at 0. The <mojo>-tag with content "FUNK" could be
    reached with "test.mojo[1]", and its temp-attribute with
    The number of multiple tags can be returned with the special
    "length"-index. "test.mojo[length]" would in this case return 2.
    If an element can't be found, the result code 5 is returned.

    Closes the XML file and removes it from memory.
	After a CLOSE, only the file and its resources are freed, the
    ARexx-port and program are still in memory.
    Quits ArexxXml and removes the ARexx-port.
	This quits and removes the entire ARexx-port and program.

Each command can return these codes:
    Code Error
    5  	Element not found
    10	You forgot to supply tag in GETTAG-command
    16 	The XMl isnt valid
    17  No file was loaded when trying to call "GETTAG"
    18 	File couldn't be found
    19 	File couldn't be read
    20 	Couldn't allocate memory


A few examples are provided in the ExampleScripts drawer:
    Gets the first 20 email in your gmail inbox, using the
    GMail ATOM feed.
    This script requires http.handler from os4depot.net
    (network/misc/httphandler.lha) by Chris Young.

    Reads asx-files and starta mplayer for viewing.
    Requires MPlayer.

    Retrieves titles from YouTube.
    Also requires http-handler. (See GMail.rexx)

    Lists all programs you have started.

Copy ARexxXML to path.

Make sure you have expat.library in Libs

For UTF-8 decoding, you must have uni.library installed

To handle URLs you need HTTP-handler (really not needed
by ARexxXML, but nice to use in scripts)

Release notes:
v 1.1 2009-12-03

* Added support for Unicode
* Fixed so files larger than 8k can be read (doh!)
* URL-support can be achieved by using HTTP-handler
  (see examples)
* Added NEWPORT argument.

v 1.0 2009-11-11

* Initial release


* Make it possible to traverse the XML-file tag by tag in ARexx


Files have to be fully resolved, ie, DH1:Temp/test.xml, or relative
to the actual ArexxXml-binaries startpath.

Copyright © 2004-2024 by Björn Hagström All Rights Reserved