仮想インクルードを探してphpインクルードに変換するように、コメントのテンプレートマッチを実行しようとしています:
<node>
<!--#include virtual="/abc/contacts.html" -->
<!-- some random comment -->
</node>
に
<node>
<?php include($_SERVER[DOCUMENT_ROOT]."/abc/contacts.html"); ?>
<!-- some random comment -->
</node>
私は次のようなことをしようとしています:
<xsl:template match="comment()" >
<xsl:analyze-string select="." regex="^[\s\S]*<!">
<xsl:matching-substring>
<xsl:text disable-output-escaping="yes"><?php </xsl:text> <xsl:value-of select="." /> <xsl:text disable-output-escaping="yes"> ?></xsl:text>
</xsl:matching-substring>
</xsl:analyze-string>
</xsl:template>
この問題を解決するための助けをいただければ幸いです。