I want to match non string in xslt 2.0
.
<td><list>
<list-item>
<p>aaaa</p>
<list>
<list-item>
<p>bbb</p>
</list-item>
</list>
</list-item>
</list>
</td>
I have done a template like this
<xsl:template match="td">
<para>
<xsl:apply-templates/>
</tps:p>
</xsl:template>
When input xml like below:
<td><list>
<list-item>
<p>aaaa</p>
<list>
<list-item>
<p>bbb</p>
</list-item>
</list>
</list-item>
</list>
kmkmkmk
</td>
Output(correct output):
<para>kmkmkmk</para>
When input xml like below (new line between td and list):
<td><list>
<list-item>
<p>aaaa</p>
<list>
<list-item>
<p>bbb</p>
</list-item>
</list>
</list-item>
</list>
</td>
Output(Incorrect output):
<para> </para>
But When input xml like below( no new line between td and list ):
<td><list>
<list-item>
<p>aaaa</p>
<list>
<list-item>
<p>bbb</p>
</list-item>
</list>
</list-item>
</list></td>
Output(correct output):
nothing display
I want to do when td
has no any text nothing display and display only display td
has text.
Why when there is a new line between <td>
and <list>
not working well and where is no new line working wells. How can I fix this?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…