Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
导致xslt错误的vb.net xpath筛选器_Vb.net_Xpath - Fatal编程技术网

导致xslt错误的vb.net xpath筛选器

导致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)

这段代码运行正常,但我需要在其中一个节点上进行过滤,我添加了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)
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']