Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
9.3
9.4
9.5
10.0
10.1
10.2
10.3
10.4
10.5
10.6
Statistic
FMM
Blog
XML.DeletePath
Delete a xml node.
| Component | Version | macOS | Windows | Linux | Server | FileMaker iOS SDK |
| XML | 7.4 | Yes | Yes | Yes | Yes | Yes |
Parameters
| Parameter | Description | Example | Flags |
|---|---|---|---|
| XML | The XML to process. Can be XML as text or the reference returned by XML.Parse function, so you can make several times changes to the XML without parsing it each time. |
"<test>Hello</test>" | |
| Path | The path to the node or attribute to query. | "name" | |
| 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 4 to format returned XML. Add 32 to return result as XML. |
0 | Optional |
Result
Returns OK or error.
Description
Delete a xml node.This function uses a path notation like the JSON functions in FileMaker to describe paths.
You can use name of a node followed by option index in square brackets. On the end you can use # followed by a name of an attribute to select only the attribute.
Delimiter between items can be dot like FileMaker or newline.
If you pass in a XML reference number and you do not pass Flag value 32 for returning as XML, we just modify the XML reference in memory. This avoids performance hit for outputting and parsing xml for each change.
Examples
Delete node:
MBS( "XML.DeletePath"; "<test><node>Hello</node></test>"; "test.node"; 0)
Example result:
<?xml version="1.0" encoding="UTF-8"?>
<test/>
Delete attribute:
MBS( "XML.DeletePath"; "<test><node id=\"123\">Hello</node></test>"; "test.node#id"; 0)
Example result:
<?xml version="1.0" encoding="UTF-8"?>
<test><node>Hello</node></test>
See also
Blog Entries
Release notes
- Version 7.4
- Added XML.GetPathValue, XML.DeletePath and XML.SetPathValue functions.
Created 16th September 2017, last changed 2nd February 2018
Feedback: Report problem or ask question.
Links
MBS Xojo blog