[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: DTD's
5/18/01 7:14:20 AM, Al Snell <alaric@a...> 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 >element: > ><timesheet> > <item>...</item> > <item>...</item> ></timesheet> > >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"> ]> <timesheet> &sheetitems; </timesheet>
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|