title: Fetching an attribute value from xml and reuse it for another xml in powershell?
body: <p>I have a question, I want to fetch an attribute from one XML and use the same fetched value for another XML. Sounds pretty easy but there is one thing I need to get around. My first XML looks like this here:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;ffprobe&gt;
  &lt;streams&gt;
      &lt;stream index="0" codec_name="prores" codec_long_name="ProRes" codec_type="video" codec_time_base="1/24" codec_tag_string="apcs" codec_tag="0x73637061" width="1920" height="1080" has_b_frames="0" sample_aspect_ratio="0:1" display_aspect_ratio="0:1" pix_fmt="yuv422p10le" level="-99" r_frame_rate="24/1" avg_frame_rate="24/1" time_base="1/24" start_pts="0" start_time="0.000000" duration_ts="1152" duration="48.000000" bit_rate="13174677" nb_frames="1152" nb_read_frames="1152"&gt;
          &lt;disposition default="1" dub="0" original="0" comment="0" lyrics="0" karaoke="0" forced="0" hearing_impaired="0" visual_impaired="0" clean_effects="0" attached_pic="0"/&gt;
          &lt;tag key="creation_time" value="2013-10-10 02:59:14"/&gt;
          &lt;tag key="language" value="eng"/&gt;
          &lt;tag key="handler_name" value="DataHandler"/&gt;
      &lt;/stream&gt;
  &lt;/streams&gt;
  &lt;/ffprobe&gt;
  </code></pre>
  
  <p>There I grab the <code>nb_frames</code> attribut and save it in a parameter called <code>$totalframes</code> :</p>
  
  <pre><code>$xmlpfad = [xml](Get-Content C:\Users\Administrator\Desktop\input_dcp\$filename+totalframes.xml)
          [string]$totalframes = $xmlpfad.ffprobe.streams.stream | select nb_frames
  </code></pre>
  
  <p>Now when I try to use this value for my second XML I get something like:</p>
  
  <p><code>&lt;NumOfRepetitions&gt;@{nb_frames=1152}&lt;/NumOfRepetitions&gt;</code> </p>
  
  <p>But I only need the value 1152 itself, without <code>@{nb_frames=}</code> is this possible in some kind of way? </p>