22 votes

XML Dump

If you’ve been developing XSLT for Umbraco, you’ve probably already done your share of <textarea><xsl:copy-of select="." /></textarea> to examine the XML you’re transforming... let’s get rid of that habit and do something much better.

With this simple package you’ll have instant access to all published nodes, selectable by id or document type - many browsers support viewing XML in a nice color-coded fashion, so now you can let IE6 do the only thing it’s good at and leave it open on your secondary screen :-)

Files Installed

The package installs a Template, an XSLT Macro and a Config - the files are:

~/masterpages/XMLDump.master
~/xslt/XMLDump.xslt
~/config/XMLDump.config

How To Use

A Note On Security

Because installing XMLDump will allow anyone to see the entire data structure of your site, I've decided to require an extra step that makes you, the developer, responsible for switching the feature on and off. You can do that in two different ways:

  1. XMLDump will look for a property called xmldumpAllowedIPs recursively upwards from the start node selected for viewing (see below) and if that property contains the IP address of the current request (the REMOTE_ADDR server variable), it will render the XML. So you need to add a textstring property to your "website" Document Type and subsequently fill in your IP address on the corresponding content node before XMLDump will render anything.

  2. As of version 0.9.3 you can also add the IP address(es) to the XMLDump.config file in the configfolder - there should be an empty <xmldumpAllowedIPs> element in there which you can fill in.

Viewing the XML

After you've successfully installed the package, you can use the altTemplate syntax to view the underlying XML of your Umbraco website - just open your site in a web browser and go to the following URL:

http://yourwebsite.com/xmldump

Or, if you're not using Directory URLs:

http://yourwebsite.com/xmldump.aspx

You can also view the XML for a specific page by doing the same thing, e.g.:

http://yourwebsite.com/about/xmldump

XMLDump allows a set of options on the query string and conveniently displays what they are at the top of its output.

 

Revision History

  • v0.9.6: Add dict option for Dictionary items.
  • v0.9.5: Add support for nuPickers XML and JSON properties. Add the help option.
  • v0.9.4: Updated to use new build script
  • v0.9.3: Add config file for the xmldumpAllowedIPs key
  • v0.9.2: Support XPath CheckBox List and CheckBox Tree with the mntp option too. Add count of matched nodes to output for xpath option
  • v0.9.1: Bugfix release
  • v0.9: Lots of refactoring. Added options search & mntp, changed some logic in xpath option
  • v0.8: "Universal Binary" (compatible with both XML formats). Changed to use altTemplate syntax (e.g., to just get $currentPage). Added activation for security reasons
  • v0.7: Added options: xpath & property
  • v0.6: Added options: media & sitemap
  • v0.5: Initial version, supporting the options: nodetype & hidden

Chriztian Steinmeier, April 2014 (Initial version: November 2009)

Screenshots

Package owner

Chriztian Steinmeier

Chriztian Steinmeier

Chriztian has 8791 karma points

Package Compatibility

This package is compatible with the following versions as reported by community members who have downloaded this package:
Untested or doesn't work on Umbraco Cloud
Version 8.18.x (untested)

You must login before you can report on package compatibility.

Previously reported to work on versions: 7.5.x, 7.4.x, 7.3.x, 7.2.x, 7.1.x, 7.0.x

Package Information

  • Package owner: Chriztian Steinmeier
  • Created: 26/11/2009
  • Current version 0.9.6
  • License MIT
  • Downloads on Our: 7.6K

External resources