Jintrick.netagenda2005年10月アーカイブ → 2005年10月15日

一言メモ(パラメタをQNameで評価させるケース)

applyStylesheetメソッドの第二引数にdictionaryを指定してXSLTにパラメタを渡せるようになっている。xslt.applyStylesheet(source_document, { "foo" : "success" })といったように。ところがNote that the string passed "success" had to be quoted, otherwise it is interpreted as an XPath query for the childs of root named "success".とあるように、<xsl:param name="foo" select="success" /> と評価されるので、文字列として渡したい場合には { "foo" : "'success'" } とすれば、<xsl:param name="foo" select="'success'" />となるわけ。……パラメタをQNameで評価させたいときもある、と。


webmaster@jintrick.net
公開: 2005年10月15日
カテゴリ: XSLT