XML.ToHTML
----------

Converts XML to HTML.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [XML](component_XML.md) | [14.0](newinversion140.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "XML.ToHTML"; XML { ; Flags; CSS Style } ) 

**MBS**( **"XML.ToHTML";** /\* Converts XML to HTML. \*/  
**$XML**; /\* The XML you'd like to convert.  
Can be XML as text or the reference returned by [XML.Parse](XMLParse.md) function, so you can make several times queries to the XML without parsing it each time.e.g. "&lt;hello&gt;Hello World&lt;/hello&gt;" \*/   
**$Flags**; /\* Optional; The flags for processing.  
Currently you can pass 1 to exclude html header and just get a HTML table.e.g. 0 \*/   
**$CSS Style**) /\* Optional; Extra CSS / HTML to include. \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| XML | The XML you'd like to convert.   Can be XML as text or the reference returned by [XML.Parse](XMLParse.md) function, so you can make several times queries to the XML without parsing it each time. | "&lt;hello&gt;Hello World&lt;/hello&gt;" |  |
| Flags | The flags for processing.   Currently you can pass 1 to exclude html header and just get a HTML table. | 0 | Optional |
| CSS Style | Extra CSS / HTML to include. |  | Optional |

### Result

Returns OK or error.

### Description

Converts XML to HTML.  
We build for you a HTML with tables for each array and object. We include values and tag rows with even/odd CSS classes.  
  
See also [XML.ToJSON](XMLToJSON.md) function to convert to JSON.  
### Examples

Convert XML to HTML:

 Let(\[  
 html = MBS ("XML.ToHTML"; XML to HTML::XML Input; 0; XML to HTML::CSS );   
 // now use XML colorization to color HTML:  
 html = MBS ("[XML.Colorize](XMLColorize.md)"; html; XML to HTML::Dark Mode)   
\]; html)  
### See also

- [XML.Colorize](XMLColorize.md)
- [XML.Parse](XMLParse.md)
- [XML.ToJSON](XMLToJSON.md)

### Release notes

- **Version 14.0**
    - Added [XML.ToHTML](https://www.mbsplugins.eu/XMLToHTML.shtml) function.

### Example Databases

- [XML/XML to HTML](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/XML/XML%20to%20HTML.shtml#1292FieldAnchor_)

### Blog Entries

- [Neues MBS Plugin 14.0 für Claris FileMaker](https://www.mbsplugins.de/archive/2024-01-16/Neues_MBS_Plugin_140_für_Clar/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin 14.0 for Claris FileMaker](https://www.mbsplugins.de/archive/2024-01-16/MBS_FileMaker_Plugin_140_for_C/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 13.6pr3](https://www.mbsplugins.de/archive/2023-12-13/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 3/2025, Seite 22](https://filemaker-magazin.de/neuigkeit/4290-Appetithappen-FMM_202503)

This function checks for a license.

Created 11st December 2023 , last changed 11st May 2024

  
[XML.Tidy](XMLTidy.md) - [XML.ToJSON](XMLToJSON.md)

[HTML Version](XMLToHTML.shtml)