Mike
Mike

Reputation: 35

greater than symbol works but less than not in xslt

I have Datapower http based MPG service. I am getting response soap message from backend which has Size element values Ex:

<Size><10000</Size>
<Size>10000></Size>

It is showing correctly as it is in datapower probe. but when it comes to soapUI lessthan symbol not showing correctly.Showing like below:

<Size>&lt;10000</Size>
<Size>10000></Size>

How to get '<' less than symbol correctly?

Thanks for your help in advance.

Upvotes: 0

Views: 2455

Answers (2)

albciff
albciff

Reputation: 18507

The follow symbols in a XML: <, >, ",',& could be replaced by &lt;,&gt;,&quot;,&apos;,&amp; respectively. In the XML text to avoid errors it's recommended to replace all, but only < and & must be replaced all the times (as @michael.hor257k comments). Alternatively to avoid the replacement it's possible to use CDATA).

Probably Datapower "prettify" the response before it shows you (here I'm only guessing since I don't know Datapower).

SOAPUI doesn't perform any transformation in your response and it is showing the response like it is, this is why you see &lt; character; due your web server replace < to avoid generate a invalid XML response.

Here you can see a good response explaining the general rules for this characters in XML depends on where they are.

Upvotes: 1

Rudramuni TP
Rudramuni TP

Reputation: 1278

Less than symbol is escape character in XSLT. So you can use &#x003C; instead of &lt;

Upvotes: 0

Related Questions