From 0bf979564d52b25c948cff26e966879de0b8227d Mon Sep 17 00:00:00 2001 From: erickson Date: Tue, 13 Dec 2005 22:18:34 +0000 Subject: [PATCH 1/1] xmlbuilder copies comments over now. this is necessary for any code that wants to use xmlbuilder and apache SSI's, which the staff client may want to do at some point (also good for testing) git-svn-id: svn://svn.open-ils.org/ILS/trunk@2356 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/apachemods/mod_xmlbuilder.c | 9 +++++++++ Open-ILS/src/apachemods/mod_xmlbuilder.h | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/apachemods/mod_xmlbuilder.c b/Open-ILS/src/apachemods/mod_xmlbuilder.c index 86fc886c13..c760de2e9c 100644 --- a/Open-ILS/src/apachemods/mod_xmlbuilder.c +++ b/Open-ILS/src/apachemods/mod_xmlbuilder.c @@ -358,6 +358,15 @@ void xmlBuilderExtSubset( void* blob, xmlBuilderAddDtd( sysId, context ); } +void xmlBuilderComment( void* blob, const xmlChar* data ) { + xmlBuilderContext* ctx = (xmlBuilderContext*) blob; + xmlNodePtr comment = xmlNewComment( data ); + xmlNodePtr parent = osrfListGetIndex( + ctx->nodeList, ctx->nodeList->size - 1 ); + if( parent ) xmlAddChild( parent, comment ); +} + + void xmlBuilderProcInstruction( void* blob, const xmlChar* name, const xmlChar* data ) { diff --git a/Open-ILS/src/apachemods/mod_xmlbuilder.h b/Open-ILS/src/apachemods/mod_xmlbuilder.h index 826e270845..1b8a9ad2d4 100644 --- a/Open-ILS/src/apachemods/mod_xmlbuilder.h +++ b/Open-ILS/src/apachemods/mod_xmlbuilder.h @@ -69,6 +69,7 @@ void xmlBuilderParseError( void* blob, const char* msg, ... ); xmlEntityPtr xmlBuilderGetEntity( void* blob, const xmlChar* name ); void xmlBuilderExtSubset( void* blob, const xmlChar* name, const xmlChar* extId, const xmlChar* sysId ); void xmlBuilderProcInstruction( void* blob, const xmlChar* name, const xmlChar* data ); +void xmlBuilderComment( void* blob, const xmlChar* data ); static xmlSAXHandler xmlBuilderSaxHandlerStruct = { @@ -92,7 +93,7 @@ static xmlSAXHandler xmlBuilderSaxHandlerStruct = { xmlBuilderHandleCharacter, /* characters */ NULL, /* ignorableWhitespace */ xmlBuilderProcInstruction, /* processingInstruction */ - NULL, /* comment */ + xmlBuilderComment, /* comment */ xmlBuilderParseError, /* xmlParserWarning */ xmlBuilderParseError, /* xmlParserError */ NULL, /* xmlParserFatalError : unused */ -- 2.43.2