Re: [xslt] [xml] Losing DTD reference when saving XML file



On Wed, Feb 14, 2007 at 04:10:40PM -0500, Ross Mohn wrote:
> On Wed, 2007-02-14 at 14:27 -0500, Daniel Veillard wrote:
> > On Wed, Feb 14, 2007 at 01:49:30PM -0500, Ross Mohn wrote:
> > > Any hint on how to keep the DTD in the XML file when saving it, please?
> > > Thanks in advance! -Ross
> > 
> >   I don't know because I don't understand, libxml2 always saves it by
> > default.
> 
> Thanks -- I did some more tests and discovered that it is removed from
> the xmlDoc when I use the xsltApplyStylesheet() function. Shouldn't that
> function treat the 2nd parameter as read-only? I've attached a short

 it doesn't. 

libxslt/transform.c: function xsltApplyStylesheetInternal

    if (doc->intSubset != NULL) {
        /*
         * Avoid hitting the DTD when scanning nodes
         * but keep it linked as doc->intSubset
         */

The DTD node is not part of the XPath data model of a document.
the information isn't lost though, that could be recovered, see
the code in question.

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/


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