问题描述
两种序列之间是否有一种简单而有决定性的方法来区分
:
< 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.
推荐答案
不是第一个样本有一个空text()节点作为第一个孩子,并且
第二个不是吗?
Franck,e-
Doesn''t the first sample have an empty text() node as first child, and
the second doesn''t ?
Franck,e-
不是第一个样本有一个空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
这篇关于如何区分< XX>< / XX>和< XX />与SAX的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!