我正在尝试编写一个脚本来获取多个 XML 文件中节点的值。
这是 XML 结构:
<Report>
<ReportSections>
<ReportSection>
<Body>
<ReportItems>
<Textbox Name="lbReportName">
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Activity Report</Value>
</TextRun>
</TextRuns>
</Paragraph>
</Paragraphs>
</Textbox>
</ReportItems>
</Body>
</ReportSection>
</ReportSections>
</Report>
我使用这个脚本来搜索 XML:
Select-XML -Path "N:\TEMP\XML\0.xml" –Xpath "//*[@Name='lbReportName']"
(因为名称“lbReportName”上面的结构不一样)。
现在,我怎样才能获得“活动报告”的价值?
(名称“lbReportName”之后,所有 XML 文件的结构都相同)