开发者

xPath between nodes

开发者 https://www.devze.com 2023-03-21 11:53 出处:网络
Ok say I had a document i开发者_运维知识库n the format of: <root> <item> <sometag>

Ok say I had a document i开发者_运维知识库n the format of:

<root>
    <item>
        <sometag>
        </sometag>    
    </item>
    Text I want to grab
    <someweirdtag>
    </someweirdtag>
</root>

Is there any way I can get "Text I want to grab" from between the nodes using xPath?


Supposed XML:

<root>
    <item>
        <sometag>
        </sometag>

    </item>
    Text I want to grab
    <someweirdtag>
    </someweirdtag>
</root>

XPath:

root/text()

Result: Text I want to grab

Reference: XSLT - retrieving an XMl tag value without its inner tags

0

精彩评论

暂无评论...
验证码 换一张
取 消