Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6356129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:54:17+00:00 2026-05-24T22:54:17+00:00

I have an XML in the format: <val:root> <bla> <value>1234</value> </val:root> I can do

  • 0

I have an XML in the format:

<val:root>
   <bla>
     <value>1234</value>
</val:root>

I can do get-content of the file to an $xml variable, but I’m having trouble with the “val:root”.

Thanks for any help!

Edit:

I tried $xml.”val:root”, $xml.val, $xml.’val:root’ and $xml.{val:root}. Found the solution in Mizo’s answer:

$xml.root.value

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T22:54:18+00:00Added an answer on May 24, 2026 at 10:54 pm

    Your XML file is missing a declaration for the val namespace. Also, the <bla> element is unterminated.

    • Place a namespace declaration in the <root> element:

      <val:root xmlns:val="urn:dummy">
      

      Then you can do

       PS C:\> $xml = [xml] (get-content test.xml)
       PS C:\Users\mizo\test> $xml.root.value
       1234
      
    • If you don’t have control over the XML data, you can declare the val namespace in a dummy root as a workaround:

      $xml = [xml] ("<dummyroot xmlns:val='urn:dummy'>" +
                    (get-content test.xml) +
                    "</dummyroot>")
      

      Then you can access the elements:

      PS C:\> $xml.dummyroot.root.value
      1234
      

    Replace urn:dummy with a relevant identifier if you wish.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a custom XML file format which can contain blocks of code within
I have an XML file with format similar to: <root> <baby> <a>stuff</a> <b>stuff</b> <c>stuff</c>
I have a file, which is in XML format (consists just of root start
I have an XML file format that contains a structure of questions: <question id=q101>
I have an XML based file format that I'm using to store and load
I have a XML file with the following data format: <net NetName=abc attr1=123 attr2=234
I have an xml file in the following format: <food> <desert> cake <desert> </food>
i get date from xml in this format: 7/16/2010 (mm/dd/yyyy) i have in my
I wonder if somebody can help me flatten an XML file to CSV format.
I have got below xml format file called ResourceData.xml . <?xml version=1.0 encoding=utf-8 ?>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.