void PushXMLErrorToken(const char *aBuffer, PRUint32 aLength, PRBool aIsFinal);
nsresult PushXMLErrorTokens(const char *aBuffer, PRUint32 aLength, PRBool aIsFinal); nsresult AddErrorMessageTokens(nsParserError* aError);
CLASS_EXPORT_HTMLPARS nsExpatTokenizer : public nsHTMLTokenizer {public:          nsExpatTokenizer(nsString* aURL = nsnull);        virtual ~nsExpatTokenizer();  virtual const   nsIID& GetCID();  static  const   nsIID& GetIID();          NS_DECL_ISUPPORTS  /* nsITokenizer methods */    virtual nsresult ConsumeToken(nsScanner& aScanner,PRBool& aFlushTokens);    virtual nsresult DidTokenize(PRBool aIsFinalChunk);  virtual void    FrontloadMisplacedContent(nsDeque& aDeque);  static  void    FreeTokenRecycler(void);protected:  /**   * Parse an XML buffer using expat   * @update	nra 2/29/99   * @return  NS_ERROR_FAILURE if expat encounters an error, else NS_OK   */  nsresult ParseXMLBuffer(const char *aBuffer, PRUint32 aLength, PRBool aIsFinal=PR_FALSE);  /**   * Sets up the callbacks and user data for the expat parser         * @update  nra 2/24/99   * @param   none   * @return  none   */  void SetupExpatParser(void);  // Propagate XML errors to the content sink  void PushXMLErrorToken(const char *aBuffer, PRUint32 aLength, PRBool aIsFinal);	void GetLine(const char* aSourceBuffer, PRUint32 aLength,     PRUint32 aByteIndex, nsString& aLine);  // Load up an external stream to get external entity information  static nsresult OpenInputStream(const nsString& aURLStr,                                   const nsString& aBaseURL,                                   nsIInputStream** in,                                   nsString* aAbsURL);  static nsresult LoadStream(nsIInputStream* in,                              PRUnichar* &uniBuf,                              PRUint32 &retLen);  /* The callback handlers that get called from the expat parser */  static void HandleStartElement(void *userData, const XML_Char *name, const XML_Char **atts);  static void HandleEndElement(void *userData, const XML_Char *name);  static void HandleCharacterData(void *userData, const XML_Char *s, int len);  static void HandleComment(void *userData, const XML_Char *name);  static void HandleProcessingInstruction(void *userData,     const XML_Char *target,     const XML_Char *data);  static void HandleDefault(void *userData, const XML_Char *s, int len);  static void HandleStartCdataSection(void *userData);  static void HandleEndCdataSection(void *userData);  static void HandleUnparsedEntityDecl(void *userData,     const XML_Char *entityName,     const XML_Char *base,     const XML_Char *systemId,     const XML_Char *publicId,    const XML_Char *notationName);  static void HandleNotationDecl(void *userData,    const XML_Char *notationName,    const XML_Char *base,    const XML_Char *systemId,    const XML_Char *publicId);  static int HandleExternalEntityRef(XML_Parser parser,    const XML_Char *openEntityNames,    const XML_Char *base,    const XML_Char *systemId,    const XML_Char *publicId);  static int HandleUnknownEncoding(void *encodingHandlerData,    const XML_Char *name,    XML_Encoding *info);  static void HandleStartDoctypeDecl(void *userData,    const XML_Char *doctypeName);  static void HandleEndDoctypeDecl(void *userData);  XML_Parser mExpatParser;	PRUint32 mBytesParsed;  nsString mLastLine;  XMLParserState* mState;};