Я застрял здесь. Не могу придумать умный способ сделать это. Нужно для извлечения данных в разделе «отчетность: линия». 2 данные должны быть возвращены «отчетность: имя» и «отчетность: идентификатор». «report: line» находится под случайными числами подуровня «report: forder». поэтому они могут быть в сотой подпапке. поэтому мне нужен своего рода умный код, чтобы автоматически находить правильный уровень для получения данных.
необходимо видеть следующее как результат:
test2,-32
test3,1
test14,56
ниже приведен исходный файл xml:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<reporting:root xmlns:reporting="TEST">
<reporting:default0 reporting:type="TEST">
<reporting:header>
<reporting:property>TEST</reporting:property>
</reporting:header>
<reporting:window reporting:Id="1" reporting:level="0" reporting:name="TEST" reporting:parentId="-1">
<reporting:folder reporting:Id="2" reporting:level="1" reporting:name="name1" reporting:parentId="1">
<reporting:name>test00</reporting:name>
<reporting:ident>2</reporting:ident>
<reporting:folder reporting:Id="3" reporting:level="2" reporting:name="name2" reporting:parentId="2">
<reporting:name>test0</reporting:name>
<reporting:ident>31</reporting:ident>
<reporting:folder reporting:Id="4" reporting:level="3" reporting:name="name3" reporting:parentId="3">
<reporting:name>test1</reporting:name>
<reporting:ident>4</reporting:ident>
<reporting:line reporting:Id="676" reporting:level="4" reporting:name="name4" reporting:parentId="4">
<reporting:name>test2</reporting:name>
<reporting:ident>-32</reporting:ident>
</reporting:line>
<reporting:line reporting:Id="661" reporting:level="4" reporting:name="name5" reporting:parentId="4">
<reporting:name>test3</reporting:name>
<reporting:ident>1</reporting:ident>
</reporting:line>
</reporting:folder>
<reporting:folder reporting:Id="5" reporting:level="3" reporting:name="name6" reporting:parentId="3">
<reporting:name>test4</reporting:name>
<reporting:ident>5</reporting:ident>
<reporting:folder reporting:Id="6" reporting:level="4" reporting:name="name7" reporting:parentId="5">
<reporting:name>test5</reporting:name>
<reporting:ident>6</reporting:ident>
<reporting:folder reporting:Id="7" reporting:level="5" reporting:name="name8" reporting:parentId="6">
<reporting:name>test6</reporting:name>
<reporting:ident>7</reporting:ident>
<reporting:folder reporting:Id="8" reporting:level="6" reporting:name="name9" reporting:parentId="7">
<reporting:name>test7</reporting:name>
<reporting:ident>8</reporting:ident>
<reporting:folder reporting:Id="9" reporting:level="7" reporting:name="name10" reporting:parentId="8">
<reporting:name>test8</reporting:name>
<reporting:ident>9</reporting:ident>
</reporting:folder>
</reporting:folder>
</reporting:folder>
</reporting:folder>
</reporting:folder>
</reporting:folder>
</reporting:folder>
<reporting:folder reporting:Id="10" reporting:level="1" reporting:name="name11" reporting:parentId="1">
<reporting:name>test10</reporting:name>
<reporting:ident>10</reporting:ident>
<reporting:folder reporting:Id="11" reporting:level="2" reporting:name="name12" reporting:parentId="10">
<reporting:name>test11</reporting:name>
<reporting:ident>11</reporting:ident>
<reporting:folder reporting:Id="12" reporting:level="3" reporting:name="name13" reporting:parentId="11">
<reporting:name>test12</reporting:name>
<reporting:ident>12</reporting:ident>
<reporting:folder reporting:Id="13" reporting:level="4" reporting:name="name14" reporting:parentId="12">
<reporting:name>test13</reporting:name>
<reporting:ident>13</reporting:ident>
<reporting:line reporting:Id="160" reporting:level="5" reporting:name="name15" reporting:parentId="13">
<reporting:name>test14</reporting:name>
<reporting:ident>56</reporting:ident>
</reporting:line>
</reporting:folder>
</reporting:folder>
</reporting:folder>
</reporting:folder>
</reporting:window>
</reporting:default0>
</reporting:root>