You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Jon Smirl <jo...@mediaone.net> on 2000/06/04 03:14:07 UTC

SAX to DOM to SAX

I'm considering use of xalan-c in a project I working on and I see that
xalan's DOM support comes from xerces. I would like to be able to create a
DOM tree from SAX events. I've been poking around the source for a few hours
now and I can't find a method for doing this. Does the xerces-c DOM support
this?

The utilities I'm looking for are:
1) use SAX event to build a DOM tree
2) generate SAX events from a DOM tree
3) convert SAX events to an XML text stream.

Jon Smirl
jonsmirl@mediaone.net



Re: SAX to DOM to SAX

Posted by Dean Roddey <dr...@charmedquark.com>.
No, those types of things are not available in the C++ parser at this time.
We've really just started getting the kinds of underlying support in place
to be able to handle that (there are a lot of transcoding and formatting
issues which are going to be dealt with in the upcoming release, and later
releases will use it to provide some of this type of stuff.)

--------------------------
Dean Roddey
The CIDLib Class Libraries
Charmed Quark Software
droddey@charmedquark.com
http://www.charmedquark.com

"Give me immortality, or give me death"

----- Original Message -----
From: "Jon Smirl" <jo...@mediaone.net>
To: "xerces" <xe...@xml.apache.org>
Sent: Saturday, June 03, 2000 6:14 PM
Subject: SAX to DOM to SAX


> I'm considering use of xalan-c in a project I working on and I see that
> xalan's DOM support comes from xerces. I would like to be able to create a
> DOM tree from SAX events. I've been poking around the source for a few
hours
> now and I can't find a method for doing this. Does the xerces-c DOM
support
> this?
>



Re: SAX to DOM to SAX

Posted by Jon Smirl <jo...@mediaone.net>.
Actually the code already exists in the Xalan-c project in XMLSupport
directory. I just hadn't found it yet when I first sent the message. I've
been working with it the last couple of days to see if I can make it do what
I want.

Jon Smirl
jonsmirl@mediaone.net


Re: SAX to DOM to SAX

Posted by Murray Todd Williams <mu...@verinet.com>.
I know the following comment will fall into the "ya want it?  Code it and
contribute it!" category, but I think that these simple operations really
should be included with Xerces (both C++ and Java versions).  I have neither
the coding finesse to do it myself, nor the time (I'm busy managing RPMs for
all these projects).

I do have a recommendation, if you decide to embark on these rather simple
operations yourself.  The classes you're looking for HAVE been implemented in
Java in the Cocoon project's API.  Since Xalan and Xerces C++ packages follow
the architecture of the Java packages quite closely, it may serve you to see
how the Cocoon team did it and make a close imitation.

Hope that helps somewhat.

Murray Todd Williams



Jon Smirl wrote:

> I'm considering use of xalan-c in a project I working on and I see that
> xalan's DOM support comes from xerces. I would like to be able to create a
> DOM tree from SAX events. I've been poking around the source for a few hours
> now and I can't find a method for doing this. Does the xerces-c DOM support
> this?
>
> The utilities I'm looking for are:
> 1) use SAX event to build a DOM tree
> 2) generate SAX events from a DOM tree
> 3) convert SAX events to an XML text stream.
>
> Jon Smirl
> jonsmirl@mediaone.net
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: SAX to DOM to SAX

Posted by Andy Heninger <an...@jtcsv.com>.
From: "Jon Smirl" <jo...@mediaone.net>
>I would like to be able to create a
> DOM tree from SAX events. I've been poking around the source for a few
hours
> now and I can't find a method for doing this. Does the xerces-c DOM
support
> this?

Not directly.  But the code in c:\src\parsers\DOMParser is very close, the
difference being that it uses the parsers native document handler rather
than the SAX one.  They're quite similar in flavor, although the native
one provides more information.

> The utilities I'm looking for are:
> 1) use SAX event to build a DOM tree
> 2) generate SAX events from a DOM tree


> 3) convert SAX events to an XML text stream.
Look at the SAXPrint sample program for code to do this.


Andy Heninger
IBM XML Technology Group, Cupertino, CA
heninger@us.ibm.com