XSLT transformation adds empty <p></p> Tags [closed]

rewesp

New Member
I have to adjust a set of complicated XSLT files, and I have the problem, that it is adding empty paragraph tags and I'm not sure why. I believe it has something to do with the for-each, but I don't know where these tags come from, as there are no p-Tags anywhere included in the transformation.Is this something that xsl may add by itself when something is empty in the for-each? It is always getting directly after the for-each and and directly before the end of the for-each (effectivly surrounding the generated output).How could I check inside the for-each if the tag is empty?Thank you for your help.The files are mainly of this structure:\[code\]// Base File<?xml version="1.0"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:import href="http://stackoverflow.com/questions/11153462/library.xsl" /><xsl:output method="html" encoding="utf-8" indent="yes"/>// Some keys are defined here ...<xsl:template name="base"> <xsl:call-template name="someTemplate" /> // More templates follow ...</xsl:template></xsl:stylesheet>\[/code\]The library.xsl now has the template "someTemplate" like this:\[code\]<xsl:template name="someTemplate"> <xsl:for-each select="[very complicated XPath here]"> // Some HTML generation, but absolutely withoug p-tags!!!! </xsl:for-each></xsl:template>\[/code\]I have read the thread XSLT: How to exclude empty elements from my result? and have as well tried to apply the named pattern (as my files are using for-each), but it did not work out.
 
Back
Top