xslを使用してhtmlの一部を抽出したい:
<td>
<div>
<table>
<tbody>
<tr><td></td><td></td></tr>
</tbody>
<tfoot>
<tr>
<td></td>
<td class="comment-form"><form id="add-comment-586631"></form></td>
</tr>
</tfoot>
</table>
</div>
<a id="comments-link-586631" class="comments-link" data-comments-count="0" title="ask author for clarification about this post">add comment</a>
</td>
私はこれを作りたい(div内のもの):
<table>
<tbody>
<tr><td></td><td></td></tr>
</tbody>
<tfoot>
<tr>
<td></td>
<td class="comment-form"><form id="add-comment-586631"></form></td>
</tr>
</tfoot>
</table>
この例でいくつかの順列を試しましたが、うまくいきませんでした:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:x="http://india.com/states">
<xsl:strip-space elements="*" />
<xsl:output indent="yes" method="html" />
<xsl:template match="//div/node()">
<xsl:copy-of select="*" />
<xsl:apply-templates />
</xsl:template>
</xsl:stylesheet>
誰かが私がここで欠けているものを指摘できますか?ありがとう