Read .xslt data from URL

Harish Patil 21 Reputation points
2021-07-09T07:01:48.227+00:00

Hi Team,

I am trying to get webparts details from SharePoint 2013 sites. I have some custom webparts with some features. I am con not install that feature on SharePoint online site. So I am trying to those web parts details with PnP PowerShell command. Some of the webparts returns below url. Also in this it is not returing CData content.

XslLink = ~/_layouts/15/somename.industry.stylecomponents/xslt/linkbox.xslt

So we are thing we can read .xslt data and push it.

Sample code:

Connect-PnPOnline $SourceUrl -UseWebLogin
$WebPartManager = Get-PnPWebPart -ServerRelativePageUrl $PageUrl
#Get All Web Parts data
 foreach ($WebPart in $WebPartManager) {            
     if ($WebPart.WebPart.Title.ToUpper().Contains('NWA'.ToUpper())) {
     write-Host $($WebPart.WebPart.Title)
      #$webpartProps = Get-PnPWebPartProperty -ServerRelativePageUrl $PageUrl -Identity $WebPart.Id
      $webpartProps = $webpart.WebPart.Properties.FieldValues
       foreach ($webpartProp in $webpartProps) {                        
                        Write-Host "Content : " $webpartProp["Content"]    
                      }
                }

Can anyone help us to how to get data from .xslt?

Thanks,
Harish Patil

SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,597 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Emily Du-MSFT 44,311 Reputation points Microsoft Vendor
    2021-07-12T08:18:09.103+00:00

    @Harish Patil

    Here're steps:

    1.Go to a classic page -> Edit page -> Insert Web Part -> Content Rollup -> XML Viewer.
    2.Edit Web Part ->Add XML Link.


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.