RE: 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 12:39 PM
To: Henke, Markus
Cc: 'xml gnome org'
Subject: Re: [xml] (correct) way to link external subset to newly
created XML doc


On Tue, Jan 08, 2002 at 12:18:29PM +0100, Henke, Markus wrote:
Hello,

i'm wondering what's the correct way to create a reference to an
external subset in a document that i'm building from scratch.
It's not that i'm not able to do so, i'm actualy using

xmlCreateIntSubset(myDocPtr, "rootNode", NULL, "myDTD.dtd");

and it works like a charm.
When i'm saving the doc to disk (via xmlSaveFormatFileTo(...)),
it'll look like

<?xml version="1.0"?>
<!DOCTYPE rootNode SYSTEM "myDTD.dtd">
<rootNode>...</rootNode>

and that's exactly what i want.
But, AFAIK that's an *external* subset and i'm using a 
function named
...Create*Int*Subset (and that's the only function i've 
found that do
so...).

So, the question: Am i missing something (or have i 
misunderstood the
meaning of *internal*/*external* subset)?

One can add an internal subset and one external subset *reference* to
an xmlDoc tree.

Yep, that's clear.

The internal subset node is part of the document and represented as
an xmlDtdPtr in the children list of the document. It will be 
serialized
at the same time as the document. The external subset is only 
referenced
from the xmlDocPtr and of course not serialized as such.

Sounds emphatic...8)
 
  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!? Who's than pointing to the internal subset, and where
xmlDocPtr->extSubset is pointing to?

  To create an external subset content, one would need to create a new
xmlDtd, fill it, possibly reference it from the xmlDocPtr, 
and serialize it 
(using xmlNodeDump() or xmlNodeDumpOutput() with a xmlDtd 
node should work).

No need to create the external subset from scratch ATM...

Daniel

Thanx, 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]