How to output XML

4 replies [Last post]
Last seen: 10 years 3 weeks ago
Joined: 2011-04-18

I would like to output an XML file instead of a page that has the theme. Is any of the videos in the site covers that?


Chris Shattuck
Last seen: 10 weeks 3 days ago
Joined: 2009-08-16
Hi there! There's not any

Hi there!

There's not any videos currently which cover this, though data export and migration would be a good subject to cover in general. To get you pointed in the right direction, you should be able to use a combination of Views along with template file overrides to get what you're looking for.


Last seen: 10 years 10 weeks ago
Joined: 2011-02-28
I'm also interested in this

I was curious as to how one might use a PHP library (not specific to Drupal), include it in a module and use its methods to convert, consume or output data in different formats.

For example, as arashaga asked above, how could we output xml on a page. Drupal already allows to output RSS feeds out of the box. But what if we wanted to output other formats? There is a cool library class called "Format" that allows convert between Array, Object, JSON, XML, CSV and Serialized data and back again easily.

You can check it out on Github here.

"Including non-Drupal libraries in modules" or something like that would be a good topic for a video.

I mean if it's do-able, haven't tried it yet.

Last seen: 10 years 3 weeks ago
Joined: 2011-04-18
Thank you Chris! Is there any

Thank you Chris! Is there any chance to have a video on that in a future? since xml/webservices are used often, I think that would be great subject for a video.


Chris Shattuck
Last seen: 10 weeks 3 days ago
Joined: 2009-08-16
arashaga - I've definitely

arashaga - I've definitely had a few requests for web services, so this is on the list for coverage at some point.

obrignoni - I know the Feeds module ( can do some of that, but I haven't dug deep into Feeds for a while. I do some coverage of including libraries for a JavaScript example here, but showing a PHP example would probably be a good idea.

Thanks for the suggestions, folks!


Add to playlist

Add to , or

Add to new playlist:

Add to playlist
This is a member-only feature
But, it's easy to become a member

Add to cart:

Contact us

Below are the supported keyboard shortcuts for our video player.

Start / stop video
Go to next video
Go to previous video
Increase or decrease player speed by 20%
Skip ahead or go back by 15 seconds
Jump to a percentage (2 is 20%, for example)
Toggle full screen
Videos Pricing More Search
BuildAModule Logo Icon BuildAModule Logo Icon
Become a member!
1 month
6 months
10% off
12 months
20% off
All memberships come with the following:
24 / 7 access to the entire 1800+ video library
An innovative video player with a rolling transcript
Extensive Drupal and cross-platform training
A thorough and thoughtful training style
Progress tracking
Take notes on specific video sections
Intuitive multi-user management
How many users?
Go solo with a single user, or give multiple team members access through one account and get discounts by bundling multiple users into a single membership.