Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

2
Is it possible to import an XML and keep part of the tree immutable?
Post Flair (click to view more posts with a particular flair)
Post Body

I'm trying to take an XML file that has 2 trees of values, a header and the data portion. I'm trying to edit multiple values in the header section, not touching the data tree and then save out the file. On the new file any value pair <ValueHere></ValueHere> that has no data is getting what looks like a carriage return/new line added so now the tool that reads the files is saying it's invalid. The example file I'm using goes from 3400 lines to 3724 lines now. I'm using the following to read and save out the file, perhaps I'm doing it wrong as I am weak on XML manipulation.

[XMXL]$Result = Get-Content -Path "C:\File.xml"

$XMLData.Save($NewFile)

Do I need to create a loop to manually try and state a null value in each empty pair or is there a way to make the data tree of values immutable? Or is there a better way to manipulate the XML file that I haven't found yet?

Author
Account Strength
90%
Account Age
9 years
Verified Email
Yes
Verified Flair
No
Total Karma
4,174
Link Karma
215
Comment Karma
3,959
Profile updated: 3 days ago
Posts updated: 3 days ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
2 years ago