0
У меня есть XML, который я пытаюсь найти:Комплекс XPath ищет атрибуты?
<debts>
<section id="24" description="YYYYY">
<section id="28" description="xxx">
<section id="31" description="xxx">
<account accountNumber="2312323" creditorId="1" amount="1200" proposedAmount="1000" percentage="11" owner="2">
<foo/>
</account>
</section>
<section id="32" description="xxx"/>
<section id="33" description="xxx"/>
</section>
<section id="29" description="xxx">
<section id="34" description="xxx"/>
</section>
<section id="30" description="xxx">
<section id="37" description="xxx"/>
<section id="38" description="xxx"/>
<section id="39" description="xxx"/>
</section>
</section>
</debts>
По сути, то, что я пытаюсь сделать, это найти все счета узлов, которые сидят под секцией YYYYY (что вполне вероятно, не только узел на этом уровне). Как я могу сделать это с помощью XPath (в частности, я использую Hpricot на Rails)
+1 - Для полноты: это находит все узлы учетных записей в узлах * all * секции, которые имеют описание «YYYYY». – Tomalak