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() &gt;  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

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -