Select to view content in your preferred language

Inline SVG Foreign Object tags are not recognized and are replaced by explicit lt& and &gt

542
0
03-12-2026 08:10 AM
JBeaver
New Contributor

I am trying to display an inline SVG using a text element on an ArcGIS Hub page. The rest of the SVG displays successfully however any inclusion of a foreign object fails to display. Instead upon applying the box to the page the tags are edited to be explicit < and > signs and the foreign objects tags have the x, y, width and height removed from the tag (See the examples below). 

Before applying:

<svg xmlns:ev='http://www.w3.org/2001/xml-events' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns='http://www.w3.org/2000/svg' xmlns:xhtml="http://www.w3.org/1999/xhtml"  width='100%' height='100%' viewBox='0 0 1132 804'>
  <rect width='1123' height='794' y='0' fill='#333333' x='0' />
  <foreignObject x="5" y="5" width="50" height="50">
    <xhtml:div>
      <xhtml:text style='background-color: black;color:green'>DEFAULT</xhtml:text>
    </xhtml:div>
  </foreignObject>
</svg>

 

 

After applying:

<svg xmlns:ev='http://www.w3.org/2001/xml-events' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns='http://www.w3.org/2000/svg' xmlns:xhtml='http://www.w3.org/1999/xhtml' width='100%' height='100%' viewBox='0 0 1132 804'>
  <rect width='1123' height='794' y='0' fill='#333333' x='0' />
  <foreignobject>
    &lt;xhtml:div&gt;
      &lt;xhtml:text style='background-color: black;color:green'&gt;DEFAULT&lt;/xhtml:text&gt;
    &lt;/xhtml:div&gt;
  </foreignobject>
</svg>

 

What am I missing to get this to display correctly?

0 Kudos
0 Replies