|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Rebelling parser writers (Was: ]]> within a CDATA marked section ?)
In message <01BCFB68.64DAE950@x...>, Jarle Stabell <jarle.stabell@d...> writes >After attempting to process a document containing errors, I want to present to >the user a list of error messages, and when the user clicks on one of these >messages, I want to highlight the exact part of the document where the error >occurs. >The problem with entity expansion is that the parser isn't parsing what the user >literally wrote into the entity definitions, it is parsing a processed/"virtual" >version, which *may* not be a real subpart of the document, so one has to map >"virtual" locations/positions to physical (real document) positions, which >doesn't seem trivial to me. It is also likely to give slightly confusing error >messages, as it may be mentioning expanded stuff ("<xxx>") which the user never >wrote, the user may have written "<xxx>" etc. I don't think this is as much of a problem as you fear. Every entity is physically declared somewhere in a real source - usually a good ol' file on disc. Of course, that file may not be the one you started from ... My RunSP program (http://www.light.demon.co.uk/runsp) does exactly what you describe (for nsgmls). It runs it under Windows and then allows the user to navigate from one error message to the next, in a simple editor environment that lets them sort out the problems they find. All I did was to parse the error messages, pick out file name, line number and character offset, and place a bookmark at the relevant point in the file concerned. This works equally well for errors in the DTD or SGML Declaration as for those in what we think of as the 'real document'. (Which is something that never occurred to me when designing RunSP - but of course the Declaration and DTD are equally part of the document as far as the parser is concerned.) Richard Light. Richard Light SGML/XML and Museum Information Consultancy richard@l... xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i... Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ To (un)subscribe, mailto:majordomo@i... the following message; (un)subscribe xml-dev To subscribe to the digests, mailto:majordomo@i... the following message; subscribe xml-dev-digest List coordinator, Henry Rzepa (mailto:rzepa@i...)
|
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
|
|||||||||

Cart








