Hi Joerg,
 
> If there is really a problem, it is probably in 
> ParamSaxBuffer as it does the replacement.

Thanks for the pointer.  I was able to add a test for \{ to bypass special
processing between braces.  (I guess the braces are for embedded xsl
commands but not sure)

The change seems to work.  Here's the diff anyone runs into this problem.  

Thanks,
gary


--- ParamSaxBuffer.java (revision 1555)
+++ ParamSaxBuffer.java (working copy)
@@ -77,34 +77,50 @@
         final int end = start + length;
         for (int i = start; i < end; i++) {
             if (ch[i] == '{') {
-                // Send any collected characters so far
-                if (i > start) {
-                    addBit(new Characters(ch, start, i - start));
-                }
+                // check for escaped brace \{
+                if (i > start && ch[i-1] == '\\') {
+                    // send chars up to \
+                    addBit(new Characters(ch, start, (i - 1) - start));
+                    // send the { char
+                    addBit(new Characters(ch, i, 1));
+                    // Continue processing
+                    i = i + 1;
+                    start = i + 1;
+                    continue;
 
-                // Find closing brace, and construct parameter name
-                StringBuffer name = new StringBuffer();
-                int j = i + 1;
-                for (; j < end; j++) {
-                    if (ch[j] == '}') {
+
+                } else {
+                    // Send any collected characters so far
+                    if (i > start) {
+                        addBit(new Characters(ch, start, i - start));
+                    }
+
+                    // Find closing brace, and construct parameter name
+                    StringBuffer name = new StringBuffer();
+                    int j = i + 1;
+                    for (; j < end; j++) {
+                        if (ch[j] == '}') {
+                            break;
+                        }
+                        name.append(ch[j]);
+                    }
+                    if (j == end) {
+                        // '{' without a closing '}'
+                        // save char's from '{' in previous_ch in case the
following call to characters()
+                        // provides the '}'
+                        previous_ch = new char[end - i];
+                        System.arraycopy(ch, i, previous_ch, 0, end - i);
                         break;
                     }
-                    name.append(ch[j]);
+                    addBit(new Parameter(name.toString()));
+
+                    // Continue processing
+                    i = j;
+                    start = j + 1;
+                    continue;
+
                 }
-                if (j == end) {
-                    // '{' without a closing '}'
-                    // save char's from '{' in previous_ch in case the
following call to characters()
-                    // provides the '}'
-                    previous_ch = new char[end - i];
-                    System.arraycopy(ch, i, previous_ch, 0, end - i);
-                    break;
-                }
-                addBit(new Parameter(name.toString()));
 
-                // Continue processing
-                i = j;
-                start = j + 1;
-                continue;
             }
         }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to