now test contain the node but when i try to read the child nodes with:
<xsl:value-of select="$test/@id"/> or <xsl:value-of select="$test/categoria"/>
i receive an error and cant save the xslt file.
the error is:
System.Xml.Xsl.XslLoadException: Expression must evaluate to a node-set. -->$test<-- An error occurred at C:\Documents and Settings\rossi\Documenti\My Web Sites\Umbraco CMS\xslt\634517741395557424_temp.xslt(20,3). at System.Xml.Xsl.XslCompiledTransform.LoadInternal(Object stylesheet, XsltSettings settings, XmlResolver stylesheetResolver) at umbraco.presentation.webservices.codeEditorSave.SaveXslt(String fileName, String oldName, String fileContents, Boolean ignoreDebugging)
parametric select in xslt
hi all my friend,
i've a question for you.
i have this code:
<xsl:variable name="test" select="concat('umbraco.library:GetXmlNodeById(',/macro/Node,')')"/>
but when i ask the value of test i obtain the string concatenated not the result of the GetXmlNodeByID.
how can i resolve this?
plz help
tnk you
nico
Try this (untested)
<xsl:variable name="test" select="concat('"',umbraco.library:GetXmlNodeById(/macro/Node), '"')"/>
Rich
Hi Nico,
Can you please tell us what you are planning to do? From the code you posted you added the umbraco library Concat, what you could do is remove it
<xsl:variable name="test" select="umbraco.library:GetXmlNodeById(',/macro/Node,')"/>
hi,
i try to explain the problem better:)
i have a parameter in the macro that contain the IdNode.
when i parse the xslt file i need to read and display the info contained in the node with the corresponding id node.
this is why i've think to use the contain.
there is another better way?
also i've tried this:
<xsl:variable name="test" select="concat('"',umbraco.library:GetXmlNodeById(/macro/Node), '"')"/>
now test contain the node but when i try to read the child nodes with:
<xsl:value-of select="$test/@id"/> or <xsl:value-of select="$test/categoria"/>
i receive an error and cant save the xslt file.
the error is:
System.Xml.Xsl.XslLoadException: Expression must evaluate to a node-set.
-->$test<-- An error occurred at C:\Documents and Settings\rossi\Documenti\My Web Sites\Umbraco CMS\xslt\634517741395557424_temp.xslt(20,3).
at System.Xml.Xsl.XslCompiledTransform.LoadInternal(Object stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)
at umbraco.presentation.webservices.codeEditorSave.SaveXslt(String fileName, String oldName, String fileContents, Boolean ignoreDebugging)
thank you
nico
Hi Nico,
So you are trying to access a node using the GetXmlNodeById where this id will never change again right?
You can do something like
is working on a reply...