Hi everybody and Scott.
I found the problem.
The length of the variable "val" to hold character data is 132 bytes but in
my exercise "len" is 6865
I mean that I receive more data that the variable can contain
So, first I think that the problem was with the call to QDCXLATE, and I
create a variable with a length of 32767 ;
xlatebuff = %subst(string:1:len)
because we area reading in blocks of 8192, there will be no problems with
reading more than the api can receive.
The problem then was triggered by the for .. to because "len" is greater
than the length of "val".
184 newval = '';
185 for x = 1 to len;
186 if ( %subst(val:x:1) >= x'40' );
187 newval = newval + %subst(val:x:1);
188 endif;
189 endfor;
It's interesting that the error raises to the XML_Parse function, even that
the error was in a subprocedure of the caller of XML_Parse.
Yes, that's because of %PADDR.
I'll change variable val and newval to 8192 bytes and see what happend.
Please, If I'm wrong, let me know :).