[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]


  • From: "Robert Hanson" <rhanson@b...>
  • To: <perl-xml@l...>
  • Date: Sat, 29 Apr 2000 15:55:30 -0400

rax xml
I don't know how many people have had a chance to read Sean McGrath's
article on RAX yesterday, but he defines a very simple API for reading XML

What he has done is let the programmer read in the information just as you
would normally read a recordset... record by record, and field by field.  I
admit that not all XML documents fit into records and fields, but in cases
where it does, using the RAX API is much simpler than using SAX or DOM.

Because RAX is "record-oriented", it is stream based, and you get the
benefit of not having to load the entire document into memory like you would
if you were using DOM.

In Sean's article (http://www.xml.com/pub/2000/04/26/rax/index.html) he
describes the API and gives a Python implementation of RAX.  What I have
done is taken his API and created a Perl implementation.

Currently the module is only available be emailing me (rhanson@b...)
until I get it up on a web site.  When I find a home for it, I'll post that
information to the XML-Perl list.

The POD distributed with XML::RAX follows...


XML::RAX - Record-oriented API for XML



use XML::RAX;
my $R = new XML::RAX();

# open from XML data
$R->open( $xml_text );

# open XML from file
$R->openfile( 'test.xml' );

# iterate through recordset
my $rec = $R->readRecord();

while ( $rec )

  print "Phone = ''.$rec->getField('Phone').``\n'';
  $rec = $R->readRecord();



This interface allows you to access an XML document as you would a database
recordset. In instances where the XML document fits a record/field type
format, using the RAX interface will usually be simpler than using DOM or
SAX to access the data.

XML::RAX requires XML::Parser.

See Sean McGrath's article on RAX for an good overview of RAX:



Robert Hanson



The RAX API was created by Sean McGrath and first introduced in his article
on XML.com.



Copyright (c) 2000 Robert Hanson. All rights reserved. This program is free
software; you can redistribute it and/or modify it under the same terms as
Perl itself.

This is xml-dev, the mailing list for XML developers.
To unsubscribe, mailto:majordomo@x...&BODY=unsubscribe%20xml-dev
List archives are available at http://xml.org/archives/xml-dev/


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.

Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.