XPath可以在PowerShell下运行吗? [英] Can XPath run under PowerShell?
本文介绍了XPath可以在PowerShell下运行吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想知道PowerShell是否能够运行XPath语句。
I would like to know on whether PowerShell is able to run XPath statement or not.
$sXpath = "//li[@class='sbsb_c gsfs')]//div[@class='sbqs_c']"
有没有人有任何建议?
提前感谢任何建议
Does anyone have any suggestions?
Thanks in advance for any suggestions
提前感谢任何建议
推荐答案
是的,
如果xml是
<?xml version =" 1.0"?>
< parent xmlns:xsi =" http://www.w3.org / 2001 / XMLSchema的实例" >
< child name ='r'> tt< / child>
< child> ; rr< / child>
< / parent>
r = [xml](cat C:\ test.xml)
r=[xml](cat C:\test.xml)
r.SelectNodes ('// parent / child [@ name =" r"]')
#output
name #text
---- -----
r.SelectNodes('//parent/child[@name="r"]') #output name #text ---- -----
这篇关于XPath可以在PowerShell下运行吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文