Handling %25 sign in XML data

Hi,

We just ran into an unusual issue on BC 4.6 (940 + CoreFix 2 [Fixes 1-7 + SP1&2]) where a % was causing the transmission of a XML document, via HTTP post, to fail. The log and the saved pipeline showed that the value was null. We are using the name=value option to transmit this particular XML doc.

Has anyone run into this before? I fixed it by converting the % to “%” but why would this be an issue in the first place? Also, is there any other way to fix this? I am also looking into the encoding parameter to see if varying that would have any effect on this issue.

Thanks,

ajandja

Hi ajandja - that’s strange. I don’t see the need for escaping “%” as an XML character entity either.

I thought I’d mention that WM references variables in the pipeline as “%VARIABLENAME%” (also within DSPs as “%value VARNAME%”.) Do you think this might have anything to do with it?

Hey Andrew!
I´m getting a problem like you. A % character in my xml cause this error in a documentToRecord service:
PE ref missing terminating ‘;’
Have you ane news about your issue?
Thank you,
Fabiano

Integration Server uses the percent sign to effect pipeline substitution.

If you try to set a value (click on blue arrow) on a value called POValue for example, then a popup box will appear with a box to input the POValue. Let’s say you have a value already in the pipeline called PurchaseOrderValue. You would put the following into the set value popup box: %PurchaseOrderValue% and you would check the box below labeled “Perform Variable Substituition.”

I saw someplace in a manual that this could be changed, but I can’t remember where or how. Probably the admin manual.

I suspect that perhaps the IS is getting upset because it expects a value surrounded by percent signs??

Just a guess.

HTH,

Ray

Fabiano,
If there’s no space between the ‘%’ and the next character an XML parser treats that character as the start of a Parameter Entity reference (PE ref), which must be terminated by a ‘;’. Hence, the message you received. So if the ‘%’ is to be transmitted as such it must be escaped using a character entity reference, as Andrew originally noted: “%”. HTH.

Hey Michael,

Thanks for that little tidbit. I’ll add it to the vault of knowledge!

ray

A percent character (%) is allowed to appear in the
character data of an XML document.

For example, the following XML document is well-formed:

<?xml version=“1.0”?>
<doc>110%</doc>

Within a DTD, the percent character (%) may only be used
to declare and reference parameter entities. Any other
percent characters within a DTD must be encoded using
character references (e.g., “%”).

For example, the following XML document, which is
equivalent to the XML document above, is well-formed,
since it encodes the percent character as “%”:

<?xml version=“1.0”?>
<!DOCTYPE doc [
<!ENTITY percent “110%”>
]>
<doc>&percent;</doc>

The following XML document is not well-formed, since
its DTD contains a percent character that is not used
to declare or reference a parameter entity.

<?xml version=“1.0”?>
<!DOCTYPE doc [
<!ENTITY percent “110%”>
]>
<doc>&percent;</doc>

Hope this helps.

Bob