OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Appending XML to File

[ Lists Home | Date Index | Thread Index ]

* Michael Kay <mike@saxonica.com> [2005-01-18 05:06]:
> 
> > -----Original Message-----
> > From: Alan Gutierrez [mailto:alan-xml-dev@engrm.com] 
> > Sent: 18 January 2005 07:57
> > To: xml-dev@lists.xml.org
> > Subject: [xml-dev] Appending XML to File
> > 
> >     I was wondering if anyone had used XML in a logging context.
> > 
> >     Have you wanted to append XML to file, or store XML events to
> >     file? How did you do this and manage to keep the document well
> >     formed?
> >     
> >     1. Create a directory structure contianing a document for each
> >        event. 
> > 
> >     2. Create a file that contains one document after another, each
> >        representing an event..
> > 
> >     3. Seek to the start of the last element, overwrite with 
> >        event and new element.
> > 
> >     Option 1 sounds unwieldy, option 2 creates a peculiar file, and
> >     option 3 sounds fragile.

> >     Insight is much appreciated.

> Use parsed external entities.
> 
> The document never changes and reads
> 
> <log>
>   &data;
> </log>
> 
> The data file contains the records:
> 
> <entry>...</entry>
> <entry>...</entry>
> <entry>...</entry>
> <entry>...</entry>
> 
> and you can append to it any time you like.
> 
> This is about the only time I ever use external entities.

    This is perfect, Michael. Thank you.

--
Alan Gutierrez - alan@engrm.com




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS