XSL transformation generating output from other nodes

Posted by Abel Morelos on Stack Overflow See other posts from Stack Overflow or by Abel Morelos
Published on 2010-03-12T00:41:47Z Indexed on 2010/03/12 0:47 UTC
Read the original article Hit count: 295

Filed under:
|
|
|

I have the following XSL template:

<xsl:template match="SOAP-ENV:Body/*[local-name()='Publisher']">
    <html>      
        <xsl:call-template name="body" />
    </html>     
</xsl:template>

The previous template generates the output I want, it's generating the tags containing the output generated by the "body" template. The issue I'm having is that before the opening tag I'm getting text output from a previous node. Not sure why this is happening since I'm not selecting these other nodes. For example:

    <SOAP-ENV:Header>
    <!-- Many child nodes here-->
</SOAP-ENV:Header>
<SOAP-ENV:Body>
            <publishParty:Publisher>
                  <!-- Many child nodes here-->
            </publishParty:Publisher>
    </SOAP-ENV:Body>

Given the previous sample XML fragment, my output would contain what I would expect of formatting the Publisher element, but I'm also getting the text nodes of the children of the SOAP-ENV:Header node.

Any ideas? Thanks!

© Stack Overflow or respective owner

Related posts about xsl

Related posts about Xml