build a hierarchical tree, without using DOM,schema, and sax using

build a hierarchical tree, without using DOM,schema, and sax using

am 16.11.2007 10:31:44 von sharan

I've been experimenting with the jclark's expat parser. I compiled it
on
linux, and it works just great. However, finding tags and data by
implementing the callback functions in c language is cumbersome.
Has anybody written code that uses the expat callback's in such a way
as to
build a hierarchical tree, without using DOM,schema, and sax, that can
be traversed.My purpose, just enough to traverse branches and find
leafs of a xml documents without using DOM, schema, and sax, and i
also want help regarding how to convert a xml document to a
hierachical tree which contains tags values. thanks

Re: build a hierarchical tree, without using DOM,schema, and sax

am 16.11.2007 10:41:13 von Janis Papanagnou

On 16 Nov., 10:31, sharan wrote:
> I've been experimenting with the jclark's expat parser. I compiled it
> on
> linux, and it works just great. However, finding tags and data by
> implementing the callback functions in c language is cumbersome.
> Has anybody written code that uses the expat callback's in such a way
> as to
> build a hierarchical tree, without using DOM,schema, and sax, that can
> be traversed.My purpose, just enough to traverse branches and find
> leafs of a xml documents without using DOM, schema, and sax, and i
> also want help regarding how to convert a xml document to a
> hierachical tree which contains tags values. thanks

Have a look into xgawk, an extension of GNU awk for XML processing
(the xgawk tool makes also use of the expat parser, AFAIR).

Janis

Re: build a hierarchical tree, without using DOM,schema, and sax

am 20.11.2007 03:55:47 von brian_hiles

sharan wrote:
> convert XML hierarchical tree, without using DOM, schema, and sax,
> ...
> to hierachical tree which contains tags values. thanks.

It's not as complete, or robust as xgawk(1) -- actually, both are beta
software -- but as you are asking in C.U.S., not comp.lang.awk, it
may fit your simple needs:

"xmldocumenttree1.ksh93": convert .XML to DOM-like compound-variable
hierarchy
http://mail.opensolaris.org/pipermail/ksh93-integration-disc uss/2007-August/005625.html
(ksh93 script with example XML file and output)

=Brian