源XML:
<?xml version="1.0" encoding="UTF-8"?>
<ServerAnswer>
<Booking Data="AABB150908"/>
<Booking Data="AABB150907"/>
</ServerAnswer>
我的XPath:
//Booking/@Data[substring(//Booking/@Data,4,6)]
如果我通过http://www.xpathtester.com/xpath查询xPath,我只能获得完整的数据。我怎样才能在数据中获得给定的日期?
答案 0 :(得分:0)
Xpath从1开始计数,而不是从0
开始计算substring(//Booking/@Data,5,6)