导致xslt错误的vb.net xpath筛选器
这段代码运行正常,但我需要在其中一个节点上进行过滤,我添加了ends wuth函数。现在我得到一个错误,说需要XSLT内容,我不确定出了什么问题导致xslt错误的vb.net xpath筛选器,vb.net,xpath,Vb.net,Xpath,这段代码运行正常,但我需要在其中一个节点上进行过滤,我添加了ends wuth函数。现在我得到一个错误,说需要XSLT内容,我不确定出了什么问题 Dim doc As New XmlDocument() doc.Load("http://hatrafficinfo.dft.gov.uk/feeds/datex/England/CurrentRoadworks /content.xml") Dim nsmgr As New XmlNamespaceManager(doc.NameTable)
Dim doc As New XmlDocument()
doc.Load("http://hatrafficinfo.dft.gov.uk/feeds/datex/England/CurrentRoadworks /content.xml")
Dim nsmgr As New XmlNamespaceManager(doc.NameTable)
nsmgr.AddNamespace("x", "http://datex2.eu/schema/1_0/1_0")
Dim nodeList As XmlNodeList = doc.SelectNodes("/x:d2LogicalModel/x:payloadPublication /x:situation/x:situationRecord/x:groupOfLocations/x:locationContainedInGroup /x:tpegpointLocation/x:*[ends-with(name(),'oint')]/x:pointCoordinates/x:latitude, nsmgr)
Microsoft的XPath实现只支持XPath 1.0,XPath 2.0中新增了以结尾的
。如果您想使用XPath2.0,请寻找第三方解决方案,如XmlPrime
您的简单谓词可以写成x:[substring(name(),string length(name())-3)='oint']