I added a HTML Popup to a map that displays several fields data and one image that's stored in a folder next to the map.mxd file. One of the fields in the table is the filename.jpg for each image. All local.

I have a restriction, I can't use absolute paths. It needs to be relative, like "Images\P01.jpg". The problem is, if I use relative path like that, it gets related to the temporary folder where the XML file is generated and not to my MXD folder:


I see that the xsl templates have tags like <xsl:value-of select="FieldsDoc/Title" /> that gets properties from my map, but I can't find any documentation about these... Already opened lots of xsl within arcmap templates, but I couldn't figure it out...

How can I make it relative?

Perhaps there's a different approach to solve it without XSL.

I tried simply putting a html tag in the field, none worked:

For <img src='\Mapa.img\P1.jpg'>, I get "file:///C:/Images/".

For <img src='.\Mapa.img\P1.jpg'>, I get "file:///C:/Users/demian/AppData/Local/Temp/arcCFE7/Images/".

For <img src='..\Mapa.img\P1.jpg>, I get file:///C:/Users/demian/AppData/Local/Temp/Images/


<!-- this can't be absolute... -->
<xsl:variable name="docPath" select="'C:\Users\demian\Documents\Mapa\Images\'"/>

<xsl:when test="FieldName[starts-with(., 'Imagem')]">
    <img alt="Imagem">
    <xsl:attribute name="src">
        <xsl:value-of select="$docPath"/><xsl:value-of select="FieldValue"/>
  • Is adding attachment an option?
    – FelixIP
    Commented Feb 13, 2017 at 18:37
  • Well, yes, but there are more than 200 images to attach. Does it need to be attached all manually? Commented Feb 15, 2017 at 11:27
  • Felix, Well I wasn't used to attachments, but I figured it out here. Thank you for the tip! Commented Feb 15, 2017 at 11:43


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.