【问题标题】:find xpath for sibling node查找兄弟节点的 xpath
【发布时间】:2011-12-05 17:28:09
【问题描述】:

我想在 map 是任何东西的地方获取 name 的值。 我不想迭代然后找到。有什么方法可以为它编写 xpath 吗?

具有map = sec2 的节点的 xpath 是什么?请在下面找到xml。

 <section-meta-data>
            <section>
                <name>Applicant Info</name>
                <map>sec1</map>
            </section>
            <section>
                <name>prior-insurance-coverage</name>
                <map>sec3</map>
            </section>
            <section>
                <name>hipaa-guarantee-issue-coverage</name>
                <map>sec2</map>
            </section>
            <section>
                <name>medical-info</name>
                <map>sec7</map>
            </section>
            <section>
                <name>medications</name>
                <map>sec4</map>
            </section>
        </section-meta-data>

【问题讨论】:

  • .. 就是答案:)

标签: xslt xpath


【解决方案1】:

使用以下表达式:

/section-meta-data/section[map='sec2']/name

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多