So that's all working well, but I don't know what datatype my extension should return. I've tried returning it as a string, then doing a exslt:node-set() conversion on it. But that doesn't work. Leaving it as a String doesn't work. And leaving it as a XDocument (which is how it's constructed) doesn't work.
I haven't got much experience with developing XSLT extensions (I've used a lot though ;) ), but I think I remember that you shall return it as a "XPathNavigator".
Curious to how you're getting the random node Ids ... and in what context are you going to use them? (to show random content?)
On the uComponents project we've got an XSLT extension for RandomNode, that takes a node-set (say $currentPage) and returns a single random node from the collection. Just thinking that we could include your GetRandomNodeIds extension too? That is if you think it would be useful to others too?
Yep. Knowing this last Friday probably would have saved me about half a days work..
Thanks for that Lee.
uComponents has proved to be really helpful for me already, and I'm only just starting with Umbraco. In the future I'll definitely hunt around ucomponents before I start writing code.
Glad you like uComponents. I know what you mean, its difficult to know what is already available "out there" before you start writing your code.
We've trying to provide documentation of the various aspects of uComponents - available on CodePlex. If you do see a gaping hole in the documentation - let us know! :-)
Only other advice is if you think something "might" already exist for Umbraco, post on the forum (much like you've done here) or use the #umbraco hash-tag on Twitter ... you'll get an answer pretty quick!
Yeah, I think my problem for this one was I was looking at how to find random nodes via XPath/Xslt in general not specificly to Umbraco, so I didn't stumble upon it :)
Good advice with the Twitter tag too. I'll give that a go next.
Umbraco Xslt Extension in .Net
Hi,
I've written an extenstion in C# that I'm calling from my XSLT. Something like this:
And returns something like this
<nodes>
<nodeId>1234</nodeId>
<nodeId>2313</nodeId>
<nodeId>1118</nodeId>
<nodeId>2352</nodeId>
</nodes>
So that's all working well, but I don't know what datatype my extension should return. I've tried returning it as a string, then doing a exslt:node-set() conversion on it. But that doesn't work. Leaving it as a String doesn't work. And leaving it as a XDocument (which is how it's constructed) doesn't work.
Anyone else come across this problem before?
Thanks!
-Evan
Hi Eran
I haven't got much experience with developing XSLT extensions (I've used a lot though ;) ), but I think I remember that you shall return it as a "XPathNavigator".
Does that work or am I totally off?
/Kim A
Hey Evan,
I think (if it's XML you are returning) it needs to be an XPathNodeIterator. Here's an example from one of the provider to my Universal Media Picker
http://umpp4umb.codeplex.com/SourceControl/changeset/view/d858bf650fdd#TheOutfield.UmbExt.UniversalMediaPicker.Providers.Dropbox%2fDropboxXsltExtension.cs
Hope this helps
Matt
Thanks a lot guys! I got it working with the XPathNodeIterator. Thanks for the example Matt!
Hi Evan,
Curious to how you're getting the random node Ids ... and in what context are you going to use them? (to show random content?)
On the uComponents project we've got an XSLT extension for RandomNode, that takes a node-set (say $currentPage) and returns a single random node from the collection. Just thinking that we could include your GetRandomNodeIds extension too? That is if you think it would be useful to others too?
Cheers, Lee.
Yep. Knowing this last Friday probably would have saved me about half a days work..
Thanks for that Lee.
uComponents has proved to be really helpful for me already, and I'm only just starting with Umbraco. In the future I'll definitely hunt around ucomponents before I start writing code.
Glad you like uComponents. I know what you mean, its difficult to know what is already available "out there" before you start writing your code.
We've trying to provide documentation of the various aspects of uComponents - available on CodePlex. If you do see a gaping hole in the documentation - let us know! :-)
Only other advice is if you think something "might" already exist for Umbraco, post on the forum (much like you've done here) or use the #umbraco hash-tag on Twitter ... you'll get an answer pretty quick!
Cheers, Lee.
Yeah, I think my problem for this one was I was looking at how to find random nodes via XPath/Xslt in general not specificly to Umbraco, so I didn't stumble upon it :)
Good advice with the Twitter tag too. I'll give that a go next.
Thanks again mate :)
Oh, and I've foudn the uComponent documentation to be pretty good so far, but will yell out if I see any holes :)
is working on a reply...