On your page with the macro can you tag the following to the url ?umbDebugShowTrace=true this will give trace at bottom of screen and possibly more meaninful error can you post that error here.
You're anchor at the bottom is self-closing - "/>Lees verder.." should be ">Lees verder.." That's why it won't compile. If you write these in Visual Studio or in the new version of Umbraco, you'll get compile error checking. Saves me a lot of time.
To use a result tree fragment in a path expression, first convert it to a node-set using the msxsl:node-set() function. To use a result tree fragment in a path expression, first convert it to a node-set using the msxsl:node-set() function. at System.Xml.Xsl.Runtime.XsltConvert.EnsureNodeSet(IList`1 listItems)
at System.Xml.Xsl.CompiledQuery.Query. match="/">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current, Double {urn:schemas-microsoft-com:xslt-debug}position, Double {urn:schemas-microsoft-com:xslt-debug}last, IList`1 {urn:schemas-microsoft-com:xslt-debug}namespaces) in ---\xslt\LatestNews.xslt:line 25 at System.Xml.Xsl.CompiledQuery.Query.(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator , Double , Double ) at System.Xml.Xsl.CompiledQuery.Query.Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) at System.Xml.Xsl.CompiledQuery.Query.Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer) at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results) at umbraco.macro.GetXsltTransformResult(XmlDocument macroXML, XslCompiledTransform xslt, Dictionary`2 parameters) at umbraco.macro.GetXsltTransformResult(XmlDocument macroXML, XslCompiledTransform xslt) at umbraco.macro.loadMacroXSLT(macro macro, Hashtable attributes, Hashtable pageElements)
Just a suggestion if the site is big or going to get bigger the getting of last update date would be quicker if using umbraco examine, lee kelleher has done some xslt extensions for it as well see http://farmcode.org/page/Umbraco-Examine.aspx its on codeplex in the contrib section there is the xslt extensions see http://examine.codeplex.com/
The site is not going to be that big, i'm guessing that there will be just one newsoverview. But! I got it working, only not the last updated node but just the last node is being used. But I think you can tune the code up to make it the last updated node.
Bryan - this won't quite get you the same thing. That should get you the last node in terms of the sort order of the tree, but that can be changed by your users. When you assign a variable a value this way (not using the select attribute), you do need to convert it to a node set using msxml:node-set(). (That's msxml, not msxsl.) Just create another variable and assign it msxml:node-set($lastUpdatedNode).
Ismail - that's an interesting idea using Examine to select a node instead of xslt. Is it really faster for big sites? I would think the code above would still perform pretty well. Is it because the Examine indexes would already have update dates sorted?
Jeff,
Examine uses lucene search engine which is lightening quick I have done something similar in the past, you use an xslt extension method that calls examine that calls , you could also do it with c# in the template as well
Wich gives no error but also no output. And the output when I print the value of $lastCreatedNode is:
<div title="Macro Tag: 'LatestNews'" style="border: 1px solid #009;">02010-07-28T00:00:00Admin0InfoColumn2 <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer in urna sollicitudin magna aliquet lacinia eget ac nisi. Sed vel mi et nisi imperdiet pulvinar ut pellentesque sem. Phasellus ipsum nulla, pharetra quis iaculis eget, lacinia quis lectus. Pellentesque iaculis ultrices diam, tristique adipiscing libero mattis nec. Mauris facilisis orci vitae sem vulputate placerat et in justo. Nam tortor nulla, malesuada eu eleifend eu, gravida sed metus.p>
<p>Dit is nog een column test paginap>
This is all the data(property's value i've made) as I dont see the id and nodeName.
Last updated node
Hey Guys,
So.. I have a tree:
And the plan is to get the last updated node from Columns and add it to a placeholder in Home.
This is what I got:
And my error is:
So, im brand new to this, read: just started learning xslt couple of hours ago. Some help would be appreciated :D
And i've tried to google it, searched the documentation, looked through the old forum(thats why i'm this "far"). Now I'm stuck, whats wrong?
Bryan,
On your page with the macro can you tag the following to the url ?umbDebugShowTrace=true this will give trace at bottom of screen and possibly more meaninful error can you post that error here.
Regards
Ismail
How could I forget that?
XSLT compile error.
at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(XmlReader reader, Boolean include)
at System.Xml.Xsl.Xslt.XsltLoader.Load(Compiler compiler, Object stylesheet, XmlResolver xmlResolver)
at System.Xml.Xsl.Xslt.Compiler.Compile(Object stylesheet, XmlResolver xmlResolver, QilExpression& qil)
at System.Xml.Xsl.XslCompiledTransform.LoadInternal(Object stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)
at umbraco.macro.CreateXsltTransform(XmlTextReader xslReader, Boolean debugMode)
at umbraco.macro.getXslt(String XsltFile)
at umbraco.macro.loadMacroXSLT(macro macro, Hashtable attributes, Hashtable pageElements)
You're anchor at the bottom is self-closing - "/>Lees verder.." should be ">Lees verder.." That's why it won't compile. If you write these in Visual Studio or in the new version of Umbraco, you'll get compile error checking. Saves me a lot of time.
@Jeff, Ah.. I see.
below is the new code, I also forgot the "}" :$
So now I get the error:
To use a result tree fragment in a path expression, first convert it to a node-set using the msxsl:node-set() function.
To use a result tree fragment in a path expression, first convert it to a node-set using the msxsl:node-set() function.
at System.Xml.Xsl.Runtime.XsltConvert.EnsureNodeSet(IList`1 listItems)
at System.Xml.Xsl.CompiledQuery.Query.
match="/">(XmlQueryRuntime
{urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator
{urn:schemas-microsoft-com:xslt-debug}current, Double
{urn:schemas-microsoft-com:xslt-debug}position, Double
{urn:schemas-microsoft-com:xslt-debug}last, IList`1
{urn:schemas-microsoft-com:xslt-debug}namespaces) in
---\xslt\LatestNews.xslt:line
25
at
System.Xml.Xsl.CompiledQuery.Query.(XmlQueryRuntime
{urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator , Double ,
Double )
at System.Xml.Xsl.CompiledQuery.Query.Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
at System.Xml.Xsl.CompiledQuery.Query.Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument,
XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter
writer)
at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results)
at umbraco.macro.GetXsltTransformResult(XmlDocument macroXML, XslCompiledTransform xslt, Dictionary`2 parameters)
at umbraco.macro.GetXsltTransformResult(XmlDocument macroXML, XslCompiledTransform xslt)
at umbraco.macro.loadMacroXSLT(macro macro, Hashtable attributes, Hashtable pageElements)
Bryan,
Just a suggestion if the site is big or going to get bigger the getting of last update date would be quicker if using umbraco examine, lee kelleher has done some xslt extensions for it as well see http://farmcode.org/page/Umbraco-Examine.aspx its on codeplex in the contrib section there is the xslt extensions see http://examine.codeplex.com/
Regards
Ismail
Hey Ismail,
The site is not going to be that big, i'm guessing that there will be just one newsoverview. But! I got it working, only not the last updated node but just the last node is being used. But I think you can tune the code up to make it the last updated node.
Solution code:
Using Umbraco 4.5.1 here people.
Can someone mark this thread as solved?
Bryan - this won't quite get you the same thing. That should get you the last node in terms of the sort order of the tree, but that can be changed by your users. When you assign a variable a value this way (not using the select attribute), you do need to convert it to a node set using msxml:node-set(). (That's msxml, not msxsl.) Just create another variable and assign it msxml:node-set($lastUpdatedNode).
Ismail - that's an interesting idea using Examine to select a node instead of xslt. Is it really faster for big sites? I would think the code above would still perform pretty well. Is it because the Examine indexes would already have update dates sorted?
Jeff, Examine uses lucene search engine which is lightening quick I have done something similar in the past, you use an xslt extension method that calls examine that calls , you could also do it with c# in the template as well
Regards
Ismail
Ok, so i've decided this solution was not the best. I want to sort it on his createData.
I have:
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" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets"
exclude-result-prefixes="msxml
umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes
Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings
Exslt.ExsltSets ">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:param name="columnNodes" select="$currentPage/../Newslist[@isDoc and @id=1168]" />
<xsl:template match="/">
<xsl:variable name="columnNode">
<xsl:for-each select="$columnNodes/Newspage">
<xsl:sort select="@createDate" order="descending" />
<xsl:if test="position() = 1">
<xsl:copy-of select="current()" />
xsl:if>
xsl:for-each>
xsl:variable>
<xsl:variable name="lastCreatedNode" select="msxml:node-set($columnNode)" />
<xsl:value-of select="$lastCreatedNode/@id" disable-output-escaping="yes"/>
xsl:template>
xsl:stylesheet>
Wich gives no error but also no output. And the output when I print the value of $lastCreatedNode is:
This is all the data(property's value i've made) as I dont see the id and nodeName.
Try this:
<xsl:variable name="lastCreatedNode" select="msxml:node-set($columnNode)/Newspage" />
Thats it Jeff! Thanks!
A great start to my morning.
tampa seo
is working on a reply...