AFAIK you need to give it context, which comes from $currentPage. I'd be interested to see if your method would be possible though.
You could useGetXmlAll, or GetXmlDocumentById(1053), or traverse up the tree from currentPage and back down again. (the latter option reduces database calls, apparently)
Ron: Yes that is what I was expecting, but is not the case apparenty. I'll have a dig in the code someday but for now I was just suprised that it didn't work that way.
Dan: GetXmlAll doesn't make a database call, but i does create another xml navigator which may be memory heavy (I need to do some profiling on this .net XML stuff I've got a handful of live sites running on Umbraco now and I do get some memory spikes on my server every now and then. Although I removed the biggest memory hog - ImageGen.)
Can it be that the node you are looking for is located outside your website in the content tree? When an node is outside the website it is not loaded into the xml.
To resolve this use umbraco.library:GetXmlNodeById(1053)
Xml document that xslt macros are run against
Hi Guys,
I tried to select a node with a particular id in an xslt macro by doing the following:
But it didn't retrieve anything?
So my question is, what is the source XML document that the macro XSLT files are 'transforming'?
PS. the original problem is fixed by using the following:
check: data/umbraco.config
Ron
AFAIK you need to give it context, which comes from $currentPage. I'd be interested to see if your method would be possible though.
You could useGetXmlAll, or GetXmlDocumentById(1053), or traverse up the tree from currentPage and back down again. (the latter option reduces database calls, apparently)
Ron: Yes that is what I was expecting, but is not the case apparenty. I'll have a dig in the code someday but for now I was just suprised that it didn't work that way.
Dan: GetXmlAll doesn't make a database call, but i does create another xml navigator which may be memory heavy (I need to do some profiling on this .net XML stuff I've got a handful of live sites running on Umbraco now and I do get some memory spikes on my server every now and then. Although I removed the biggest memory hog - ImageGen.)
Off topic, but as you mentioned it... there's a patch for ImageGen that addresses your issue. You can get it from http://our.umbraco.org/projects/imagegen
cheers,
doug.
I think I know what your problem is.
Can it be that the node you are looking for is located outside your website in the content tree?
When an node is outside the website it is not loaded into the xml.
To resolve this use umbraco.library:GetXmlNodeById(1053)
Ron
I think Ron's way is also nicer, especially when you use a parameter for the Rootnode, a way to see what you get back is to use the <xsl:copy-of> tag.
is working on a reply...