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, Im needing a little help with my Xpath for the DAMP.Ive installed 2.0 with the samples and i am trying to use it load PDF's.
My problem is with my XPath. Ive copied it exactly like in the sample.
<!--DAMP File--> <xsl:variable name="file" select="$currentPage/dampFile/DAMP/mediaItem/File" /> <h3 style="margin-top: 20px;">XSLT DAMP file sample</h3> <p>Download: <a href="{$file/umbracoFile}" target="_blank"><xsl:value-of select="$file/@nodeName"/></a></p>
When I call the vallue of he content alias "dampFile",I get back
" /media/23764/wisefish-product_information_sheet.pdfpdf459740"
Ive also had a look in the xml, which is showing the following
<dampFile> <DAMP fullMedia=""> <mediaItem> <File id="1348" version="c2f43d86-da0f-4df1-b7b0-dbed30092db2" parentID="1347" level="4" writerID="0" nodeType="1033" template="0" sortOrder="1" createDate="2012-01-25T12:08:54" updateDate="2012-01-25T12:08:50" nodeName="Product Information" urlName="productinformation" writerName="Martin" nodeTypeAlias="File" path="-1,1116,1345,1347,1348"> <umbracoFile>/media/23764/wisefish-product_information_sheet.pdf</umbracoFile> <umbracoExtension>pdf</umbracoExtension> <umbracoBytes>459740</umbracoBytes> </File> </mediaItem> </DAMP> </dampFile>
Could someone help me out and explain the variable select path?
Thanks
Martin
Hmm seems everything is ok. If you call the dampfile the value you get back is correct because it returns everything that is in that element. You should call dampfile/DAMP/mediaItem/File/umbracoFile to get the pdf path. Do you understand?
Jeroen
Thanks Jeroen,
I removed the "$currentPage" from the value path of the variable and it seems to work.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Help with DAMP XPath
Hi,
Im needing a little help with my Xpath for the DAMP.
Ive installed 2.0 with the samples and i am trying to use it load PDF's.
My problem is with my XPath. Ive copied it exactly like in the sample.
When I call the vallue of he content alias "dampFile",I get back
" /media/23764/wisefish-product_information_sheet.pdfpdf459740"
Ive also had a look in the xml, which is showing the following
<dampFile> <DAMP fullMedia=""> <mediaItem> <File id="1348" version="c2f43d86-da0f-4df1-b7b0-dbed30092db2" parentID="1347" level="4" writerID="0" nodeType="1033" template="0" sortOrder="1" createDate="2012-01-25T12:08:54" updateDate="2012-01-25T12:08:50" nodeName="Product Information" urlName="productinformation" writerName="Martin" nodeTypeAlias="File" path="-1,1116,1345,1347,1348"> <umbracoFile>/media/23764/wisefish-product_information_sheet.pdf</umbracoFile> <umbracoExtension>pdf</umbracoExtension> <umbracoBytes>459740</umbracoBytes> </File> </mediaItem> </DAMP> </dampFile>
Could someone help me out and explain the variable select path?
Thanks
Martin
Hmm seems everything is ok. If you call the dampfile the value you get back is correct because it returns everything that is in that element. You should call dampfile/DAMP/mediaItem/File/umbracoFile to get the pdf path. Do you understand?
Jeroen
Thanks Jeroen,
I removed the "$currentPage" from the value path of the variable and it seems to work.
is working on a reply...