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
Trying to fetch all approved records from i form with this:
<xsl:variable name="records" select="umbraco.contour:GetRecordsFromForm('6ddf3ddd-9aab-4e99-886f-fb4ed4282529')//uformrecord[state='Approved']"/>
But it returns Zero. any ideas?
//Kalle
Hi Kalle,
That actually should work. Are you sure you have approved records on that form?
You can try outputting the raw XML and taking a look, make sure you see <state>Approved</state> for one or more records. To output the XML:
<textarea><xsl:copy-of select="umbraco.contour:GetRecordsFromForm('6ddf3ddd-9aab-4e99-886f-fb4ed4282529')"/></textarea>
-Tom
Yes, I have approved records. and even if I change to 'Submitted' I still get zero records...
<uformrecord><state>Approved</state><created>2012-02-08T10:21:36</created>
Hmm, that's really strange. The code you supplied works fine for me, it returns all of my approved records. Strange. Are you sure the rest of your code is right, how it's checking the $records variable?
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxml="urn:schemas-microsoft-com:xslt" xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:tagsLib="urn:tagsLib" xmlns:BlogLibrary="urn:BlogLibrary" xmlns:umbraco.contour="urn:umbraco.contour" exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets tagsLib BlogLibrary umbraco.contour ">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:template match="/"> <xsl:variable name="records" select="umbraco.contour:GetRecordsFromForm('6ddf3ddd-9aab-4e99-886f-fb4ed4282529')//uformrecord[state='Approved']"/> <xsl:variable name="totalParticipants" select="count($records//uformrecord)"/>
<p>Just nu är det totalt <xsl:value-of select="$totalParticipants"/> betalande och bekräftade deltagare!</p>
<ol> <xsl:for-each select="$records/uformrecord"> <xsl:sort select=".//fields/namn//value"/> <li><strong><xsl:value-of select=".//fields/namn//value"/></strong>, <xsl:value-of select=".//fields/ort//value"/> (<xsl:value-of select=".//fields/önskadsnittfartigruppindelningen//value"/>)</li> </xsl:for-each> </ol>
</xsl:template>
</xsl:stylesheet>
Hi,
You should remove "/uformrecord" from the rest of your code, because in the records variable you are already selecting the uformrecord elements.
Ex:
<xsl:variable name="totalParticipants" select="count($records)"/>
and
<xsl:for-each select="$records">
HTH,Tom
Works like a charm! Thanks Tom!
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Get all approved records in XSLT?
Trying to fetch all approved records from i form with this:
<xsl:variable name="records" select="umbraco.contour:GetRecordsFromForm('6ddf3ddd-9aab-4e99-886f-fb4ed4282529')//uformrecord[state='Approved']"/>
But it returns Zero. any ideas?
//Kalle
Hi Kalle,
That actually should work. Are you sure you have approved records on that form?
You can try outputting the raw XML and taking a look, make sure you see <state>Approved</state> for one or more records. To output the XML:
-Tom
Yes, I have approved records. and even if I change to 'Submitted' I still get zero records...
<uformrecord><state>Approved</state><created>2012-02-08T10:21:36</created>
Hmm, that's really strange. The code you supplied works fine for me, it returns all of my approved records. Strange. Are you sure the rest of your code is right, how it's checking the $records variable?
-Tom
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:tagsLib="urn:tagsLib" xmlns:BlogLibrary="urn:BlogLibrary" xmlns:umbraco.contour="urn:umbraco.contour"
exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets tagsLib BlogLibrary umbraco.contour ">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:template match="/">
<xsl:variable name="records" select="umbraco.contour:GetRecordsFromForm('6ddf3ddd-9aab-4e99-886f-fb4ed4282529')//uformrecord[state='Approved']"/>
<xsl:variable name="totalParticipants" select="count($records//uformrecord)"/>
<p>Just nu är det totalt <xsl:value-of select="$totalParticipants"/> betalande och bekräftade deltagare!</p>
<ol>
<xsl:for-each select="$records/uformrecord">
<xsl:sort select=".//fields/namn//value"/>
<li><strong><xsl:value-of select=".//fields/namn//value"/></strong>, <xsl:value-of select=".//fields/ort//value"/> (<xsl:value-of select=".//fields/önskadsnittfartigruppindelningen//value"/>)</li>
</xsl:for-each>
</ol>
</xsl:template>
</xsl:stylesheet>
Hi,
You should remove "/uformrecord" from the rest of your code, because in the records variable you are already selecting the uformrecord elements.
Ex:
and
HTH,
Tom
Works like a charm! Thanks Tom!
is working on a reply...