DOM ドキュメント/要素のルート タグに名前空間宣言属性を追加できるようにしたいと考えています。
コード的には、次のようなものから行きたいと思います:
<xsl:stylesheet
xmlns:xlink="http://www.w3.org/TR/xlink/"
xmlns="http://www.w3.org/1999/xhtml">
これに:
<xsl:stylesheet
xmlns:xlink="http://www.w3.org/TR/xlink/"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:util="http://www.url.to.util"> <-- New namespace declaration
私が現在やろうとしていること:
xsl.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:util", "http://www.url.to.util")
しかし、明らかに、それは機能していません。しかし、どうすればこれを行うことができますか?
よろしくお願いします。