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


Help: OASIS Mailing Lists Help | MarkMail Help

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

Re: DTD's

5/18/01 7:14:20 AM, Al Snell <alaric@alaric-snell.com> wrote:

>On Fri, 18 May 2001, Joel Rees (pop) wrote:
>> When I take this to the next step (My boss says I must, but he isn't
>> allocating me time yet.), I will use a RAD tool (Delphi, probably) to set up
>> a quick form that wraps the fields I know I'll need with XML tags and
>> appends it to a text file that will be well-formed when it is generated.
>Not doable IIRC... to be well formed, it has to be a single top-level
> <item>...</item>
> <item>...</item>
>New items need to be inserted before the </timesheet>. YOu will either
>need to process the document through a SAX filter that inserts a new
>element at the appropriate moment, or write code that seeks to the end of
>the file, finds the </timesheet>, writes the new element from that point,
>then puts a new </timesheet> on the end...
>XML isn't great for appending to, I don't think it's useful at all for a
>log file (except if the log file is composed of a series of little XML
>documents with a higher-level boundary marking between each).

If you don't have a philosophical objection to the use of XML's built-in entity inclusion 
mechanism, then just treat the log file as a well-formed external parsed entity (which does not 
require a single root element) and parse a "wrapper" file or string like:

<!DOCTYPE timesheet [
<!ENTITY sheetitems SYSTEM "sheetitems.xml">