我正在为300,301,302等编写XML Parser错误代码的单元测试用例,但我无法在Google搜索中找到好的示例,并附有真实示例。请任何人解释用于testdata目的的确切真实世界示例。
简单的XML示例如下
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Summary>
<State>
<Code>0</Code>
<Desc>success</Desc>
<msg>Processed Successfully</msg>
</State>
</Summary>
答案 0 :(得分:0)
301不是标准的XML解析器错误。但是,它在IBM的RNX0351消息中使用,因此您可能会发现下面摘录的documentation有用:
300 The parser reached the end of the document before the document was complete.
301 The %HANDLER procedure for XML-INTO or XML-SAX returned a non-zero value, causing the XML parsing to end.
302 The parser does not support the requested CCSID value or the first character of the XML document was not '<'.
303 The document was too large for the parser to handle. The parser attempted to parse the incomplete document, but the data at the end of the document was necessary for the parsing to complete.
基于此,您无法创建一个XML文档,因为解析代码而不是数据会引发301文档。