w*****h 发帖数: 28 | 1 【 以下文字转载自 Java 讨论区 】
【 原文由 gas 所发表 】
no |
w*****h 发帖数: 28 | 2 【 以下文字转载自 Java 讨论区 】
【 原文由 sui 所发表 】
Why not?
>
|
w*****h 发帖数: 28 | 3 【 以下文字转载自 Java 讨论区 】
【 原文由 txvoilet 所发表 】
If a XML's DTD has two roots, but the XML just has one root.
Is the XML valid?
Another one question, who know which parser can deal with
the XML with more
than one root? How about Oracle parser? |
w*****h 发帖数: 28 | 4 【 以下文字转载自 Java 讨论区 】
【 原文由 zinczinc 所发表 】
Please read the XML1.0 spec. One root per document is for
well-formed or valid XML document. But you can always write
ill-formed ones. |
w*****h 发帖数: 28 | 5 【 以下文字转载自 Java 讨论区 】
【 原文由 txvoilet 所发表 】
Can Oracle XML parser deal with ill-formed XML? |
w*****h 发帖数: 28 | 6 【 以下文字转载自 Java 讨论区 】
【 原文由 gas 所发表 】
yes
It is not XML and you should not suppose xml parser to do so. |
w*****h 发帖数: 28 | 7 【 以下文字转载自 Java 讨论区 】
【 原文由 txvoilet 所发表 】
It is not XML? what is it then?
You said above that XML can have one root and its DTD has
tow roots.
That means a XML need not obey its DTD strictly?For example,
Here is a DTD file:
|
w*****h 发帖数: 28 | 8 【 以下文字转载自 Java 讨论区 】
【 原文由 txvoilet 所发表 】
It is not XML? what is it then?
You said above that XML can have one root and its DTD has
tow roots.
That means a XML need not obey its DTD strictly?For example,
Here is a DTD file:
|
w*****h 发帖数: 28 | 9 【 以下文字转载自 Java 讨论区 】
【 原文由 gas 所发表 】
bad-formed XML or non-XML markup language
sure |
w*****h 发帖数: 28 | 10 【 以下文字转载自 Java 讨论区 】
【 原文由 wendywh 所发表 】
XML can have several roots.
But it's hard to find a XML parser to deal with that.
As to the Oracle parser, you can check getDocumentElement(), it will
allows direct access to the child node that is the root element of
the document.But the return value is just Element. So it means that you cannnot
return a list of root elements.
I have not find any parser can return a list of root elements. |
w*****h 发帖数: 28 | 11 【 以下文字转载自 Java 讨论区 】
【 原文由 xt 所发表 】
I think our house parser can deal with that, but it will
parse the file into more than 1 message. |
b***k 发帖数: 77 | 12
It's wrong according to the specification.
That should be called XML fragment.
All you have to do is create a root yourself. something like:
&data;
you define your data as entity reference.
It's because there is only one root for every xml document.
【在 w*****h 的大作中提到】 : 【 以下文字转载自 Java 讨论区 】 : 【 原文由 xt 所发表 】 : I think our house parser can deal with that, but it will : parse the file into more than 1 message.
|