-1

我有以下 xml 文档,我需要选择 components/section/templateid=3.11 的所有入口节点。XPath 应该是什么?

     <component>
        <structuredBody>
                <component>
                    <section>
                        <templateId root="1.11"/>           
                        <entry>......</entry>                                                              
                    </section>              
                </component>    
                <component>
                    <section>
                        <templateId root="2.11"/>
                        <templateId root="2.12"/>                   
                        <entry>......</entry>
                        <entry>......</entry>
                    </section>
                </component>
                <component>
                    <section>
                        <templateId root="3.11"/>
                        <templateId root="3.12"/>                   
                        <entry>......</entry>
                        <entry>......</entry>
                    </section>
                </component>            
        <structuredBody>
     </component>
4

1 回答 1

0

这会满足您的需求吗?

//component/section/templateId[@root='3.11']/following-sibling::entry
于 2013-07-14T22:13:58.163 回答