Update of /cvsroot/monetdb/pathfinder/runtime
In directory sc8-pr-cvs16:/tmp/cvs-serv6694/runtime

Modified Files:
        serialize_dflt.mx 
Log Message:
propagated changes of Monday Apr 02 2007 - Thursday Apr 12 2007
from the XQuery_0-16 branch to the development trunk


Index: serialize_dflt.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/runtime/serialize_dflt.mx,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- serialize_dflt.mx   22 Mar 2007 09:39:06 -0000      1.36
+++ serialize_dflt.mx   12 Apr 2007 12:17:02 -0000      1.37
@@ -198,7 +198,7 @@
  *
  * Emit a string with all special character escaped.
  */
-@:emit_escaped(,)@
+@:emit_escaped(_all,)@
 /*
  * This function is responsible for the presentation of special characters
  * and XML entity characters in the result.
@@ -391,6 +391,17 @@
 
 /**
  * Output generation handler. Handles equivalent of * SAX ignorableWhitespace()
+ * Output generation handler. Handles equivalent of * SAX characters() event.
+ */
+static bool
+seq_handle_characters (XqueryCtx* ctx, str chars)
+{
+    emit_escaped_all (ctx, chars);
+
+    return SUCCESS;
+}
+
+/**
  * event. I see no reason why it should be used here but I include it for
  * completeness.
  */
@@ -481,7 +492,7 @@
     }
     stream_write (ctx->out, &e_, 1, 1); /* = */
     stream_write (ctx->out, dflt_ws->esc_quote, dflt_ws->esq_sz, 1);
-    emit_escaped (ctx, value);
+    emit_escaped_all (ctx, value);
     stream_write (ctx->out, dflt_ws->esc_quote, dflt_ws->esq_sz, 1);
 
     return SUCCESS;
@@ -529,7 +540,7 @@
 static bool
 dflt_seqEmitStr (XqueryCtx* ctx, str sv)
 {
-    emit_escaped (ctx, sv);
+    emit_escaped_all (ctx, sv);
 
     return SUCCESS;
 }
@@ -541,7 +552,7 @@
 esc_seqEmitStr (XqueryCtx* ctx, str sv)
 {
     stream_write (ctx->out, dflt_ws->esc_quote, dflt_ws->esq_sz, 1);
-    emit_escaped (ctx, sv);
+    emit_escaped_all (ctx, sv);
     stream_write (ctx->out, dflt_ws->esc_quote, dflt_ws->esq_sz, 1);
 
     return SUCCESS;
@@ -589,6 +600,23 @@
     return SUCCESS;
 }
 
+/**
+ * Output generation handler. Handles top-level textnodes.
+ */
+static bool
+seq_seqEmitTextnode (XqueryCtx* ctx, str chars)
+{
+    stream_write (ctx->out, textnodeStart, tnS_sz, 1);
+    stream_write (ctx->out, dflt_ws->esc_quote, dflt_ws->esq_sz, 1);
+    
+    emit_escaped_all (ctx, chars);
+
+    stream_write (ctx->out, dflt_ws->esc_quote, dflt_ws->esq_sz, 1);
+    stream_write (ctx->out, textnodeEnd, tnE_sz, 1);
+    
+    return SUCCESS;
+}
+
 
 
 /**
@@ -1303,8 +1331,8 @@
     dflt_handle_endDocument,
     dflt_handle_startElement,
     dflt_handle_endElement,
-    dflt_handle_characters,
-    dflt_handle_ignorableWhitespace,
+    seq_handle_characters,
+    seq_handle_characters,
     dflt_handle_comment,
     dflt_handle_processingInstruction,
 
@@ -1317,7 +1345,7 @@
     dflt_seqEmitDbl,
     esc_seqEmitStr,
     dflt_seqEmitAttribute,
-    dflt_seqEmitTextnode,
+    seq_seqEmitTextnode,
 
     seq_seqStart,
     null_complete_seqStart,


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Monetdb-pf-checkins mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to