Web site development - Open Source CMS Drupal, LAMP, PHP, Oracle. In France & on the internet everywhere

how to export content as xml from drupal using views

Nodes can be exported from a Drupal site using the Views module and some PHP code. Views theming is used to strip all HTML tags from the view so you end up with just content. Then this output is parsed through some PHP to get formatted xml content.

1. Create View with desired nodes.

Views are useful to select desired nodes. For example you may want to create an xml feed of all articles that belong to category "Open Source". So you create a view, name it Articles_OS_xml with following settings:- Provide page view, View type = list View, Use page = deselected Nodes per page = 0 Fields: Only add one field, Node id Filters Here you select desired filter, for example, Node type "is one of" story Taxonomy term = Open Source Save your view

Now run the view, you should get a list of all node ids for the desired nodes. Next you need to turn this into XML output

Create a theme for the view. This then should strip all the html tags from the output. This leaves a list of desired node id's

Get the desired data for each node using node->