简体   繁体   中英

How can I replace `<div>` to `<h>` tags in a SharePoint site collection?

How can I replace <div> to <h> tags in a SharePoint site collection?

Could it be done in a console application or a PowerShell script? Which methods will be able to get the page source? Or is this code that is in the database?

The SharePoint Object Model can be accessed from PowerShell or other .NET languages (like C#) - this is covered by many tutorials/examples.

SPWeb.Files can be used to enumerate files within a Site and SPFile can read/write a Stream (or String). Likewise, SPSite has methods to enumerate child SPWeb objects.

However, replacing all DIV elements with H is likely wrong .. also, some artifacts (like Application Pages or Control Templates) are stored on the File System, not in the Content Database, and so cannot be accessed or modified through the above SPFile approach.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM