not part of build, simple fix to get |NodeType()| right, have comment nodes in standalone, warning fix in nsNodeSet.h

git-svn-id: svn://10.0.0.236/trunk@85309 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
axel%pike.org 2001-01-22 21:54:23 +00:00
parent e0dea7a434
commit 684c6ba2f8
4 changed files with 18 additions and 7 deletions

View File

@ -34,7 +34,7 @@
* -- Removed a number of castings of XML_Char to DOM_CHAR since they
* were not working on Windows properly
*
* $Id: XMLParser.cpp,v 1.12 2001-01-19 21:24:39 axel%pike.org Exp $
* $Id: XMLParser.cpp,v 1.13 2001-01-22 21:54:20 axel%pike.org Exp $
*/
#include "XMLParser.h"
@ -143,6 +143,7 @@ Document* XMLParser::parse(istream& inputStream)
XML_SetElementHandler(parser, startElement, endElement);
XML_SetCharacterDataHandler(parser, charData);
XML_SetProcessingInstructionHandler(parser, piHandler);
XML_SetCommentHandler(parser,commentHandler);
do
{
inputStream.read(buf, bufferSize);
@ -219,6 +220,14 @@ void charData(void* userData, const XML_Char* s, int len)
};
} //-- charData
void commentHandler(void* userData, const XML_Char* s)
{
ParserState* ps = (ParserState*)userData;
String data((UNICODE_CHAR*)s);
Node* prevSib = ps->currentNode->getLastChild();
ps->currentNode->appendChild(ps->document->createComment(data));
} //-- commentHandler
/**
* Handles ProcessingInstructions
**/

View File

@ -23,7 +23,7 @@
* Keith Visco
* -- finished implementation
*
* $Id: XMLParser.h,v 1.6 2000-08-27 05:58:58 kvisco%ziplink.net Exp $
* $Id: XMLParser.h,v 1.7 2001-01-22 21:54:20 axel%pike.org Exp $
*/
#include <iostream.h>
@ -46,7 +46,7 @@ typedef struct {
* parsing is provided by EXPAT.
* @author <a href="tomk@mitre.org">Tom Kneeland</a>
* @author <a href="kvisco@ziplink.net">Keith Visco</a>
* @version $Revision: 1.6 $ $Date: 2000-08-27 05:58:58 $
* @version $Revision: 1.7 $ $Date: 2001-01-22 21:54:20 $
**/
class XMLParser
{
@ -55,6 +55,7 @@ class XMLParser
* Sax related methods for XML parsers
* --------------------------------------------------*/
friend void charData(void* userData, const XML_Char* s, int len);
friend void commentHandler(void* userData, const XML_Char* s);
friend void startElement(void *userData, const XML_Char* name,
const XML_Char** atts);
friend void endElement(void *userData, const XML_Char* name);
@ -88,4 +89,5 @@ void charData(void* userData, const XML_Char* s, int len);
void startElement(void *userData, const XML_Char* name, const XML_Char** atts);
void endElement(void *userData, const XML_Char* name);
void piHandler(void *userData, const XML_Char *target, const XML_Char *data);
void piHandler(void *userData, const XML_Char *s);
#endif

View File

@ -30,7 +30,7 @@
* -- fixed bug in ::parsePredicates,
* made sure we continue looking for more predicates.
*
* $Id: ExprParser.cpp,v 1.8 2001-01-22 09:36:16 kvisco%ziplink.net Exp $
* $Id: ExprParser.cpp,v 1.9 2001-01-22 21:54:22 axel%pike.org Exp $
*/
/**
@ -38,7 +38,7 @@
* This class is used to parse XSL Expressions
* @author <A HREF="mailto:kvisco@ziplink.net">Keith Visco</A>
* @see ExprLexer
* @version $Revision: 1.8 $ $Date: 2001-01-22 09:36:16 $
* @version $Revision: 1.9 $ $Date: 2001-01-22 21:54:22 $
**/
#include "ExprParser.h"
@ -588,7 +588,7 @@ LocationStep* ExprParser::createLocationStep(ExprLexer& lexer) {
}
// NodeType
else {
NodeExpr* nodeExpr = createNodeExpr(lexer);
nodeExpr = createNodeExpr(lexer);
}
lstep->setNodeExpr(nodeExpr);

View File

@ -60,4 +60,4 @@ private:
nsSupportsArray mNodes;
};
#endif
#endif