Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I can't get it worked, please help
xmlns:umbraco.editorControls="urn:umbraco.editorControls"
...
<xsl:for-each select="umbraco.editorControls:getContentsWithTags('tag')">
A little more informations on what your problem is would help.
To see what this function returns just use
<xsl:copy-of select="umbraco.editorControls:getContentsWithTags('tag')" />
and then take a look into the html code.
hth, Thomas
Hi, Thomas
the problem is in xslt - I can't save it:
System.Xml.Xsl.XslTransformException: Cannot find the script or external object that implements prefix 'urn:umbraco.editorControls'. at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList`1[] args) at (XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) at Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) at Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results) at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer, Boolean closeWriter) at System.Xml.Xsl.XmlILCommand.Execute(IXPathNavigable contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter results) at System.Xml.Xsl.XmlILCommand.Execute(IXPathNavigable contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, TextWriter results) at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results) at umbraco.presentation.webservices.codeEditorSave.SaveXslt(String fileName, String oldName, String fileContents, Boolean ignoreDebugging)
Alexei, can you show us the xsltExtensions.config from the /config folder?
Looking forward to your info.
Cheers,
/Dirk
Dirk, here it is
<?xml version="1.0" encoding="utf-8"?> <XsltExtensions> <ext assembly="\bin\umbraco.editorControls" type="umbraco.editorControls.tags.library" alias="tagsLib" /> <!-- <ext assembly="/bin/name-of-dll-without-dll-extension" type=”Fully.Qualified.Name.Of.Type.Including.Namespace” alias=”Prefix-to-use-in-xslt” /> --> <ext assembly="/bin/Designit.Umb.DataTypes.Video" type="Designit.Umb.DataTypes.Video.XsltExtension" alias="Designit.VideoEmbed"> </ext> </XsltExtensions>
Hi Alexei,
don't you need to add a reference to the tagsLib instead of umbraco.editorControls. Have a look at this wiki page...(Especially on the tagsLib declaration on top of the xslt file)
Hope this helps.
Regards,
Dirk, thanks
Give me please one more advice. From getContentsWithTags I got XpathNodeIterator. How I can get just some data instead of whole node using xslt?
Hi Alexei, a quick look at the code reveals the following:
/// <summary> /// Gets all content nodes in Umbraco with the specified tag. /// It returns the found nodes as: /// <root> /// <node><data/>...</node> /// <node><data/>...</node> /// etc... /// </root> /// </summary> /// <param name="tags">Commaseparated tags.</param> /// <returns> /// A XpathNodeIterator ///</returns>
So, in your code you'll need to use:
<xsl:for-each select="tagsLib:getContentsWithTags('tag')/node"> ... </xsl:for-each>
Dirk, thanks again for your attention to beginner
I get it working with code:
<xsl:for-each select="tagsLib:getContentsWithTags('tag')/root/node">
Great you're giving feedback on your solution. I seem to have forgotten the root selector from the xpath. For further reference, one may also use:
<xsl:for-each select="tagsLib:getContentsWithTags('tag')//node"> ... </xsl:for-each>
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
tagsLib:getContentsWithTags
I can't get it worked, please help
A little more informations on what your problem is would help.
To see what this function returns just use
and then take a look into the html code.
hth, Thomas
Hi, Thomas
the problem is in xslt - I can't save it:
System.Xml.Xsl.XslTransformException: Cannot find the script or external object that implements prefix 'urn:umbraco.editorControls'.
at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList`1[] args)
at (XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
at Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
at Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results)
at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer, Boolean closeWriter)
at System.Xml.Xsl.XmlILCommand.Execute(IXPathNavigable contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter results)
at System.Xml.Xsl.XmlILCommand.Execute(IXPathNavigable contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, TextWriter results)
at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results)
at umbraco.presentation.webservices.codeEditorSave.SaveXslt(String fileName, String oldName, String fileContents, Boolean ignoreDebugging)
Alexei, can you show us the xsltExtensions.config from the /config folder?
Looking forward to your info.
Cheers,
/Dirk
Dirk, here it is
Hi Alexei,
don't you need to add a reference to the tagsLib instead of umbraco.editorControls. Have a look at this wiki page...(Especially on the tagsLib declaration on top of the xslt file)
Hope this helps.
Regards,
/Dirk
Dirk, thanks
Give me please one more advice. From getContentsWithTags I got XpathNodeIterator. How I can get just some data instead of whole node using xslt?
Hi Alexei, a quick look at the code reveals the following:
So, in your code you'll need to use:
Hope this helps.
Regards,
/Dirk
Dirk, thanks again for your attention to beginner
I get it working with code:
<xsl:for-each select="tagsLib:getContentsWithTags('tag')/root/node">
Hi Alexei,
Great you're giving feedback on your solution. I seem to have forgotten the root selector from the xpath. For further reference, one may also use:
Cheers,
/Dirk
is working on a reply...