Saxon.SetParameter
------------------

Sets a parameter.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Saxon](component_Saxon.md) | [15.0](newinversion150.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No |

MBS( "Saxon.SetParameter"; Name { ; Value; Type } ) 

**MBS**( **"Saxon.SetParameter";** /\* Sets a parameter. \*/  
**$Name**; /\* The name of the parameter.e.g. "test" \*/   
**$Value**; /\* Optional; The value for the parameter. \*/   
**$Type**) /\* Optional; The type of value.  
This defines how we pass the value later to Saxon library.  
Can be XML, JSON, Integer or Text.  
Default is text.e.g. "Text" \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| Name | The name of the parameter. | "test" |  |
| Value | The value for the parameter. |  | Optional |
| Type | The type of value.   This defines how we pass the value later to Saxon library.   Can be XML, JSON, Integer or Text.   Default is text. | "Text" | Optional |

### Result

Returns OK or error.

### Description

Sets a parameter.  
If you set parameters, please put a [Saxon.Clear](SaxonClear.md) function call on the beginning of the script to clear any values set by other scripts.  
### Examples

Try parameter setting:

 Let(\[  
r = MBS ("Saxon.SetParameter"; "Hello"; "World");  
list1 = MBS ("[Saxon.ParameterNames](SaxonParameterNames.md)");  
v = MBS ("[Saxon.GetParameter](SaxonGetParameter.md)"; "Hello");  
h = MBS ("[Saxon.HasParameter](SaxonHasParameter.md)"; "Hello")  
  
\]; "Keys: " &amp; list1 &amp; ¶ &amp; "Value: " &amp; v &amp; ¶ &amp; "Exists: " &amp; h)  
<small>  
Example result:   
Keys: Hello  
  
Value: World  
Exists: 1</small>### See also

- [Saxon.Clear](SaxonClear.md)
- [Saxon.ClearParameter](SaxonClearParameter.md)
- [Saxon.GetParameter](SaxonGetParameter.md)
- [Saxon.HasParameter](SaxonHasParameter.md)
- [Saxon.ParameterNames](SaxonParameterNames.md)
- [Saxon.XPathQuery](SaxonXPathQuery.md)

### Example Databases

- [Saxon/Saxon XPath](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Saxon/Saxon%20XPath.shtml#4ScriptAnchor_)

Created 9th January 2025 , last changed 9th January 2025

  
[Saxon.SetLicense](SaxonSetLicense.md) - [Saxon.SetProperty](SaxonSetProperty.md)

[HTML Version](SaxonSetParameter.shtml)