Simply Friday

CasaVictoriaLa.com XML Modification

Monday 14th April, 2014

Problem

I'm moving a website from the WordPress platform to the Squarespace platform.  To do this I am pulling an XML file of all posts and pages on the current WordPress site. 

The posts consists of various meta data: titles, categories etc, but the two things that I am concerned with are content and image.  The nature of the WordPress export is that it is placing the image in the wrong part of the xml file.  this is causing the SquareSpace import to miss the image - as a result over 1,000 posts appear on the new site but with no images.

Solution

I can manually manipulate the XML file by copying the image location and placing it inside the content tags (with relevant meta.)  I've tested this and it works fine - but - I don't want to manually do this for over 1,000 posts.  So - I need a script written that will do it for me.

The Script

The script needs to do the following:

Examples

I have attached 2 examples of the item - one original and one modified so you can see the desired end result

item-original.xml

item-modified.xml

XML File

This actual XML file is currently around 8.5 Mb with over 100k lines of code.

Full XMl File

Can You Help?

© 2011-2017 Simply Friday All Rights Reserved| Contact|  Design by me