Document.importNode(Node,boolean) - 支持它的是什么? [英] Document.importNode(Node,boolean) - what supports it?

查看:98
本文介绍了Document.importNode(Node,boolean) - 支持它的是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

DOM API已经将公共节点importNode(Node,boolean)作为Document接口的方法包含了很长时间。实际上有什么实际的吗? Xerces 2给了我:


org.w3c.dom.DOMException:NOT_SUPPORTED_ERR:实现没有

支持所请求的对象或操作类型。 br />
at org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown

Source)

at org.apache.xerces.dom.CoreDocumentImpl。 importNode(未知

来源)

at

uk.co.weft.domutil.MaybeParseGenerator.maybeParse(MaybeParseGenerator.java:183)


这就是我试图导入的节点是否是一个

org.apache.xerces.dom.DeferredElementImpl(即用Xerces解析)或者

org.apache.crimson.tree.ElementNode(即用Crimson解析)。


-
si *** @ jasmine.org.uk (Simon Brooke) http://www.jasmine.org.uk/~simon/

Ye hypocrites!这些是你的恶作剧吗?谋杀男人并感谢上帝?

Desist,羞耻!不要再继续了:上帝不会接受你的谢谢

再次

- 罗伯特伯恩斯,''感恩国家胜利''
/>

The DOM API has included public Node importNode(Node,boolean) as a method
of the Document interface for a long time. Does anything actually
implement it? Xerces 2 is giving me:

org.w3c.dom.DOMException: NOT_SUPPORTED_ERR: The implementation does not
support the requested type of object or operation.
at org.apache.xerces.dom.CoreDocumentImpl.importNode( Unknown
Source)
at org.apache.xerces.dom.CoreDocumentImpl.importNode( Unknown
Source)
at
uk.co.weft.domutil.MaybeParseGenerator.maybeParse( MaybeParseGenerator.java:183)

This is so whether the node I''m trying to import is an
org.apache.xerces.dom.DeferredElementImpl (i.e. parsed with Xerces) or a
org.apache.crimson.tree.ElementNode (i.e. parsed with Crimson).

--
si***@jasmine.org.uk (Simon Brooke) http://www.jasmine.org.uk/~simon/
Ye hypocrites! are these your pranks? To murder men and give God thanks?
Desist, for shame! Proceed no further: God won''t accept your thanks for
murther
-- Robert Burns, ''Thanksgiving For a National Victory''

推荐答案

Simon Brooke写道:
Simon Brooke wrote:

DOM API包含公共节点importNode(节点, boolean)作为Document接口的方法

很长一段时间。实际上有什么实际的吗?
The DOM API has included public Node importNode(Node,boolean) as a method
of the Document interface for a long time. Does anything actually
implement it?



当然应该有效;我写了Xerces首次实现的那个

函数,实际上是游说DOM WG在标准中包含

的人之一。如果正确导入的节点实现了

DOM API,并且导入的实现没有一些阻止它的原因(例如,它'''特别是一个只读的DOM,

,例如Xalan的内部数据模型的DOM视图),函数

应该有效。毕竟,这不是一门科学。它只是一个树木行走者

喂养一个树木建造者。


我必须相信这个问题存在于你还没被告知的事情中我们。


-

()ASCII Ribbon Campaign | Joe Kesselman

/ \标记HTML电子邮件! |系统architexture和动态诗歌

Certainly should work; I wrote Xerces'' first implementation of that
function, and in fact was one of those who lobbied the DOM WG to include
it in the standard. If the node being imported properly implements the
DOM APIs, and the implementation being imported into doesn''t have some
reason for blocking this (eg, that it''s specifically a read-only DOM,
such as the DOM view of Xalan''s internal data model), the function
should work. It isn''t rocket science, after all; it''s just a tree-walker
feeding a tree-builder.

I have to believe the problem resides in something you haven''t told us.

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry


在消息< iJ ************************* *****@comcast.com> ;, Joe Kesselman

(''k*************@comcast.net'')写道:
in message <iJ******************************@comcast.com>, Joe Kesselman
(''k*************@comcast.net'') wrote:

Simon Brooke写道:
Simon Brooke wrote:

> DOM API包含公共节点importNode(Node,boolean)作为
Document接口的方法很长一段时间。有什么事情可以实现吗?
>The DOM API has included public Node importNode(Node,boolean) as a
method of the Document interface for a long time. Does anything actually
implement it?



当然应该工作;我写了Xerces首次实现的那个

函数,实际上是游说DOM WG在标准中包含

的人之一。如果正确导入的节点实现了

DOM API,并且导入的实现没有一些阻止它的原因(例如,它'''特别是一个只读的DOM,

,例如Xalan的内部数据模型的DOM视图),函数

应该有效。毕竟,这不是一门科学。它只是一个树木行走者

喂养一个树木建造者。


我必须相信这个问题存在于你还没被告知的事情中我们。


Certainly should work; I wrote Xerces'' first implementation of that
function, and in fact was one of those who lobbied the DOM WG to include
it in the standard. If the node being imported properly implements the
DOM APIs, and the implementation being imported into doesn''t have some
reason for blocking this (eg, that it''s specifically a read-only DOM,
such as the DOM view of Xalan''s internal data model), the function
should work. It isn''t rocket science, after all; it''s just a tree-walker
feeding a tree-builder.

I have to believe the problem resides in something you haven''t told us.



好​​的,那我也要相信。此外,这是我的代码中另一个已经存在了很长时间的事情(自2003年以来这个

案例),我很确定以前工作(但它可能只用过

Crimson)。我曾经有过无意中偶然发生的情况

依赖于库中的错误,当该库被修复后,我的所有

代码都破了。


如果此类失败,它将返回一个文本节点,其中嵌入式标记的''flat''表示为
。看一下生产服务器日志,我看到它已经间歇性地以这种方式失败了一段时间,但是

的失败根本就没有被注意到。生产服务器上的故障

与开发服务器上的故障不同,我将在下面详细说明

的差异。生产服务器使用Crimson进行解析,但是Xerces

来构建文档 - 我不记得为什么,但可能只是一个

的疏忽。


有问题的课程是:


// ************************ ************************** ********************* \ < br $>
// *

// MaybeParseGenerator.java *

// *

//作者:Simon Brooke *

//创建时间:2003年1月17日*

//

OK, then I have to believe that, too. Furthermore, this is another of the
bits of my code that have been around for a long time (since 2003 in this
case), and I''m sure it used to work (but it may only ever have worked with
Crimson). I have had occasions in the past where I have inadvertently
depended on bugs in a library, and when that library has been fixed all my
code broke.

If this class fails, it returns a text node with a ''flat'' representation of
the embedded markup. Looking at the production server logs I see that it
has been intermittently failing in this way for some time, but that the
failure simply has not been noticed. The failure on the production servers
is different from the failure on the development server, I''ll detail that
difference below. The production severs use Crimson to parse, but Xerces
to construct documents - I can''t remember why, but probably just an
oversight.

The class in question is:

//************************************************** *********************\
// *
// MaybeParseGenerator.java *
// *
// Author: Simon Brooke *
// Created: 17th January 2003 *
//


修订版:1.7.4.3
Revision: 1.7.4.3


这篇关于Document.importNode(Node,boolean) - 支持它的是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆