我有一个类似this的xml文件
<test-run id="2" duration="508.56199999999995" testcasecount="5" total="5" passed="5" failed="0" inconclusive="0" skipped="0" result="Passed" start-time="2019-01-25T 15:40:27Z" end-time="2019-01-25T 15:43:20Z">
<test-suite type="Assembly" name="Spok.Messaging.UITests.dll" fullname="c:\jenkins\workspace\SpokSTA\CCP.Messaging.Web.Automation.Adhoc\tests\Spok.Messaging.UITests\bin\Debug\netcoreapp2.1\Spok.Messaging.UITests.dll" total="5" passed="5" failed="0" inconclusive="0" skipped="0" result="Passed" duration="508.56199999999995">
<test-suite type="TestSuite" name="Spok" fullname="Spok" total="5" passed="5" failed="0" inconclusive="0" skipped="0" result="Passed" duration="508.56199999999995">
<test-suite type="TestSuite" name="Messaging" fullname="Spok.Messaging" total="5" passed="5" failed="0" inconclusive="0" skipped="0" result="Passed" duration="508.56199999999995">
<test-suite type="TestSuite" name="UITests" fullname="Spok.Messaging.UITests" total="5" passed="5" failed="0" inconclusive="0" skipped="0" result="Passed" duration="508.56199999999995">
<test-suite type="TestSuite" name="WebMessaging" fullname="Spok.Messaging.UITests.WebMessaging" total="5" passed="5" failed="0" inconclusive="0" skipped="0" result="Passed" duration="508.56199999999995">
<test-suite type="TestFixture" name="ComposeContainerTests" fullname="Spok.Messaging.UITests.WebMessaging.ComposeContainerTests" total="4" passed="4" failed="0" inconclusive="0" skipped="0" result="Passed" duration="387.448">
<test-case name="Test_Compose_MessageToSingleContact" fullname="Spok.Messaging.UITests.WebMessaging.ComposeContainerTests.Test_Compose_MessageToSingleContact" methodname="Test_Compose_MessageToSingleContact" classname="Spok.Messaging.UITests.WebMessaging.ComposeContainerTests" result="Passed" duration="92.018" asserts="0">
<properties>
<property name="ParallelScope" value="All" />
<property name="LevelOfParallelism" value="4" />
<property name="CodeBeamer" value="18160" />
<property name="TestId" value="121018123964" />
<property name="BrowserCount" value="1" />
<property name="UserCount" value="2" />
</properties>
<output>Some Output</output>
</test-case>
<test-case name="Test_Compose_AddThenRemoveRecipients" fullname="Spok.Messaging.UITests.WebMessaging.ComposeContainerTests.Test_Compose_AddThenRemoveRecipients" methodname="Test_Compose_AddThenRemoveRecipients" classname="Spok.Messaging.UITests.WebMessaging.ComposeContainerTests" result="Passed" duration="112.154" asserts="0">
<properties>
<property name="ParallelScope" value="All" />
<property name="LevelOfParallelism" value="4" />
<property name="CodeBeamer" value="10085" />
<property name="TestId" value="153859944702" />
<property name="BrowserCount" value="1" />
<property name="UserCount" value="4" />
</properties>
<output>Some Output</output>
</test-case>
<test-case name="Test_Compose_MessageToMultipleContact" fullname="Spok.Messaging.UITests.WebMessaging.ComposeContainerTests.Test_Compose_MessageToMultipleContact" methodname="Test_Compose_MessageToMultipleContact" classname="Spok.Messaging.UITests.WebMessaging.ComposeContainerTests" result="Passed" duration="114.37899999999999" asserts="0">
<properties>
<property name="ParallelScope" value="All" />
<property name="LevelOfParallelism" value="4" />
<property name="CodeBeamer" value="18160" />
<property name="TestId" value="121018123940" />
<property name="BrowserCount" value="1" />
<property name="UserCount" value="3" />
</properties>
<output>Some Output</output>
</test-case>
<test-case name="Test_Compose_SearchForAndAddMultipleRecipientsToNewMessage" fullname="Spok.Messaging.UITests.WebMessaging.ComposeContainerTests.Test_Compose_SearchForAndAddMultipleRecipientsToNewMessage" methodname="Test_Compose_SearchForAndAddMultipleRecipientsToNewMessage" classname="Spok.Messaging.UITests.WebMessaging.ComposeContainerTests" result="Passed" duration="68.896999999999991" asserts="0">
<properties>
<property name="ParallelScope" value="All" />
<property name="LevelOfParallelism" value="4" />
<property name="CodeBeamer" value="18163" />
<property name="TestId" value="121018131646" />
<property name="BrowserCount" value="1" />
<property name="UserCount" value="4" />
</properties>
<output>Some Output</output>
</test-case>
</test-suite>
<test-suite type="TestFixture" name="ThreadContainerTests" fullname="Spok.Messaging.UITests.WebMessaging.ThreadContainerTests" total="1" passed="1" failed="0" inconclusive="0" skipped="0" result="Passed" duration="121.11399999999999">
<test-case name="Test_Thread_MessageBetweenTwoUsers" fullname="Spok.Messaging.UITests.WebMessaging.ThreadContainerTests.Test_Thread_MessageBetweenTwoUsers" methodname="Test_Thread_MessageBetweenTwoUsers" classname="Spok.Messaging.UITests.WebMessaging.ThreadContainerTests" result="Passed" duration="121.11399999999999" asserts="0">
<properties>
<property name="ParallelScope" value="All" />
<property name="LevelOfParallelism" value="4" />
<property name="CodeBeamer" value="18160" />
<property name="TestId" value="121018123962" />
<property name="BrowserCount" value="2" />
<property name="UserCount" value="2" />
</properties>
<output>Some Output</output>
</test-case>
</test-suite>
</test-suite>
</test-suite>
</test-suite>
</test-suite>
<errors />
</test-suite>
我正在按照this示例将其映射到java对象。
我想知道是否可以在取消编组时跳过xml中的某些父标记。
就像示例xml中一样,我只想要<test-case></test-case>
标签中的数据。我必须创建多个不需要的模型类,而不必使用多个父标记。
还有一个在线工具,我可以在其中基于xml字符串为我的模型类创建模式。