XML.Parse
---------

Parses a XML document.

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

MBS( "XML.Parse"; XML { ; Flags } ) 

**MBS**( **"XML.Parse";** /\* Parses a XML document. \*/  
**$XML**; /\* The XML to process.e.g. "&lt;test&gt;Hello&lt;/test&gt;" \*/   
**$Flags**) /\* Optional; Various Flags.  
Add 1 to ignore errors in xml and continue parsing. This may lead to not everything in the xml being read.  
Add 8 to remove all namespaces before query to have queries easier.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| XML | The XML to process. | "&lt;test&gt;Hello&lt;/test&gt;" |  |
| Flags | Various Flags.   Add 1 to ignore errors in xml and continue parsing. This may lead to not everything in the xml being read.   Add 8 to remove all namespaces before query to have queries easier. | 0 | Optional |

### Result

Returns XML reference or error.

### Description

Parses a XML document.  
The document stays in memory and can be queried several times as needed.  
If you need to query a lot of values, please parse once first. Else all [XML](component_XML.md) functions need to parse again on each call.  
Please use [XML.Release](XMLRelease.md) later to free document from memory.  
### See also

- [XML.ItemRefs](XMLItemRefs.md)
- [XML.ListAttributes](XMLListAttributes.md)
- [XML.NodeCount](XMLNodeCount.md)
- [XML.NodeNames](XMLNodeNames.md)
- [XML.Query](XMLQuery.md)
- [XML.Release](XMLRelease.md)
- [XML.SetPathCData](XMLSetPathCData.md)
- [XML.SetPathXML](XMLSetPathXML.md)
- [XML.SetVariables](XMLSetVariables.md)
- [XML.SubTree](XMLSubTree.md)

### Release notes

- **Version 9.1**
    - Fixed a problem with [XML.Parse](http://www.mbsplugins.eu/XMLParse.shtml) getting an XML reference number.
- **Version 7.3**
    - Added [XML.Parse](http://www.mbsplugins.eu/XMLParse.shtml) and [XML.Release](http://www.mbsplugins.eu/XMLRelease.shtml) to parse XML once and query several times to get better performance.

### Example Databases

- [Utility functions/Trigger Script on Plugin Error](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Utility%20functions/Trigger%20Script%20on%20Plugin%20Error.shtml#1Button10.0000000261.000000041.0000000378.0000000LayoutObjectAnchor_)
- [Win Only/Search Scripts](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Win%20Only/Search%20Scripts.shtml#2ScriptAnchor_)

### Blog Entries

- [Electronic invoices in FileMaker](https://www.mbsplugins.de/archive/2025-03-06/Electronic_invoices_in_FileMak/monkeybreadsoftware_blog_filemaker)
- [Elektronische Rechnungen in FileMaker](https://www.mbsplugins.de/archive/2025-03-04/Elektronische_Rechnungen_in_Fi/monkeybreadsoftware_blog_filemaker)
- [Fun with While function in FileMaker](https://www.mbsplugins.de/archive/2019-07-22/Fun_with_While_function_in_Fil/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 9.1pr5](https://www.mbsplugins.de/archive/2019-03-01/MBS_FileMaker_Plugin_version_9/monkeybreadsoftware_blog_filemaker)
- [Comparing Base Elements Plugin to MBS FileMaker Plugin](https://www.mbsplugins.de/archive/2017-10-24/Comparing_Base_Elements_Plugin/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin 7.3 - Über 4800 Funktionen in einem Plugin](https://www.mbsplugins.de/archive/2017-07-18/MBS_FileMaker_Plugin_73_-_Übe/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin 7.3 - More than 4800 Functions In One Plugin](https://www.mbsplugins.de/archive/2017-07-18/MBS_FileMaker_Plugin_73_-_More/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 7.3pr7](https://www.mbsplugins.de/archive/2017-07-15/MBS_FileMaker_Plugin_version_7/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

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

This function checks for a license.

Created 14th July 2017 , last changed 17th September 2017

  
[XML.NodeNames](XMLNodeNames.md) - [XML.Query](XMLQuery.md)

[HTML Version](XMLParse.shtml)