Re: [xml] xinclude question

On Sat, Nov 22, 2003 at 02:43:45PM +0100, Enno Rehling wrote:
I have a document that includes a second one via xinclude. when I save
the document back to disk, I want to save it not as one document, but as
the individual parts - if changes were made to the included part, save
them in the included file, if they were made in the main doc, save them
there, and don't inline the included parts in the main document. Using
xmlSaveFormatFileEnc or xmlDump doesn't give me that.

I know there are XML_INCLUDE_START and XML_INCLUDE_END nodes in the 
document tree that I could use to find where the includes are in the 
document. But I'd hate to have to write my own output routines that 
identify those - is that something I have to do, or is there another way?

  You will have to do it. By definition, the XInclude process is a recursive
one, once you have generated the Infoset you're not supposed to be able to
go back to the initial structure, libxml2 is just nice in the sense that
it keeps markers to do this kind of things, but it's definitely not
a default processing, i.e. you will have to write that custom extension.


Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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