I am trying to use an XSL Template to allow our users to view multiple photo attachments held in a point feature class in a file GDB.
I have managed to successfully to get it to display them as a list, but only the first image is displayed correctly, the others appear as missing image symbols. But if you click on any of them they correctly load the attached image as seen in the image below.
Here is the current XSL Template I am using;
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:msxsl="urn:schemas-microsoft-com:xslt"> <xsl:variable name="ignoreFieldNames" select="'|OBJECTID|Shape|Shape_Length|Shape_Area|ATTACHMENTID|REL_OBJECTID|CONTENT_TYPE|ATT_NAME|DATA_SIZE|DATA|'"/> <xsl:variable name="headerRowColor" select="'#9CBCE2'"/> <xsl:variable name="alternateRowColor" select="'#D4E4F3'"/> <xsl:template match="/"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> </head> <body style="margin:0px 0px 0px 0px;overflow:auto;background:{$headerRowColor}"> <xsl:variable name="imageCount" select="count(Attachment/ContentType[contains(., 'image')])"/> <xsl:variable name="attachmentCount" select="count(Attachment)"/> <table style="font-family:Arial,Verdana,Times;font-size:9px;text-align:left;width:100%;border-spacing:0px; padding:1px 1px 1px 1px"> <xsl:if test="($attachmentCount > $imageCount) or not($imageCount = 1)"> <xsl:for-each select="FieldsDoc/Attachments/Attachment"> <xsl:if test="(ContentType='image/bmp')or(ContentType='image/jpeg')or(ContentType='image/png')or(ContentType='image/gif')"> <tr align="centre"> <td> <xsl:variable name="attachmentPath" select="FilePath" /> <a target="_blank"> <xsl:attribute name="href"> <xsl:value-of select="$attachmentPath" /> </xsl:attribute> <img width="100"> <xsl:attribute name="src"> <xsl:value-of select="$attachmentPath" /> </xsl:attribute> </img> </a> </td> </tr> <tr align="centre"> <td> <xsl:value-of select="Name" /> </td> </tr> </xsl:if> </xsl:for-each> </xsl:if> </table> </body> </html> </xsl:template> </xsl:stylesheet>
Any help or pointers most appreciated,
Owain
Solved! Go to Solution.
Owain,
In the HTML Layer properties, make sure you check "Download attachment data"
Mark
Owain,
In the HTML Layer properties, make sure you check "Download attachment data"
Mark
Cheers Mark
Brilliant that's was all it needed, I swear I had tried turning that on and off before.
Owain