Re: [xml] Saving information back to original XIncluded xml files

On Thu, Dec 21, 2006 at 03:10:54PM -0800, Dean Wittmann wrote:
Here is my question:  Is there or has there been any work done on saving
potentially changed XIncluded information back to original files?  I
know that URL's can come from just about anywhere, but I am only
interested in loading and saving whole XIncluded xml files.  We
currently use xml files under Windows and QNX (using libxml2) for
configuration information and we have many different software
configurations that could use the XInclude technology to bring in
software/machine specific information.  Sometimes this information is
modified and it needs to be saved back out to the original XIncluded

  Okay, in general this is not possible, because you can ask to
include fragment(s) of XML resources.

Does anyone have an implementation for this? 

  Not really for the reason above. You still have the 
XML_XINCLUDE_START and XML_XINCLUDE_END nodes in the tree which may be
sufficient to find the boundaries.

I have started to code my
own implementation by adding functionality to xmlsave, but it requires
that the href is not optional and I know there are limitations to my
implementation where I may or may not be handling the recursive nature
of xi:include and/or xi:fallback.

  I think the fragmented and recursive nature of XInclude makes the general
approach impossible, plus if you use remote resources it's usually not possible
to save back content. So I'm afraid any implementation will be way too
limited to really push it as a general feature, but having the patch around
may be useful for others.

I thought I'd ask before continuing my implementation to see if there
was anyone out there that already had a working implementation.

  That sounds hard in the general case.


Red Hat Virtualization group
Daniel Veillard      | virtualization library
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]