From 34cba250a6333ed82ffbd4cd689f1265206d597b Mon Sep 17 00:00:00 2001 From: pwalford <> Date: Tue, 8 Oct 2002 02:49:59 +0000 Subject: [PATCH] Fixes to the following issues: * Mis-capitalised parameter names. * Un-named parameters. * Use of SAXException by ErrorHandler (SAX 2.0 API uses SAXParseException here). --- SAX/AttributeList.h | 1 - SAX/Attributes.h | 5 +++-- SAX/ErrorHandler.h | 8 ++++---- SAX/HandlerBase.h | 35 +++++++++++++++++++---------------- SAX/ext/Attributes2.h | 2 +- SAX/helpers/AttributesImpl.h | 2 +- SAX/helpers/DefaultHandler.h | 6 +++--- 7 files changed, 31 insertions(+), 28 deletions(-) diff --git a/SAX/AttributeList.h b/SAX/AttributeList.h index ed2db466..2d34db4d 100644 --- a/SAX/AttributeList.h +++ b/SAX/AttributeList.h @@ -189,4 +189,3 @@ typedef basic_AttributeList wAttributeList; #endif // end of file - diff --git a/SAX/Attributes.h b/SAX/Attributes.h index 1d1072a7..63322174 100644 --- a/SAX/Attributes.h +++ b/SAX/Attributes.h @@ -155,7 +155,8 @@ public: * @return The index of the attribute, or -1 if it does not * appear in the list. */ - virtual int getIndex(const stringT& uri, const stringT& localPart) const = 0; + virtual int getIndex(const stringT& uri, const stringT& localName) const = 0; + /** * Look up the index of an attribute by XML 1.0 qualified name. * @@ -218,7 +219,7 @@ public: * attribute is not in the list or if qualified names * are not available. */ - virtual stringT getValue(const stringT& qname) const = 0; + virtual stringT getValue(const stringT& qName) const = 0; }; // class Attributes diff --git a/SAX/ErrorHandler.h b/SAX/ErrorHandler.h index a0e3557a..76cc7079 100644 --- a/SAX/ErrorHandler.h +++ b/SAX/ErrorHandler.h @@ -5,7 +5,7 @@ // $Id$ #include -#include +#include namespace SAX { @@ -62,7 +62,7 @@ public: * SAX parse exception. * @see basic_SAXParseException */ - virtual void warning(const SAXException& exception) = 0; + virtual void warning(const SAXParseException& exception) = 0; /** * Receive notification of a recoverable error. * @@ -86,7 +86,7 @@ public: * SAX parse exception. * @see basic_SAXParseException */ - virtual void error(const SAXException& exception) = 0; + virtual void error(const SAXParseException& exception) = 0; /** * Receive notification of a non-recoverable error. * @@ -105,7 +105,7 @@ public: * SAX parse exception. * @see basic_SAXParseException */ - virtual void fatalError(const SAXException& exception) = 0; + virtual void fatalError(const SAXParseException& exception) = 0; }; // class ErrorHandler }; // namespace SAX diff --git a/SAX/HandlerBase.h b/SAX/HandlerBase.h index b7563059..f955df45 100644 --- a/SAX/HandlerBase.h +++ b/SAX/HandlerBase.h @@ -79,7 +79,8 @@ public: * default behaviour. * @see basic_EntityResolver#resolveEntity */ - virtual InputSourceT resolveEntity(const stringT&, const stringT&) + virtual InputSourceT resolveEntity(const stringT& publicId, + const stringT& systemId) { return InputSourceT(); } // resolverEntity @@ -100,9 +101,9 @@ public: * @param systemId The notation system identifier. * @see basic_DTDHandler#notationDecl */ - virtual void notationDecl(const stringT&, - const stringT&, - const stringT&) { } + virtual void notationDecl(const stringT& name, + const stringT& publicId, + const stringT& systemId) { } /** * Receive notification of an unparsed entity declaration. @@ -118,10 +119,10 @@ public: * @param notationName The name of the associated notation. * @see basic_DTDHandler#unparsedEntityDecl */ - virtual void unparsedEntityDecl(const stringT&, - const stringT&, - const stringT&, - const stringT&) { } + virtual void unparsedEntityDecl(const stringT& name, + const stringT& publicId, + const stringT& systemId, + const stringT& notationName) { } ////////////////////////////////////////////////////////////////////// // Default implementation of DocumentHandler interface. @@ -137,7 +138,7 @@ public: * @see basic_DocumentHandler#setDocumentLocator * @see basic_Locator */ - virtual void setDocumentLocator(const LocatorT&) { } + virtual void setDocumentLocator(const LocatorT& locator) { } /** * Receive notification of the beginning of the document. @@ -174,7 +175,8 @@ public: * @param attributes The specified or defaulted attributes. * @see basic_DocumentHandler#startElement */ - virtual void startElement(const stringT&, const AttributeListT&) { } + virtual void startElement(const stringT& name, + const AttributeListT& attributes) { } /** * Receive notification of the end of an element. * @@ -186,7 +188,7 @@ public: * @param name The element type name. * @see basic_DocumentHandler#endElement */ - virtual void endElement(const stringT&) { } + virtual void endElement(const stringT& name) { } /** * Receive notification of character data inside an element. @@ -199,7 +201,7 @@ public: * @param ch The characters. * @see basic_DocumentHandler#characters */ - virtual void characters(const stringT&) { } + virtual void characters(const stringT& ch) { } /** * Receive notification of ignorable whitespace in element content. * @@ -211,7 +213,7 @@ public: * @param ch The whitespace characters. * @see basic_DocumentHandler#ignorableWhitespace */ - virtual void ignorableWhitespace(const stringT&) { } + virtual void ignorableWhitespace(const stringT& ch) { } /** * Receive notification of a processing instruction. @@ -226,7 +228,8 @@ public: * none is supplied. * @see basic_DocumentHandler#processingInstruction */ - virtual void processingInstruction(const stringT&, const stringT&) { } + virtual void processingInstruction(const stringT& target, + const stringT& data) { } ////////////////////////////////////////////////////////////////////// // Default implementation of the ErrorHandler interface. @@ -243,7 +246,7 @@ public: * @see basic_ErrorHandler#warning * @see basic_SAXParseException */ - virtual void warning(const SAXException&) { } + virtual void warning(const SAXException& e) { } /** * Receive notification of a recoverable parser error. * @@ -256,7 +259,7 @@ public: * @see basic_ErrorHandler#warning * @see basic_SAXParseException */ - virtual void error(const SAXException&) { } + virtual void error(const SAXException& e) { } /** * Report a fatal XML parsing error. * diff --git a/SAX/ext/Attributes2.h b/SAX/ext/Attributes2.h index 920c2f87..a1622373 100644 --- a/SAX/ext/Attributes2.h +++ b/SAX/ext/Attributes2.h @@ -66,7 +66,7 @@ public: * @throws std::invalid_argument exception when the supplied names * does not identify an attribute */ - virtual bool isSpecified(const stringT& uri, const stringT& locaName) const = 0; + virtual bool isSpecified(const stringT& uri, const stringT& localName) const = 0; }; // class basic_Attributes2 typedef basic_Attributes2 Attributes2; diff --git a/SAX/helpers/AttributesImpl.h b/SAX/helpers/AttributesImpl.h index d885632a..e9239042 100644 --- a/SAX/helpers/AttributesImpl.h +++ b/SAX/helpers/AttributesImpl.h @@ -116,7 +116,7 @@ public: * * @param index The attribute's index (zero-based). * @return The attribute's type, "CDATA" if the type is unknown, or an empty - * empty string if the index is out of bounds. + * string if the index is out of bounds. * @see basic_Attributes#getType(int) */ virtual stringT getType(unsigned int index) const diff --git a/SAX/helpers/DefaultHandler.h b/SAX/helpers/DefaultHandler.h index 30903ace..4eb0cddd 100644 --- a/SAX/helpers/DefaultHandler.h +++ b/SAX/helpers/DefaultHandler.h @@ -324,7 +324,7 @@ public: * @see ErrorHandler#warning * @see SAXParseException */ - virtual void warning(const SAXException&) { } + virtual void warning(const SAXParseException& e) { } /** * Receive notification of a recoverable parser error. * @@ -339,7 +339,7 @@ public: * @see ErrorHandler#warning * @see SAXParseException */ - virtual void error(const SAXException&) { } + virtual void error(const SAXParseException& e) { } /** * Report a fatal XML parsing error. * @@ -357,7 +357,7 @@ public: * @see ErrorHandler#fatalError * @see SAXParseException */ - virtual void fatalError(const SAXException& ex) + virtual void fatalError(const SAXParseException& e) { } // fatalError