<AppXmlLogWritter>
<LogData>
<LogID>235820130202134128634953894887814709273</LogID>
<LogDateTime>20130102134128</LogDateTime>
<LogType>Warning</LogType>
<LogFlag>PACSFlag</LogFlag>
<LogApplication>PACSLogApplication</LogApplication>
<LogModule>PACSLogModule</LogModule>
<LogLocation>PACSLogLocation</LogLocation>
<LogText>PACSLogText</LogText>
</LogData>
<LogData>
<LogID>2358201302021341286349538948878147093861</LogID>
<LogDateTime>20130202134128</LogDateTime>
<LogType>Error</LogType>
<LogFlag>PACSFlag</LogFlag>
<LogApplication>PACSLogApplication</LogApplication>
<LogModule>PACSLogModule</LogModule>
<LogLocation>PACSLogLocation</LogLocation>
<LogText>PACSLogText</LogText>
</LogData>
</AppXmlLogWritter>
Xpath查询
/AppXmlLogWritter/LogData[LogApplication/text()[starts-with(. , 'P')]and position()>='1' and position()<='3']
**Before Filter**
<Node 1> Position 1
<Node 2> Position 2
<Node 3> Position 3
<Node 4> Position 4
<Node 5> Position 5
<Node 6> Position 6
**After Filter**
<Node 2> Position 2
<Node 5> Position 5
<Node 6> Position 6
请参阅上面的节点列表在过滤器之前我有 6 个节点但是当我过滤时我得到三个节点所以我为那个 position()>='1' 和 position()<='3 编写查询但结果只有 1 个节点sql 在过滤器行号适用于所有行之后存在行号条件,但在 xml 中我该如何实现。我没有使用 LINQ to XML