Skip to content

Instantly share code, notes, and snippets.

@leekelleher
Created April 4, 2011 16:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leekelleher/901908 to your computer and use it in GitHub Desktop.
Save leekelleher/901908 to your computer and use it in GitHub Desktop.
Dump out all content pages from Umbraco in XSLT.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp "&#x00A0;">
]>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library"
exclude-result-prefixes="msxml umbraco.library">
<xsl:output method="xml" />
<xsl:param name="currentPage"/>
<xsl:template match="/">
<!-- navigate to the root node -->
<xsl:apply-templates select="$currentPage/ancestor::root/*[@isDoc]" />
</xsl:template>
<xsl:template match="*[@isDoc]">
<div>
<!-- output all the attributes and properties -->
<xsl:apply-templates select="@* | *[not(@isDoc)]" />
</div>
<!-- output all the child documents -->
<xsl:apply-templates select="*[@isDoc]" />
</xsl:template>
<xsl:template match="@* | *[not(@isDoc)]">
<dl>
<dt>
<xsl:value-of select="name()"/>
</dt>
<dd>
<xsl:value-of select="." disable-output-escaping="yes" />
</dd>
</dl>
</xsl:template>
</xsl:stylesheet>
@greystate
Copy link

I'm actually aiming for XMLDump v1.0 to allow you to use your own "Renderer" stylesheet - i.e., you could hook this one up to do the output if you so like...

Are you using this for debugging?

/Chriztian

@leekelleher
Copy link
Author

Hey Chriztian,

I wrote it for a forum post reply: http://our.umbraco.org/forum/using/ui-questions/19140-How-to-get-an-overview-of-a-site

Not using it for my own debugging... I do all that mentally! (oh and with XMLDump too!) ;-)

Cheers, Lee.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment