I have the following XSL template (I omitted the template for Organization, let me know if it's necessary):
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<xsl:output method="html" indent="yes" omit-xml-declaration="yes"/>
<xsl:template match="SOAP-ENV:Body/*[local-name()='Publisher']">
<html>
<xsl:call-template name="body" />
</html>
</xsl:template>
<xsl:template name="body">
<BODY>
<br/>
<center>
<font face="arial" size="2">
<b>Publisher <xsl:value-of select="*[local-name()='Organization']/*[local-name()='PublisherData']/*[local-name()='PublisherName']"/>
</b>
</font>
</center>
<br/>
<xsl:apply-templates select="*[local-name()='Organization']"/>
</BODY>
</xsl:template>
</xsl:stylesheet>
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:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Header>
<n1>abc</n1>
<n2>def</n2>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<Publisher>
<!--Child nodes here -->
</Publisher>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
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.
I only want to transform the contents of the Publisher element, but in the output I'll get:
abc
def
//Expected output transforming Publisher goes here
My question is, why abc and def are being selected?