I have a lot of XML documents that are generated using the tree API or the XSLT API and I want to be able to refer to them in other XML document within LIBXML2 through URL's (xincludes, xslt imports, includes, document(), etc.). Looking at the documentation xmlSetExternalEntityLoader is what I want but I am not sure what I am supposed to do next. I guess I am supposed to create a xmlParserInputPtr but how do I create one for an XML document, is that what xmlNewEntityInputStream is for, in which case how do I create a xmlEntity.
Another question I have, I have some XSL transformations that take a long time, up to 6 seconds in some cases, fortunately large parts of these transformations produce the same result. So what I want to do is create a mechanism so that when a XML document is being serialised into a string I can have my own call back function called at particular points so that I can insert previously serialised text. I suppose I could just insert a big text element into the xml document another possibility is to serialise the document my self, this is for generating HTML, would this be difficult. |