XML.ItemRefs
------------

Queries entries from XML nodes.

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

MBS( "XML.ItemRefs"; XML; Flags ) 

**MBS**( **"XML.ItemRefs";** /\* Queries entries from XML nodes. \*/  
**$XML**; /\* The XML to process.  
Can be XML as text or the reference returned by [XML.Parse](XMLParse.md) function, so you can make several times changes to the XML without parsing it each time.e.g. "&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 namespaces.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| XML | The XML to process.   Can be XML as text or the reference returned by [XML.Parse](XMLParse.md) function, so you can make several times changes to the XML without parsing it each time. | "&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 namespaces. | 0 |

### Result

Returns list or error.

### Description

Queries entries from XML nodes.  
Returns list of reference numbers for XML objects.  
Processing large XML gets faster if you first split the top level items into individual items and then process each on your own.  
  
Later pass list to [XML.Release](XMLRelease.md) to release them all.  
See [JSON.GetArrayItems](JSONGetArrayItems.md) for JSON.  
### Examples

Try it:

 # New Script in file Extract Text   
  
Set Variable \[ $xml ; Value: "&lt;people&gt;&lt;person&gt;&lt;firstname&gt;Peter&lt;/firstname&gt;&lt;/person&gt;&lt;person&gt;&lt;firstname&gt;Michael&lt;/firstname&gt;&lt;/person&gt;&lt;/people&gt;" \]   
\# split it   
Set Variable \[ $list ; Value: MBS ( "XML.ItemRefs"; $xml ; 0 ) \]   
\# now take items from the list and show   
Set Variable \[ $xml1 ; Value: GetValue($list ; 1) \]   
Show Custom Dialog \[ "xml1" ; MBS ("[XML.Format](XMLFormat.md)"; $xml1 ) \]   
Set Variable \[ $xml2 ; Value: GetValue($list ; 2) \]   
Show Custom Dialog \[ "xml2" ; MBS ("[XML.Format](XMLFormat.md)"; $xml2 ) \]   
\# free memory   
Set Variable \[ $r ; Value: MBS ( "[XML.Release](XMLRelease.md)"; $list ) \]  
### See also

- [JSON.GetArrayItem](JSONGetArrayItem.md)
- [JSON.GetArrayItems](JSONGetArrayItems.md)
- [XML.Format](XMLFormat.md)
- [XML.Parse](XMLParse.md)
- [XML.Release](XMLRelease.md)

### Release notes

- **Version 11.5**
    - Added [XML.ItemRefs](https://www.mbsplugins.eu/XMLItemRefs.shtml) function.

### Blog Entries

- [New in version 11.5 of MBS FileMaker Plugin](https://www.mbsplugins.de/archive/2021-11-30/New_in_version_115_of_MBS_File/monkeybreadsoftware_blog_filemaker)
- [Neues MBS FileMaker Plugin 11.5 - Über 6600 Funktionen in einem Plugin](https://www.mbsplugins.de/archive/2021-11-16/Neues_MBS_FileMaker_Plugin_115/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin 11.5](https://www.mbsplugins.de/archive/2021-11-16/MBS_FileMaker_Plugin_115/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 11.5pr1](https://www.mbsplugins.de/archive/2021-10-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 19th September 2021 , last changed 19th September 2021

  
[XML.InsertRecords](XMLInsertRecords.md) - [XML.List](XMLList.md)

[HTML Version](XMLItemRefs.shtml)