Is it possible to list the root's children? For example - I'll use the thecogworks demo as a visual aide just because we can all see it. http://demo.thecogworks.co.uk/umbraco/umbraco.aspx#content Their tree structure looks like this:
Content | +--Cog-Demo | +--Blog
Is it possible to write an XSLT to output 'Cog-Demo' and 'Blog' (I'm not worried about the formating right now.) I tried using '/child::*' to start at the root and list one level below, but it doesn't work. I suspect XSLT can't start that high. See below.
Is it possible to list the root's children?
Is it possible to list the root's children?
For example - I'll use the thecogworks demo as a visual aide just because we can all see it.
http://demo.thecogworks.co.uk/umbraco/umbraco.aspx#content
Their tree structure looks like this:
Content
|
+--Cog-Demo
|
+--Blog
Is it possible to write an XSLT to output 'Cog-Demo' and 'Blog' (I'm not worried about the formating right now.)
I tried using '/child::*' to start at the root and list one level below, but it doesn't work.
I suspect XSLT can't start that high. See below.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:Stylesheet [ <!ENTITY nbsp " "> ]>
<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" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:template match="/">
<!-- Get the root's children -->
<xsl:variable name="RootChild" select="/child::*" />
<xsl:for-each select="$RootChild" >
<xsl:value-of select="@nodeName"/> <br />
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Hi
Please check this post http://our.umbraco.org/forum/developers/xslt/18757-Select-a-node-in-up-down-style this may help you.
Pnima
Hi Jeff
Try this:
/Kim A
Kim - Thanks your example works!
Great to hear Jeff. I'm glad the code worked :)
/Kim A
is working on a reply...