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
Hi
I want to use a variable to fetch some content from an element.
From a macro I get the name of the data I want to get and a Node ID, and this is OK
A1:ukMetalTekstID:1161Then I try to get the content of "ukMetalTekst" (A) from the node "1161" (ID)
Z1 show all data from the node, Z2 show nothingZ3 show nothing
--- xslt code ----
<xsl:variable name="A1" select="/macro/A1"/><xsl:variable name="Node" select="/macro/Node"/>
A1:<xsl:value-of select="$A1"/><br />ID:<xsl:value-of select="$Node"/><br />
<xsl:if test="$Node != ''"> Z1:<xsl:value-of select="umbraco.library:GetXmlNodeById($Node)" /><br /> Z2:<xsl:value-of select="umbraco.library:GetXmlNodeById($Node)/data [@alias='ukMetalTekst']" /><br /> Z3:<xsl:value-of select="umbraco.library:GetXmlNodeById($Node)/data [@alias=$A1]" /><br /></xsl:if>--- the output is: ---
A1:ukMetalTekstID:1161Z1:20101160Alle Antagelser (DK)Alle Antagelser (UK)Præmieret værker (DK)Præmieret værker (UK)Z2:Z3:
Z1 is the node i xml format
Hi John,
v4.7 uses the new xml schema by default unless you override this in the config.
So, your fetching should look like:
<xsl:if test="$Node != ''"> Z1:<xsl:value-of select="umbraco.library:GetXmlNodeById($Node)" /><br /> Z2:<xsl:value-of select="umbraco.library:GetXmlNodeById($Node)/ukMetalTekst" /><br /> Z3:<xsl:value-of select="umbraco.library:GetXmlNodeById($Node)/* [local-name()=$A1]" /><br /></xsl:if>
Hope this helps.
Regards,
/Dirk
works perfect - Many thanks for your help
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Umbraco 4.7 - umbraco.library:GetXmlNodeById
Hi
I want to use a variable to fetch some content from an element.
From a macro I get the name of the data I want to get and a Node ID, and this is OK
A1:ukMetalTekst
ID:1161
Then I try to get the content of "ukMetalTekst" (A) from the node "1161" (ID)
Z1 show all data from the node,
Z2 show nothing
Z3 show nothing
--- xslt code ----
<xsl:variable name="A1" select="/macro/A1"/>
<xsl:variable name="Node" select="/macro/Node"/>
A1:<xsl:value-of select="$A1"/><br />
ID:<xsl:value-of select="$Node"/><br />
<xsl:if test="$Node != ''">
Z1:<xsl:value-of select="umbraco.library:GetXmlNodeById($Node)" /><br />
Z2:<xsl:value-of select="umbraco.library:GetXmlNodeById($Node)/data [@alias='ukMetalTekst']" /><br />
Z3:<xsl:value-of select="umbraco.library:GetXmlNodeById($Node)/data [@alias=$A1]" /><br />
</xsl:if>
--- the output is: ---
A1:ukMetalTekst
ID:1161
Z1:20101160Alle Antagelser (DK)Alle Antagelser (UK)Præmieret værker (DK)Præmieret værker (UK)
Z2:
Z3:
Z1 is the node i xml format
Hi John,
v4.7 uses the new xml schema by default unless you override this in the config.
So, your fetching should look like:
<xsl:if test="$Node != ''">
Z1:<xsl:value-of select="umbraco.library:GetXmlNodeById($Node)" /><br />
Z2:<xsl:value-of select="umbraco.library:GetXmlNodeById($Node)/ukMetalTekst" /><br />
Z3:<xsl:value-of select="umbraco.library:GetXmlNodeById($Node)/* [local-name()=$A1]" /><br />
</xsl:if>
Hope this helps.
Regards,
/Dirk
works perfect - Many thanks for your help
is working on a reply...