Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Select-Xml -Path .\Test.xml -XPath "//subNode[@Number > 1]" |
ForEach-Object { $_.Node }
Select-Xml -Path .\TestPage.xhtml -XPath "//*[contains(@id,'test')]" |
ForEach-Object { $_.Node }
$xpath = @'
) or
Select-Xml -Path .\ValueAndName.xml -XPath $xpath |
Format-Table -AutoSize Node, @{
Name = 'Value'
Expression = { $_.Node.InnerXml }
Select-Xml -Path .\Test.xml -XPath "//subNode[not(@Number > 1)]" |
ForEach-Object { $_.Node }
<node Name="First">
<subNode Number="1" />
<subNode Number="2" />
<node Name="Second" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns="" xml:lang="en" lang="en">
<title>Test Page</title>
<h1 id="title">This is first H1 directly under 'body'</h1>
<li><h1>This is my h1 in list!</h1></li>
<li>This won't show up...</li>
<h2>Header, but smaller...</h2>
<h3>Even smaller one.</h3>
<th id="testing">Test</th>
<th><h1>Another h1 in table header...</h1></th>
<th id="othertest">Another Test</th>
<td><h1>and h1 hidden in the table cell...</h1></td>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.