1

I have a layer in ArcGIS 10.1 having a column in the attribute table filled in with HTML code (<p class=MsoNormal> A number of similar..), I was wondering whether it is possible to display a pop-up message based on that HTML code.

For example, by using the HTML Pop-up tool it is the closest I've been, but how do I tell ArcGIS that a specific column should be read as HTML code and not as simple text?.

0

2 Answers 2

2

I ran into this when I converted KML files. All the attributes showed up in an HTMlpopup field. I kept the shapefile and parsed the KML in python to make a CSV file, then I brought that in as a table and joined it to my shapefile. I thought it was odd to find that field. I was also questioning it as my shapefile had a lot of formatting fields but no real usable attributes beyond that field.

0

I found the solution:

Layer -> Layer Properties -> HTML Popup -> and within the XLS template option (you can simply load the default ESRI one), include the following lines (i.e. after the line 110 in the default template):

<xsl:when MyColumn="FieldValue[starts-with(., '&lt;p ')]">
<xsl:value-of select="FieldValue" disable-output-escaping="yes" />
</xsl:when>

Basically you are indicating that everything that starts with a <p tag, should be filtered and/or escaped as HTML code. Do not forget of replacing 'Mycolumn' in the expression above with the name of your column/field!

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.