Competition: fast XML parser for charset labelling

David Megginson david at megginson.com
Sun Apr 11 00:27:13 BST 1999


Chris Lilley writes:

 > Competition, for all those XML coders with <i>copious free time</i>:
 > 
 > Write an incredibly small and fast special-purpose XML parser whose
 > purpose is to locate  and read the xml declaration; don't bother reading
 > any more of the file once this is found.
 > It should however cope with any well-formed XML instance.

Don't think you'd need much time -- if the document starts with the
characters "<?xml" it has an XML declaration, and if it doesn't, you
can stop reading.  The hardest part is figuring out an approximate
encoding in the first place so that you can read the first five
characters, but the XML REC already has algorithms that can help.


All the best,


David

-- 
David Megginson                 david at megginson.com
           http://www.megginson.com/

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 (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe 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