我是XML的新手,正在尝试创建XML报告。我得到错误元素的内容模型ExecutionResult不允许在这个位置使用元素Module。用于模块标签,同样也用于Step标签。我不确定错误是什么。
<ExecutionResult>
<Script_Name>abc</Script_Name>
<Tester_Name>poiuytrewwq</Tester_Name>
<Execution_Date>12 June 2015</Execution_Date>
<ExecutionStartTime>10:15:36:01AM</ExecutionStartTime>
<ExecutionEndTime>10:20:36:01AM</ExecutionEndTime>
<ExecutionTimeTaken>0:5:00</ExecutionTimeTaken>
<Final_Status>FAIL</Final_Status>
<Module>CreatePO
<Step>
<SlNo>1</SlNo>
<Step_Name>xyz</Step_Name>
<Result>Pass</Result>
<Time_Taken>1.1 Sec</Time_Taken>
<ScreenShot> </ScreenShot>
</Step>
</Module>
非常感谢任何帮助
答案 0 :(得分:0)
很多。找出问题所在。错误发生在DTD文件中,并对我的XML进行了一些更改。
'\n'
下面是我创建的DTD文件。
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE Result SYSTEM "report.dtd">
<?xml-stylesheet type="text/xsl" href="abc.xsl" ?>
<Result>
<ExecutionResult>
<Script_Name>abc</Script_Name>
<Tester_Name>poiuytrewwq</Tester_Name>
<Execution_Date>12 June 2015</Execution_Date>
<ExecutionStartTime>10:15:36:01AM</ExecutionStartTime>
<ExecutionEndTime>10:20:36:01AM</ExecutionEndTime>
<ExecutionTimeTaken>0:5:00</ExecutionTimeTaken>
<Final_Status>FAIL</Final_Status>
</ExecutionResult>
<Module>
<Module_Name>Open Po </Module_Name>
<Step>
<SlNo>1</SlNo>
<Step_Name>xyz</Step_Name>
<Status>Pass</Status>
<Time_Taken>1.1 Sec</Time_Taken>
<InputValue>098</InputValue>
<Message>pass</Message>
<ScreenShot>No</ScreenShot>
</Step>
<Step>
<SlNo>2</SlNo>
<Step_Name>pqr</Step_Name>
<Status>Fail</Status>
<Time_Taken>1.2 Sec</Time_Taken>
<InputValue>098</InputValue>
<Message>pass</Message>
<ScreenShot>location</ScreenShot>
</Step>
</Module>
<Module>
<Module_Name>EditPO</Module_Name>
<Step>
<SlNo>3</SlNo>
<Step_Name>123</Step_Name>
<Status>Pass</Status>
<Time_Taken>1.1 Sec</Time_Taken>
<InputValue>098</InputValue>
<Message>pass</Message>
<ScreenShot>No</ScreenShot>
</Step>
<Step>
<SlNo>4</SlNo>
<Step_Name>456</Step_Name>
<Status>Fail</Status>
<Time_Taken>1.2 Sec</Time_Taken>
<InputValue>098</InputValue>
<Message>pass</Message>
<ScreenShot>location</ScreenShot>
</Step>
</Module>
</Result>
现在唯一剩下的就是为此添加一个XSL文件,我应该很高兴。