Commit Graph
19 Commits
Author SHA1 Message Date
nisheeth@netscape.com 1b04086df5 Fixed the error reporting code's math for the final time, hopefully. Also fixed the off by one error for the textual arrow that points out the error location. 1999-04-24 10:06:35 +00:00
donm@netscape.com 85ca30b0d1 Rick Gessner helped unpretzel the logic here to get the
right answer, but suggests that this kind of math is
no longer necessary with nsString.
fixes build bustage.
1999-04-22 18:37:35 +00:00
nisheeth@netscape.com 4cb10645a9 Expat's switch to unicode buffers confused the error reporting code. Fixed. 1999-04-22 09:25:31 +00:00
nisheeth@netscape.com d89446e066 Fixing Mac build bustage. Expat has started returning wchar_t * (wide chars) because it supports Unicode buffers. Those wchar_t *s needed to be cast to PRUnichar *s. 1999-04-22 06:27:56 +00:00
nisheeth@netscape.com 974bb84a8b Fix for bug 4463. Expat now accepts unicode buffers. 1999-04-22 05:31:18 +00:00
nisheeth@netscape.com 1c41fd72e4 - Enable expat by default. If you run into problems, you can disable expat at run-time by setting NOEXPAT=1 in your environment on Windows and UNIX.
On Mac, create a file called NOEXPAT in the directory from which you run the browser.

- Changed nsExpatTokenizer so that it stops parsing buffers once it sees an XML well-formedness error.
1999-04-08 09:21:16 +00:00
nisheeth@netscape.com 3aaae21dc1 1) Fixed a mistaken assumption made by the XML error handling code in nsExpatTokenizer. It no longer treats the error location returned by expat as being relative to the current XML chunk being parsed. Instead, the error location is considered to be relative to the start of the XML file. The lengths of incoming XML chunks are added to a new member variable, mBytesParsed. When an error occurs, we subtract mBytesParsed from the error location returned by expat to give us the offset of the error in the XML chunk.
2) When nsWellFormedDTD sees an error token, it dumps the error to cerr and notifies the content sink about it.  This is a temporary solution.  The right behavior is for the browser to show the error in the content window which, currently, happens only for .XML documents.  XUL and RDF files use their own content sinks which do not implement error handling.  This needs to change so that code is shared among the XML, RDF, and XUL content sinks. I do not want to fix error handling by just cutting and pasting the error handling code from the XML content sink into the RDF and XUL content sinks.
1999-04-06 08:17:03 +00:00
rickg@netscape.com b7310def66 major rev to parsing engine 1999-04-05 06:55:49 +00:00
nisheeth@netscape.com aa5a4592d8 Do not set a default handler for expat. This enables internal entitity substitution in expat. 1999-04-02 02:46:53 +00:00
nisheeth@netscape.com 631e515939 - Send out the source line where the error occurred from inside PushXMLErrorToken().
- Add the 'parsererror' and 'sourcetext' tags to the HTML tag enum.
1999-03-11 05:36:50 +00:00
vidur@netscape.com 8ff496107d Removed bogus addition of text for newlines 1999-03-10 01:19:35 +00:00
nisheeth@netscape.com a4cf51d64b - We weren't adding the tag text to the token created for the end tag. Fixed.
- Tokens for CDATA sections were not being created.  Fixed.
- The length of the parse buffer is passed into ParseXMLBuffer() because it is available from the scanner.  We were doing a strlen() to determine the length which was inefficient.
1999-03-09 07:39:04 +00:00
nisheeth@netscape.com e0026e8e3c Checking in the first stab at error propagation from the expat parser to the content sink. The flow of control is as follows. The tokenizer creates an error token (CErrorToken) when an error occurs in expat and pushes it onto the token dequeue. The DTD forwards the contents of the token to the content sink, which creates content objects to show the error. 1999-03-08 17:42:54 +00:00
rickg@netscape.com a2d39ff03b enabled expat in parsing engine 1999-03-03 08:34:23 +00:00
nisheeth@netscape.com f7ed6f8c0d We've decided to do away with the notion of an nsExpatDTD. The expat tokenizer which encapsulates the expat parser will be driven by nsWellFormedDTD. So, nsExpatTokenizer has changed accordingly. nsWellFormedDTD() creates an nsExpatTokenizer if EXPAT is #define'd; otherwise it creates the old nsXMLTokenizer. nsParser no longer registers and createsthe nsExpatDTD. 1999-03-03 02:34:18 +00:00
nisheeth@netscape.com 5f608d87f7 - Changed the way the expat parser is encapsulated. Now, the expat DTD creates and destroys the expat parser and registers callbacks with the expat parser. The expat tokenizer simply gets the entire buffer contents from the scanner and passes it to ParseXMLBuffer() on the expat DTD. Earlier, the expat tokenizer was encapsulating the expat parser behind its interfaces. This change gets rid of nsIExpatTokenizer because the expat tokenizer no longer needs to expose methods for registering callbacks with the expat parser. 1999-03-02 04:02:23 +00:00
nisheeth@netscape.com 2e0bea9696 Enough code to get expat callbacks firing inside nsExpatDTD. Next step is
to pass on the callbacks to the XML content sink.  These files are not part
of the build system yet.
1999-02-27 06:04:02 +00:00
rickg@netscape.com 32cfdf42d9 small bug fixes and removal of global statics 1999-02-26 06:33:54 +00:00
rickg@netscape.com d7c863bb28 added stubs for expat 1999-02-23 01:57:13 +00:00