Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

XML Text Within Tag Name

$
0
0

Hi,

I am trying to programmatically extract the name and value within a tag on an XML file. For example, using the following XML I want to extract the name "language" and the value of language ("English", "German", "French","Polish) rather than the actual value of the tag (En.Book1.com, etc.)

Is there a command to extract this information without reading through the XML file character by character?

$Xml = @"
<?xml version="1.0" encoding="utf-8"?>
<Book>
  <projects>
    <project name="Book1" date="2009-01-20">
      <editions>
        <edition language="English">En.Book1.com</edition>
        <edition language="German">Ge.Book1.Com</edition>
        <edition language="French">Fr.Book1.com</edition>
        <edition language="Polish">Pl.Book1.com</edition>
      </editions>
    </project>
  </projects>
</Book>
"@



Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>