XML
■ このスレッドは過去ログ倉庫に格納されています
0200nobodyさん
04/03/23 23:59ID:6bD0ZCwnnamespaceの有り/無しによってtemplateがapplyされない。助けて。
----- test.xsl -----
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="html"/>
</xsl:stylesheet>
-----------------
[実行例] $ xsltproc.exe -v test.xsl test.xml 2>&1 | grep xsltProcessOneNode
----- test.xml -----
<?xml version="1.0"?>
<html xmlns="http://www.w3.org/1999/xhtml"/>
-----------------
xsltProcessOneNode: no template found for /
xsltProcessOneNode: no template found for html
このようにマッチしない。でも、namespaceを消したり名前を付けたりするとマッチする。
----- test.xml -----
<?xml version="1.0"?>
<html xmlns:xhtml="http://www.w3.org/1999/xhtml"/>
-----------------
xsltProcessOneNode: no template found for /
xsltProcessOneNode: applying template 'html' for html
#現象が再現できる最小のソースなので、それに関しては突っ込まないで。
■ このスレッドは過去ログ倉庫に格納されています