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:
12.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
13.4
13.5
Statistic
FMM
Blog
Sets path value with XML sub tree.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
XML | 8.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example |
---|---|---|
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 |
NewXML | The new xml for node or attribute. Can be XML as text or the reference returned by XML.Parse function, so you can make several times queries to the XML without parsing it each time. |
"<name>Christian</name>" |
Returns XML, OK or error.
Insert new node:
MBS("XML.SetPathXML"; "<export><person></person></export>"; "export¶person¶name"; 0; "<name>Test</name>")
Example result:
<?xml version="1.0" encoding="UTF-8"?>
<export><person><name>Test</name></person></export>
Insert second node with index:
MBS("XML.SetPathXML"; "<export><person><name>First</name></person></export>"; "export¶person¶name[1]"; 0; "<name>Test</name>")
Example result:
<?xml version="1.0" encoding="UTF-8"?>
<export><person><name>First</name><name>Test</name></person></export>
Append node:
MBS("XML.SetPathXML"; "<export><person><name>First</name></person></export>"; "export¶person¶name[]"; 0; "<name>Test</name>")
Set XML part with namespaces:
MBS("XML.SetPathXML"; "<r:export ns:r=\"http://mbsplugins.eu/testNamespace\"><r:person></r:person></r:export>"; "r:export¶r:person¶r:name"; 0; "<name>Test</name>")
Example result:
<?xml version="1.0" encoding="UTF-8"?>
<r:export ns:r="http://mbsplugins.eu/testNamespace"><r:person><name>Test</name></r:person></r:export>
This function checks for a license.
Created 2nd February 2018, last changed 30th June 2022