K_reverter blog migration preliminary completion

Source: Internet
Author: User
Tags xslt website hosting
Since I arrived in Beijing, my dissatisfaction with the http://www.step1.cn website gradually become more and more, first of all, because of the difference between the north and south network, I am on this website is slow, directly caused me the inconvenience of updating, in addition, the content of the website is messy. To meet my personal needs for a blog, I used a huge dottext, which is neither necessary nor easy to maintain, but also very slow, now I have made up my mind to migrate the blog feature to cnblogs.
As a matter of fact, I have long had such an idea, but I have never found a suitable website hosting solution. More or less, there are some unsatisfactory aspects, such as the current blog Park, which is good in all aspects, that is, the search function is too bad. At one time, I wanted to continue using my own dottext because of this, but now I have finally re-selected it and it feels pretty good.
Blog migration is a very difficult task. I have to write nearly 100 articles. Article The complete transfer here is by no means an easy task, remembering that the last time I migrated from http://www.blogcn.com to http://www.step1.cn I copied the last article (at that time there were only about 10 articles, it was acceptable ), it is not possible to do this because it is based on dottext, so it is relatively easy to combine.
The principle is to use the dottext backup function to obtain an XML file myblogdata. XML, and then generate RSS-based XML files through XSLT conversion, and then add them in cnblogs dottext by using the RSS import function. This ensures that the content is complete and, the date is also earlier, which ensures the absolute integrity of the migration.
The following is the XSLT file I used for conversion. Code For example, if you are interested, you can take a look (for the convenience of conversion, I deleted some namespaces in the backup file myblogdata. XML ). View XSLT File Content
<? XML version = "1.0" encoding = "UTF-8" ?>
< XSL: stylesheet Version = "1.0" Xmlns: XSL = "Http://www.w3.org/1999/XSL/Transform" >
< XSL: Output Method = "XML" />

< XSL: Template Match = "/" >
< XSL: Element Name = "RSS" >
< XSL: attribute Name = "Version" > < XSL: Text > 2.0 </ XSL: Text > </ XSL: attribute >
< XSL: Apply-templates Select = "Cnblogsdata" />
</ XSL: Element >
</ XSL: Template >

< XSL: Template Match = "/Cnblogsdata" >
< XSL: Element Name = "Channel" >
< Title > < XSL: value- Select = "Blog_config/Title" /> </ Title >
< Link > Http://www.step1.cn/ </ Link >
< Description > < XSL: value- Select = "Blog_config/subtitle" /> </ Description >
< Managingeditor > < XSL: value- Select = "Blog_config/username" /> </ Managingeditor >
< Generator > . Text Version 0.958.2004.214 </ Generator >
< XSL: Apply-templates Select = "Blog_content [posttype = 1]" > < XSL: Sort Order = "ASCENDING" /> </ XSL: Apply-templates >
</ XSL: Element >
</ XSL: Template >

< XSL: Template Match = "/Cnblogsdata/blog_content" >
< XSL: If Test = "Position ()> 70 and position () & lt; = 90" >
< XSL: Element Name = "Item" >
< XSL: Apply-templates Select = "Title" />
< XSL: Apply-templates Select = "Dateadded" />
< XSL: Apply-templates Select = "Author" />
< XSL: Apply-templates Select = "Text" />

< Link > Http://www.step1.cn/archive/ < XSL: value- Select = "Translate (substring-before (dateupdated, 'T '),'-','/')" /> / < XSL: value- Select = "ID" /> . Aspx </ Link >
< Guid > Http://www.step1.cn/archive/ < XSL: value- Select = "Translate (substring-before (dateupdated, 'T '),'-','/')" /> / < XSL: value- Select = "ID" /> . Aspx </ Guid >
< Comments > Http://www.step1.cn/archive/ < XSL: value- Select = "Translate (substring-before (dateupdated, 'T '),'-','/')" /> / < XSL: value- Select = "ID" /> . Aspx # feedback </ Comments >

</ XSL: Element >
</ XSL: If >
</ XSL: Template >

< XSL: Template Match = "/Cnblogsdata/blog_content/Title" >
< XSL: Element Name = "Title" >
< XSL: copy- Select = "Text ()" />
</ XSL: Element >
</ XSL: Template >

< XSL: Template Match = "/Cnblogsdata/blog_content/dateadded" >
< XSL: Element Name = "Pubdate" >
< XSL: copy- Select = "Text ()" />
</ XSL: Element >
</ XSL: Template >

< XSL: Template Match = "/Cnblogsdata/blog_content/author" >
< XSL: Element Name = "Author" >
< XSL: copy- Select = "Text ()" />
</ XSL: Element >
</ XSL: Template >

< XSL: Template Match = "/Cnblogsdata/blog_content/text" >
< XSL: Element Name = "Description" >
< XSL: copy- Select = "Text ()" />
</ XSL: Element >
</ XSL: Template >

</ XSL: stylesheet >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.