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

Re: XML Java API Standardization

  • From: Steven Ball <steve@c...>
  • To: xml-dev@i...
  • Date: Mon, 23 Jun 1997 09:56:35 +1000

how to parse in java
> (I am not a Java person so I don't know the syntax for doing the following
> in Java...)

I'm no Java-phile either ;-)

> The idea is to 
> 
> 1) have a textual representation of an XML document as a Python program
> 2) be able to re-create textual representations of XML document structures
> as Python programs

I've done essentially the same thing for Tcl.  My XML parser emits a
"Heirarchical Tcl List Representation" of an XML document.  For example:

set doc {<?XML VERSION="1.0"?>
<!DOCTYPE MEMO SYSTEM "memo.dtd">
<MEMO REF="1234">
<TO>Audience</TO>
<FROM>Steve</FROM>
<MESSAGE>This is XML!</MESSAGE>
</MEMO>}

XML::parse $doc

returns ==>

parse:pi ?XML {VERSION 1.0} {}
parse:pi !DOCTYPE {SYSTEM memo.dtd} {} 
parse:elem MEMO {REF 1234} {
    parse:elem TO {} {
        parse:text Audience {} {}
    }
    parse:elem FROM {} {
        parse:text Steve {} {}
    }
    parse:elem MESSAGE {} {
        parse:text {This is XML!} {} {}
    }
}

(above has been edited slightly for email-readability)

This representation has two features: it can be easily manipulated
as a list, especially with the dummy arguments to parse:pi and parse:text,
and it can be passed to the `eval' command for execution - the element contents
are themselves scripts.

> 1) Such structures give an immediate API in the form of Lispy list
> processing stuff.
> 2) Such structures allow parsers to be compared / checked for correct
> interpretation of XML.
> 3) Such structures give developers something to aim at when developing XML
> markup aware tools.

Agreed, and the similarity of our (independent) approaches is noteworthy.
My only comment is that (2) is modulo list syntax.

Cheers,
Steve Ball


xml-dev: A list for W3C XML Developers
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To unsubscribe, send to majordomo@i... the following message;
unsubscribe xml-dev
List coordinator, Henry Rzepa (rzepa@i...)


PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.