My client wishes to export the entire content and structure of their umbraco site to one (or more) XML file(s). So I'm guessing the XML would mirror the node structure and for each node, it would give the URL's to any images and the html content for any node properties.
Can anyone think of the easiest way to do this? The only way I can think of it is to write some .NET code that recursively traverses the content tree and for each node, extracts the content out of the properites for the corresponding document type.
That's almost EXACTLY what I'm looking for Warren. The only problem is images are only shown as an ID and not as a URL. I guess there's not much I can do about that is there?
you can make a simple XSLT macro, that traverses all nodes and outputs them just the way you want it.Put the macro in an empty template, create a content node using that template, and you're flying.
That way you can structure the XML exactly the way you want it, and apply formatting to the fields that you want formatted in a special way etc. etc.
I've used this method very often for creating XML based product feeds to be integrated into external sites (fx. shopping portals). It takes a bit of work, but gives you complete control.
Export whole site to XML
Hello All,
My client wishes to export the entire content and structure of their umbraco site to one (or more) XML file(s). So I'm guessing the XML would mirror the node structure and for each node, it would give the URL's to any images and the html content for any node properties.
Can anyone think of the easiest way to do this? The only way I can think of it is to write some .NET code that recursively traverses the content tree and for each node, extracts the content out of the properites for the corresponding document type.
Has anyone else ever had to do this?
Cheers
Rich
You could just give them the copy of the XML Cache of the nodes that can be found at /data/umbraco.config which is the XML file of your site.
Hope this helps.
Warren :)
That's almost EXACTLY what I'm looking for Warren. The only problem is images are only shown as an ID and not as a URL. I guess there's not much I can do about that is there?
Hi Richard,
you can make a simple XSLT macro, that traverses all nodes and outputs them just the way you want it.Put the macro in an empty template, create a content node using that template, and you're flying.
That way you can structure the XML exactly the way you want it, and apply formatting to the fields that you want formatted in a special way etc. etc.
I've used this method very often for creating XML based product feeds to be integrated into external sites (fx. shopping portals). It takes a bit of work, but gives you complete control.
Best regards,
Soeren Sprogoe
is working on a reply...