OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   New RAX with write capabilities + Website

[ Lists Home | Date Index | Thread Index ]
  • From: Sean McGrath <digitome@iol.ie>
  • To: <xml-dev@xml.org>
  • Date: Wed, 03 May 2000 19:32:53 +0100

I have put RAX (Record API for XML) on the Web at

http://www.digitome.com/rax.html

I have added writing capabilities so you can now use RAX as
a "pull API" for read/write XML applications. Simply put,
you can read records, modify them and write them out again
as XML.

RAX is intended to present programmers with a drop-dead easy API for
processing record-oriented XML. The reference implementation
is Python but it should be very easy to port it to
other languages.

Contributions to the evolution of RAX and contributions
in other languages are hereby solicited!

>From the docstring:-

A simple, record-oriented API for XML. Provides a simple, efficient
interface for processing the sort of XML often generated from
databases.

See http://www.xml.com/pub/2000/04/26/rax for an introductory
article. 

RAX processes the PYX notation for parsed XML introduced
in http://www.xml.com/pub/2000/03/15/feature/index.html.

PYX generators are freely available from http://www.pyxie.org.
 xmln : generate PYX using non-validating XML parse
 xmlv : generate PYX using validating XML parse

RAX consists of two very simple interfaces:
	The RAX Interface
	The Record Interface

The RAX Interface
	SetRecord - Tell RAX what the top level record element is.
	ReadRecord - Read a record
	WriteRecord - Write a record to XML format

The Record Interface
	GetElement - Retrieve the value of an element
	SetElement - Set the value of an element

Sample RAX Usage:
	from RAX import RAX,Record
    import os

	# Parse XML to PYX notation Pipe
	fo = os.popen ("xmln customers.xml")
	R = RAX(fo)
    # Tell RAX that the "Record" element is the top level element
	R.SetRecord("Record")
	rec = R.ReadRecord()
	while rec:
		  # Get value of "Phone" element
		  x = rec.GetElement ("Phone")
		  # Set phone element to "12345"
		  rec.SetElement("Phone","12345")
		  # Write out modified record
		  R.WriteRecord (rec)

		  rec = R.ReadRecord()

regards,
Sean McGrath


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




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS