missing second p tag how to get it

2019-09-05 08:24发布

I am not getting the second p tag in my xsl... providing my code below...

http://xsltransform.net/b4GWV9/17

<xsl:for-each select="child::*">
    <xsl:if test="normalize-space(.)!=''">
    <p class="specifications__value-title">
        <xsl:value-of select="." />
    </p>                                            
    </xsl:if>
</xsl:for-each>

providing my html output also below

http://jsfiddle.net/F9wh7/

<li class="specifications__value">
    <p class="specifications__value-title">Dimensions</p>
     **<p class="specifications__value-copy">5.38 x 2.75 x 0.31 inches</p>**
</li>

1条回答
Anthone
2楼-- · 2019-09-05 08:56

you need to change

<xsl:for-each select="child::*[name()!='SpecificationsHeading']">

into

<xsl:for-each select="descendant::*[name()!='SpecificationsHeading']">

I also noticed in your output that there are two <p class="specifications__value-title">. Maybe you meant the other one to be <p class="specifications__value-copy">.

查看更多
登录 后发表回答