AnsweredAssumed Answered

Custom XSL Formatting for HTML Popup in ArcMap

Question asked by johnmdye on Sep 10, 2014
Latest reply on Sep 11, 2014 by mbockenhauer-esristaff

I'm not very well versed with XSL but have been tinkering to try and get an XSL Template to iframe a Birds Eye view into the HTML Popup window for the feature that gets clicked on. This actually works as it as, however what it requires in order to function is that I create an additional field in my attribute table named 'BIRDSEYE' and calculate the X and Y coordinates of the feature's into that field, with the X and Y coordinates separated by a tilde.


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="" xmlns:fo="">
      <xsl:template match="/">
                      <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
                    <xsl:variable name="nameCol" select="FieldsDoc/Fields/Field/FieldName"/>
                    <table border="1" width="450" cellpadding="5" cellspacing="0">
                        <xsl:variable name="index" select="1"/>
                        <xsl:for-each select="FieldsDoc/Fields/Field">
                                <xsl:if test="(position() +1) mod 2">
                                    <xsl:attribute name="bgcolor">#D4e4f3</xsl:attribute>
                                <xsl:if test="string-length($nameCol) != 0">
                                        <xsl:value-of select="FieldName"/>
                                        <xsl:when test="FieldName[starts-with(., 'BIRDSEYE')]">
                                            <xsl:variable name="BEV" select="FieldValue"/>
                                            <iframe src="{$BEV}&amp;pushpins={$BEV}&amp;culture=en-us" width="450" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"></iframe>
                                            <xsl:value-of select="FieldValue"/>


I'd like to not have to add that additional field and just have the XSL Stylesheet reference the LAT and LON fields that already exist in all of my attribute tables, do the concatenation and formatting of the extracted coordinates on its own and place the iframe before the table begins so that it is the first thing you see, followed by the attribute table.


Tinkering around, the issue I'm having seems to be that because I am creating the BEV_X and BEV_Y variables inside of the XSL Stylesheet, they have local scope and thus are not available outside of their <xsl:if> statements.


How can I make them accessible outside of the if statement so that if can be dynamically populated into the iframe?