importNode和根节点名称 [英] importNode and root node name
问题描述
在页面上:
< http://thoraval.yvon.free.fr/Fixed_layout/import_nodes.xhtml>
导入svg文件时我有要做的事情:
document.importNode(
req.responseXML.getElementsByTagName(req.parameter s.root)[0],true))
>
(第46/47行)
如果是SVG,则需要
:req.parameters.root =''svg''
和''数学''在MathML的情况下
没有用于获取根节点的DOM方法,不允许
指定root是svg | math ???
或者我可以使用DOM / XPath吗?
即类似:
req.responseXML.evaluate(' '/'',document,nsResolver,XPathResult.ANY_TYPE,
null);
???
-
UneBévue
at the page :
<http://thoraval.yvon.free.fr/Fixed_layout/import_nodes.xhtml>
when importing an svg document i have to do :
document.importNode(
req.responseXML.getElementsByTagName(req.parameter s.root)[0],true))
(lines 46/47)
in case of SVG : req.parameters.root = ''svg''
and ''math'' in case of MathML
there is no DOM method for getting the root node, enabling not to
specify the root is svg|math ???
or could i do that using DOM/XPath ?
ie something like :
req.responseXML.evaluate(''/'',document, nsResolver, XPathResult.ANY_TYPE,
null);
???
--
Une Bévue
推荐答案
UneBévue< un ************ @ weltanschauung。 com.invalidwrote:
Une Bévue <un************@weltanschauung.com.invalidwrote:
>
有没有用于获取根节点的DOM方法,不允许
指定root是svg | math ???
>
there is no DOM method for getting the root node, enabling not to
specify the root is svg|math ???
req.responseXML.documentElement
-
UneBévue
req.responseXML.documentElement
response given over the french clj (fr.c.l.j)
--
Une Bévue
UneBévue写道:
Une Bévue wrote:
页面:
< http://thoraval.yvon.free.fr/Fixed_layout/import_nodes.xhtml>
导入svg文档时我有要做的事情:
document.importNode(
req.responseXML.getElementsByTagName(req.parameter s.root)[0],true))
>
(第46/47行)
如果是SVG,则需要
:req.parameters.root =''svg''
和''数学''在MathML的情况下
没有用于获取根节点的DOM方法,不能使用
指定root是svg | math ?? ?
或者我可以使用DOM / XPath吗?
即类似:
req.responseXML .evaluate(''/'',document,nsResolver,XPathResult.ANY_TYPE,
null);
???
at the page :
<http://thoraval.yvon.free.fr/Fixed_layout/import_nodes.xhtml>
when importing an svg document i have to do :
document.importNode(
req.responseXML.getElementsByTagName(req.parameter s.root)[0],true))
(lines 46/47)
in case of SVG : req.parameters.root = ''svg''
and ''math'' in case of MathML
there is no DOM method for getting the root node, enabling not to
specify the root is svg|math ???
or could i do that using DOM/XPath ?
ie something like :
req.responseXML.evaluate(''/'',document, nsResolver, XPathResult.ANY_TYPE,
null);
???
根元素可以简单地访问
req.responseXML.documentElement
根XPath数据模型中的节点是DOM
模型中的文档节点,因此如果您想访问根节点,那么您只需要
req.responseXML
但是你不能导入文件节点。
-
Martin Honnen
http://JavaScript.FAQTs.com/
Martin Honnen < ma ******* @ yahoo.dewrote:
Martin Honnen <ma*******@yahoo.dewrote:
>
根元素只需
req.responseXML.documentElement
XPath数据模型中的根节点是DOM
模型中的文档节点,因此如果你想要访问根节点然后你只需要
req.responseXML
然而你不能导入文档节点秒。
>
The root element is simply accessible as
req.responseXML.documentElement
The root node in the XPath data model is the document node in the DOM
model thus if you want to access the root node then you simply need
req.responseXML
However you can''t import document nodes.
好的,非常感谢!
-
UneBévue
OK, fine thanks !
--
Une Bévue
这篇关于importNode和根节点名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!