开发者

xPath between nodes

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜