xslt - Do not add comm if attribute is null -
i have string of code come delineate attribute of feature name. how ever if feature null still add comma. how code ignore feature name not have value.
<xsl:for-each select="feature"> <!-- output feature name (there may more 1 feature associated --> <!-- point) identify feature attrinbutes --> <!-- associated with. --> <xsl:text>,</xsl:text> <!-- comma separate feature name code or previous feature --> <xsl:variable name="featname" select="@name"/> <!-- feature name --> <xsl:for-each select="attribute"> <xsl:if test="position() > 0"> <xsl:text>,</xsl:text> <!-- include comma if not first attribute --> </xsl:if> <!-- prefix each attribute name feature belongs followed ':' --> <xsl:if test="$includefieldnames = 'yes'"> <xsl:value-of select="concat($featname, ':')"/> <xsl:value-of select="name"/> <xsl:text>,</xsl:text> </xsl:if> <xsl:value-of select="value"/> </xsl:for-each> </xsl:for-each>
how code ignore feature name not have value.
by processing features values:
<xsl:for-each select="feature[value]"> <!-- processing here --> </xsl:for-each>
Comments
Post a Comment