Quantcast
Channel: /r/powershell – How to Code .NET
Viewing all articles
Browse latest Browse all 8793

Help Parsing a crazy XML file

$
0
0

I downloaded an XML file from sharepoint. I try to import it so I can access all the elements, with no luck. I’m trying to use the “item” elements.

$content = Get-Content sharepoint.xml 

Gives 3 properties – xml, #comment, xml-stylesheet, but I know rss is there. Not sure why I can’t get it to appear.

$content.rss.channel | more 

gives me

title : MAIN TITLE link : MAIN LINK description : MAIN data lastBuildDate : DATE generator : Microsoft SharePoint Foundation RSS Generator ttl : 60 language : en-US image : image 

XML Format

<?xml version="1.0" encoding="UTF-8"?> <!--RSS generated by Microsoft SharePoint Foundation RSS Generator on 8/10/2016 11:17:01 AM --> <?xml-stylesheet type="text/xsl" href="<LOCALINFO>/_layouts/15/RssXslt.aspx?List=1d03f5cb-ef83-44fb-b891-357ff4789220" version="1.0"?> <rss version="2.0"> <channel> <title>MAIN TITLE</title> <link>MAIN LINK</link> <description> MAIN data</description> <lastBuildDate>DATE</lastBuildDate> <generator>Microsoft SharePoint Foundation RSS Generator</generator> <ttl>60</ttl> <language>en-US</language> <image> <title>TITLE</title> <url>URL</url> <link>LINK</link> </image> <item> <title>TITLE</title> <link>LINK</link> <description>data</description> <author>AUTHOR</author> <pubDate>Wed, 22 Apr 2015 13:43:40 GMT</pubDate> <guid isPermaLink="true">GUID</guid> </item> <item> <title>TITLE</title> <link>LINK</link> <description>data</description> <author>AUTHOR</author> <pubDate>Fri, 19 Jun 2015 12:43:22 GMT</pubDate> <guid isPermaLink="true">GUID</guid> </item> </channel> </rss> 

submitted by /u/Bad_Eugoogoolizer
[link] [comments]

The post Help Parsing a crazy XML file appeared first on How to Code .NET.


Viewing all articles
Browse latest Browse all 8793

Latest Images

Trending Articles



Latest Images