如何区分< XX>< / XX>和< XX />与SAX [英] How to differentiate between <XX></XX> and <XX/> with SAX

查看:79
本文介绍了如何区分< XX>< / XX>和< XX />与SAX的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

两种序列之间是否有一种简单而有决定性的方法来区分




< XX>< / XX>





< XX />


EndElement回调不提供此信息。


谢谢,

Pascal。

Is there a simple and determinist way to make the difference
between the 2 sequences:

<XX></XX>

and

<XX/>

The EndElement callback does not provide this information.

Thanks,
Pascal.

推荐答案

dp ***** @ yahoo.fr 写道:
dp*****@yahoo.fr wrote:
是否有简单而有决定性的方法在两个序列之间做出改变:

< XX>< / XX>



< XX / >


编号。他们的意思完全相同。为什么你认为你需要它?

EndElement回调不提供这些信息。
Is there a simple and determinist way to make the difference
between the 2 sequences:

<XX></XX>

and

<XX/>
No. Their meaning is exactly the same. Why do you think you need that?
The EndElement callback does not provide this information.



Rolf Magnus写道:
Rolf Magnus wrote:
dp*****@yahoo.fr 写道:

dp*****@yahoo.fr wrote:

是否有一种简单而有决定性的方法来区分两个序列:

< XX>< / XX>



< XX />

不。他们的意思完全一样。为什么你认为你需要它?
Is there a simple and determinist way to make the difference
between the 2 sequences:

<XX></XX>

and

<XX/>

No. Their meaning is exactly the same. Why do you think you need that?




不是第一个样本有一个空text()节点作为第一个孩子,并且

第二个不是吗?


Franck,e-



Doesn''t the first sample have an empty text() node as first child, and
the second doesn''t ?

Franck,e-

EndElement回调不提供此信息。
The EndElement callback does not provide this information.




文章< 41 ******************* ****@news.free.fr>,

Franck Guillaud< f _ ************** @ free.fr>写道:
In article <41***********************@news.free.fr>,
Franck Guillaud <f_**************@free.fr> wrote:
< XX>< / XX>

< XX />
<XX></XX>

<XX/>


不是第一个样本有一个空text()节点作为第一个孩子,而
第二个不是吗?

Doesn''t the first sample have an empty text() node as first child, and
the second doesn''t ?




No.


(XML本身并没有定义任何文本节点这样的东西。

Infoset有字符信息项,在任何一种情况下都没有任何一个是
.XPath数据模型中没有文本节点

case,SAX解析器不调用字符方法。)


- Richard



No.

(XML itself doesn''t define any such thing as a "text node". The
Infoset has character information items, and there aren''t any of them
in either case. The XPath data model doesn''t have a text node in either
case, and SAX parsers do not call the characters method.)

-- Richard


这篇关于如何区分&lt; XX&gt;&lt; / XX&gt;和&lt; XX /&gt;与SAX的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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