xmlbuilder copies comments over now.
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 13 Dec 2005 22:18:34 +0000 (22:18 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 13 Dec 2005 22:18:34 +0000 (22:18 +0000)
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
Open-ILS/src/apachemods/mod_xmlbuilder.h

index 86fc886..c760de2 100644 (file)
@@ -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 ) {
index 826e270..1b8a9ad 100644 (file)
@@ -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 */