I have an XML document which references a XSL file for the output of HTML.
In the XSL file I have put in various "<xsl:value-of select="fieldname" />" tags referencing items in my XML File.
However for the items I have not mapped they just appear as a long string at the bottom of the html page?
Do I really need to omit all my xml data items not referenced in the XSL file for them to go away or is there a trick to this or a bug in my XSL file?
j
This is result of the XSLT Processing Model.
XSLT uses its *built-in templates` if a node should be processed and no template in the XSLT code is matching it. The built-in template that matches a text node copies it.
Solution:
Add this template that overrides the XSLT built-in template for text nodes:
This causes any text node not matched by a more specific template in the code (and not copied with
xsl:copy-oforxsl:value-of) to be ignored (“deleted”).