delphi xpath xml query

前端 未结 4 489
温柔的废话
温柔的废话 2021-01-01 03:15

I\'m trying to locate the value for in the following XML File using a XPath query.



        
4条回答
  •  遥遥无期
    2021-01-01 04:01

    You should write it like this:

    iNode := Sel.selectNode('//Link[@role = "self"]');
    

    which will get you the first Link node in the document with attribute role="self" (even if there is more than one).

    Or you can go the absolute path:

    iNode := Sel.selectNode('/Response/ResourceSets/ResourceSet/Resources/DataflowJob/Link[@role = "self"]');
    

    or even something in between

    iNode := Sel.selectNode('//Resources/DataflowJob/Link[@role = "self"]');
    

提交回复
热议问题