Appending to an XML document

uche.ogbuji at fourthought.com uche.ogbuji at fourthought.com
Fri Dec 10 16:57:15 GMT 1999


> using entities of any kind does not change the underlying data model. 
> It's syntactic shugar, nothing more. The root of the problem (and a 
> great help in other cases) is indeed the fact that any XML 1.0 
> document must have a single root.

>From what I know of your problem, it seems as if you are the one who is 
confusing implementation issues with the underlying data model.

If I were faced with the same problem, my solution would be very simple.

The schema (your "underlying data model") for my XML logging document would be 
as follows:

<!ELEMENT log (entry*)>
<!ELEMENT entry (#PCDATA)>

My low-level logging code (where efficiency counts more than schematics) would 
manage a disk file in the form

<entry>Nam Sybillam quidem Cumis ego oculis meis vidi in ampulla 
pendere</entry>
<entry>Pueris respondebat "Volo perire"</entry>

And appending is as efficient as you please.  Let us say this disk file was 
"/var/log/classic.log"

The rest of the world (which is expecting an XML: document) would access the 
logs through the following

<?xml version="1.0">
<!DOCTYPE log [<!ENTITY lf SYSTEM "file:/var/log/classic.log">]>
<log>&lf;</log>

And ta-da!  We've satisfied both our efficiency and semantic concerns using 
XML 1.0.

So where is the problem?


-- 
Uche Ogbuji
FourThought LLC, IT Consultants
uche.ogbuji at fourthought.com	(970)481-0805
Software engineering, project management, Intranets and Extranets
http://FourThought.com		http://OpenTechnology.org



xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo at ic.ac.uk the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)





More information about the Xml-dev mailing list