Announcement Announcement Module
Collapse
No announcement yet.
Strange Behavior in PayloadTransformingInterceptor Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Strange Behavior in PayloadTransformingInterceptor

    Hi,

    I'm attempting to use the PayloadTransformingInterceptor to transform only the reponse from an endpoint by wrapping it with a "standard" response element, but the resulting response is not what I expected.

    As an example, my endpoint is returning the following which will be transformed:

    Code:
    <element>Hello World!</element>
    My XSL Stylesheet looks like this:

    Code:
    <?xml version="1.0"?>
    
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    
        <xsl:output method="xml" encoding="UTF-8" indent="yes"/>
    
        <xsl:template match="/">
            <Response>
                <xsl:apply-templates/>
            </Response>
        </xsl:template>
    
        <xsl:template match="@*|node()">
            <xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy>
        </xsl:template>
    
    </xsl:stylesheet>
    The expected response is this (seen when transforming it through Ant):

    Code:
    <?xml version="1.0" encoding="UTF-8"?><Response>
    <element>Hello World!</element>
    </Response>
    But I'm getting this:

    Code:
    <?xml version="1.0" encoding="UTF-8"?><Response><Response><Response></Response></Response></Response>
    Any suggestions??? Thanks.

    Kevin

  • #2
    I think your XSLT is incorrect. I am not an XSLT expert, so I can't tell you what's wrong with it, but you can try and look at http://www.w3schools.com/xsl/default.asp

    Comment

    Working...
    X