cancel
Showing results for 
Search instead for 
Did you mean: 

Whitespace is not allowed at this location.

Former Member
0 Kudos

Hi

I am passing an xml file to an interface and in the text if there are some special characters like &, I am getting

"Whitespace is not allowed at this location. Error processing resource " error. If flat file, content conversion is needed..what should be done for xml files as input - how do we escape the special characters...any help is greatly appreciated

thanks

Thilothama

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Thilothama,

I dint understand the Scenario you are trying to do....

anyways if you wanna do content conversion at the sender end that is you wanna covert flat file into xml file then pls go throught the information given below:

While doing content conversion you have to mention the field names in header of data type: fieldNames. Hence if the key field is not present it will throw an error in adapter monitoring, FIELD NOT FOUND.

To make note mapping cannot be performed with a flat file as XI understands only XML. Hence content conversion required.

Please go thru these links for step by step procedure to do the same:

<a href="/people/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-lengths-and-variable-substructures-to-xi-30 to send a flat file with various field lengths and variable substructures to XI 3.0</a>

<a href="/people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter">How to send a flat file with fixed lengths to XI 3.0 using a Central File Adapter</a>

<a href="/people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file">Content Conversion (Pattern/Random content in input file)</a>

<a href="http://help.sap.com/saphelp_erp2005/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm">Converting File Content in the Sender Adapter</a>

Now if it is that you wanted to covert the xml structure to flat file at the receiver end, then please go through the information below:

<a href="/people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion Receiver with Content Conversion</a>

<a href="http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/frameset.htm">Converting File Content in the Receiver Adapter</a>

Regards,

abhy

Answers (1)

Answers (1)

Former Member
0 Kudos

Check whether the value in file is valid for the corresponding XSD type of the element. Eg. you may be trying to assign a text with spaces to a number type.

Since the field value is enlosed in an XML tag there is nothing like an enclosureSign as you have it in content conversion.

In one of my previous interfaces, I had material text with spaces as the value in XML file. And I did not face any problem.

So double check the message type. Another way is to ensure that ur input XML is well formed, try and put this XML file in the mapping test environment where this message is used.

praveen

Former Member
0 Kudos

Praveen,

I did check those before...All the tags are of type string. only & symbol gives this error. All other special characters work.

Abby,

I am not doing any content conversion - just passing xml file to xi...thanks for the links..

former_member187339
Active Contributor
0 Kudos

Hi,

Can you post your input file here so that we can help you in a better way.

PS : <b>&</b> will be changed as <b>&amp;</b> in XI.

Regards

Suraj

Former Member
0 Kudos

Please provide us the under lying data type details, the input file and the error message that you are getting.

Former Member
0 Kudos

Hi Thilothama,

Please provide us the under lying data type details, the input file and the error message that you are getting.

praveen

Former Member
0 Kudos

I tested the message from the message mapping - in tabular tree view, when I give &, it gets replaced by &amp; and test is successful. But when I hardcode the input in source code view, and switch to tabular tree view, i get xml not well-formed popup error. I am getting parser exception while testing it.

Similarly when I test from HTTP client, the & does not get replaced by &amp; Do we need to do anything in mapping or in Datatype to avoid these problems? Or we have to replace & by &amp; in al the places for testing??

WHen the real message comes in, will it get replaced???

moorthy
Active Contributor
0 Kudos

HI Thilothama,

You can handle these special charcters by writing small Java functions in the Mapping. You can't do anything in data types for this.

Regards,

Moorthy

former_member187339
Active Contributor
0 Kudos

Hi,

Whichj is your sender system? We earlier had a similar situation that was an Idoc to file scenario. A field in IDoc will have <b>&</b> as the value. It will get automatically converted to <b>&amp;</b> in XI and the output XML will have &amp;.

Regards

Suraj

Former Member
0 Kudos

Its HTTP to XI to RFC. I am testing this from HTTP client.

former_member187339
Active Contributor
0 Kudos

Hi Thilothama,

I think just for testing the scenario you are using the HTTP Client :)... and in real case some other system might be sending the XML to XI thru HTTP adapter.

The XML which is to be given in the Payload area of the client should be a well formed XML so & should be changed with &amp;

But in real case it is not needed.

Regards

Suraj