From 13594c689a68e06a7209f704542248699bff194d Mon Sep 17 00:00:00 2001 From: James Clark Date: Wed, 25 Nov 1998 09:26:02 +0000 Subject: [PATCH] Add metaStartDocument and metaEndDocument --- expat/xmlwf/xmlwf.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/expat/xmlwf/xmlwf.c b/expat/xmlwf/xmlwf.c index 81f06063..1f35d2d4 100755 --- a/expat/xmlwf/xmlwf.c +++ b/expat/xmlwf/xmlwf.c @@ -241,6 +241,18 @@ void metaLocation(XML_Parser parser) XML_GetCurrentColumnNumber(parser)); } +static +void metaStartDocument(XML_Parser parser) +{ + fputts(T("\n"), XML_GetUserData(parser)); +} + +static +void metaEndDocument(XML_Parser parser) +{ + fputts(T("\n"), XML_GetUserData(parser)); +} + static void metaStartElement(XML_Parser parser, const XML_Char *name, const XML_Char **atts) { @@ -526,7 +538,6 @@ int tmain(int argc, XML_Char **argv) switch (outputType) { case 'm': XML_UseParserAsHandlerArg(parser); - fputts(T("\n"), fp); XML_SetElementHandler(parser, metaStartElement, metaEndElement); XML_SetProcessingInstructionHandler(parser, metaProcessingInstruction); XML_SetCommentHandler(parser, metaComment); @@ -534,6 +545,7 @@ int tmain(int argc, XML_Char **argv) XML_SetCharacterDataHandler(parser, metaCharacterData); XML_SetUnparsedEntityDeclHandler(parser, metaUnparsedEntityDecl); XML_SetNotationDeclHandler(parser, metaNotationDecl); + metaStartDocument(parser); break; case 'c': XML_UseParserAsHandlerArg(parser); @@ -564,7 +576,7 @@ int tmain(int argc, XML_Char **argv) result = XML_ProcessFile(parser, argv[i], processFlags); if (outputDir) { if (outputType == 'm') - fputts(T("\n"), fp); + metaEndDocument(parser); fclose(fp); if (!result) tremove(outName);