RE: [xml] (correct) way to link external subset to newly crea ted XML doc




-----Original Message-----
From: Daniel Veillard [mailto:veillard redhat com]
Sent: Tuesday, January 08, 2002 3:10 PM
To: Henke, Markus
Cc: 'xml gnome org'
Subject: Re: [xml] (correct) way to link external subset to newly crea
ted XML doc


On Tue, Jan 08, 2002 at 02:59:27PM +0100, Henke, Markus wrote:
  So yes this creates a reference to the external subset. But that
reference is contained in the document and hence kept as 
part of the
internal subset informations.

OK, that'll work for me ATM.
But what's to do when i actually use an internal (build 
from scratch)
*and* an (existing) external subset?
When i create the *reference* to the external subset
via xmlCreateIntSubset(), xmlDocPtr->intSubset points to 
the *external*
subset!?

 it does it by name. Not by a pointer to the xmlDtdPtr.

Who's than pointing to the internal subset, and where
xmlDocPtr->extSubset is pointing to?

 this one points to the xmlDtdPtr of the external subset.

In a nutshell if you have internal and external subsets:
   - The DOCTYPE declaration generates an xmlDtdPtr node which is
     one of the children of the xmlDocPtr (before the root element)
   - This xmlDtdPtr is also referenced from the xmlDocPtr as 
     xmlDocPtr->intSubset
   - the external subset System ID and Public ID are stored in this
     xmlDocPtr->intSubset because they are actually carried 
by the DOCTYPE
     as xmlDocPtr->intSubset->ExternalID and 
xmlDocPtr->intSubset->SystemID
   - the external subset (if parsed which is not the default 
behaviour)
     is stored as xmlDocPtr->extSubset

If you have no external subset but an internal subset:
   - xmlDocPtr->extSubset is NULL
   - xmlDocPtr->intSubset->ExternalID and 
xmlDocPtr->intSubset->SystemID are
     NULL

If you have no internal subset but an external subset:
   - it's like the case where both are present except 
xmlDocPtr->intSubset
     have no children

If you have no internal subset nor external subset:
   - both xmlDocPtr->intSubset and xmlDocPtr->extSubset are NULL
   - there should be no xmlDtdPtr in the full document tree.

 I hope this clear things up,

Yep, i've got it now. Many thanx!
The crux of the matter is that the DOCTYPE declaration holds the
reference to the external subset (with systemURL and publicID)
*and* is the root node of the internal subset. That's very clear,
but i've to bring it to mind...
I guess your summary to that subject could be usefull also
for other libxml user...?

Daniel

Thanx & Ciao, Markus



Mit freundlichen Gruessen - Kind regards
Markus Henke



________________________Addressed by:________________________
 ORDAT GmbH & Co. KG  -  Serversystems / eCom 
 Dipl.-Inf. (FH) Markus Henke  Fon: +49 (641) 7941-0
 Rathenaustr. 1                Fax: +49 (641) 7941-132
 35394 Gießen                  mailto:markus henke ordat com
 See:                          http://www.ordat.com
_____________________________________________________________
              ...this behavior is by design...




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