[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 ?)

  • From: Richard Light <richard@l...>
  • To: xml-dev@i...
  • Date: Fri, 28 Nov 1997 07:50:28 +0000

documents writers uk
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 "&lt;xxx&gt;" 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!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.