"Evaluation of XSL XSL-Transform-1.xsl failed with reason: \"Unexpected child node after root node\""

Former Community Member
Not applicable

Hi,

Whatever I put in my xslt transform I get the following error:

{ "fault": { "faultstring": "Evaluation of XSL XSL-Transform-1.xsl failed with reason: \"Unexpected child node after root node\"", "detail": { "errorcode": "steps.xsl.XSLEvaluationFailed" } } }

What could I be doing wrong?

Even if I just have:

<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
</xsl:stylesheet>

... it fails with the same error.

I just want to add a SOAP header to a request that flows through. Here is an excerpt of my xslt code:

<?xml version="1.0" encoding="utf-8" ?>

<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:bsvc="urn:com.workday/bsvc"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
>

<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>

<xsl:template match="/*">
        <xsl:copy>
            <env:Header>
<wsse:Security env:mustUnderstand="1">
                    <wsse:UsernameToken>
                        <wsse:Username>...</wsse:Username>
                        <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText"
                        >.....</wsse:Password>
                    </wsse:UsernameToken>
                </wsse:Security>
            </env:Header>
            <xsl:copy-of select="@*|node()"/>                     
         </xsl:copy>
    </xsl:template>
</xsl:stylesheet>	
Solved Solved
0 2 295
1 ACCEPTED SOLUTION

Former Community Member
Not applicable

I found out what is wrong: the request I was sending contained 2 Envelopes!

I guess Apigee Edge isn't too helpful when this condition occurs.

Sorry for the noise guys!

View solution in original post

2 REPLIES 2

Former Community Member
Not applicable

I found out what is wrong: the request I was sending contained 2 Envelopes!

I guess Apigee Edge isn't too helpful when this condition occurs.

Sorry for the noise guys!

Thanks for the tip. The error message, "Unexpected child node after root node", could have been more clear that the node in question appeared in the source document.