How to get Raw HTML from XML Node

We created a Generic XML DataMapper to prevent us from making 100 nearly identical datamappers. We’re running into a problem though when there is text inside a node along with a child node.

Let’s use the following example:

  Here's a table.
  <table>
     <tr>...</tr>
  <table>
  That was a table.
</data>

The DataMapper is putting the information into a json field as follows

{
  "_value": "Here's a table.",
  "table": {
    "_value": "",
    "tr": {
      "_value": "..."
    }
  }
}

This is from using data.extract being recursively called for every node in the XML. Since the text is separated from the rest of the html it’s impossible for us to then render that HTML. Is there a way to store the raw html inside an xml node?

Hello @jrussell, welcome to our online community!

I think that you are trying to share the HTML of the table in question here, right? If so, can you thenplease wrap it insite three backtick characters (```)? Otherwise, it will be added as HTML to your forum post.

Example:

<h1>
	Hello World!
</h1>

Thanks. I’ve updated the codeblocks.

1 Like