match uncaught though declared in XSL

我怕爱的太早我们不能终老 提交于 2019-12-02 14:55:15

问题


I've the below XML.

<para indent="no">
   <star.page>18</star.page> Further to same.
</para>

and when i run the below XSLT.

<xsl:template match="para">

    <xsl:value-of select="./node()[1][self::star.page]|./label/node()[1][self::star.page]"/>
    <div>
        <xsl:choose>
            <xsl:when test="./@align">
                <xsl:attribute name="class"><xsl:text>para align-</xsl:text><xsl:value-of select="./@align"/></xsl:attribute>
            </xsl:when>
            <xsl:otherwise>
                <xsl:attribute name="class"><xsl:text>para</xsl:text></xsl:attribute>
            </xsl:otherwise>
        </xsl:choose>
        <xsl:apply-templates/>
    </div>
</xsl:template>

When i run this, instead of printing <div class="para">18</div>, it is printing <div class="para"></div>

please let me know where am i going wrong and how can i fix this.

Thanks

来源:https://stackoverflow.com/questions/27164342/match-uncaught-though-declared-in-xsl

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!