XSL/XSLT
■ このスレッドは過去ログ倉庫に格納されています
0258nobodyさん
04/03/24 22:07ID:QhqWFZPyxhtml側のnamespaceの状態よってマッチしたりしなかったりするので困ってる。
----- 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
何故?また回避策は?
#現象が再現できる最小のソースです。validなxhtmlに対しても同様です。
■ このスレッドは過去ログ倉庫に格納されています