Re: [gdome]serializing a node



Hi,

 thanks for the replys sorry I wasn't clear enough in my first message.

What I'm doing is cut/copy/paste part of the dom using selections. This may
then be inserted into the same app or another app that can do something
meaningfull with part of the dom or it can be converted into text, html, or
whatever is useful to the client.

I've got it working by converting the node to xml with xmlNodeDump passing
it to the client which re-parses it and inserts it into the Dom (or if it's
something that wants text it just gets the xml).

I have no idea if this is the best way of doing it so any sugestions are
welcome.

The app itself is just a cTree represention of the dom. It allows you to
edit the dom buy moveing bits of it around, inserting nodes, deleting
nodes, cut/copy/paste nodes, editing attributes and text nodes etc. By the
end of the week it should also be able to ensure that the changes you make
are valid. 

This is my first C app, also first GNOME app, also first xml app so...






On Tue, 10 Apr 2001 12:47:47 Daniel Veillard wrote:
> On Tue, Apr 10, 2001 at 12:55:03PM +0200, Paolo Casarini wrote:
> > 
> > 
> > On Fri, 6 Apr 2001, rob wrote:
> > 
> > > Is there a way to serialize a gdome node?
> > Serialize a DOM node is not a simple task.
> > If you explain better why and in what context you need it, I can try to
> > study a way to do it correctly and implement it.
> 
>   Actually there is already a couple of API at the libxml level to do
> this
>     xmlNodeDump()
>     http://xmlsoft.org/html/libxml-tree.html#XMLNODEDUMP
>   and
>     xmlElemDump()
>     http://xmlsoft.org/html/libxml-tree.html#XMLELEMDUMP
> 
>  of course serializing a fraction of a document is an error prone
> operation in the sense that it's highly probable that the resulting
> serialization may not be parseable.
> 
> Daniel
> 
> -- 
> Daniel Veillard      | Red Hat Network
> http://redhat.com/products/network/
> veillard redhat com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
> http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
> 
rob





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]