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: 10.2   10.3   10.4   10.5   11.0   11.1   11.2   11.3   11.4   11.5    Statistic    FMM    Blog  

XML.ItemRefs

Queries entries from XML nodes.

Component Version macOS Windows Linux Server iOS SDK
XML 11.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "XML.ItemRefs"; XML; Flags )   More

Parameters

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>"
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 to release them all.
See JSON.GetArrayItems for JSON.

Examples

Try it:

# New Script in file Extract Text

Set Variable [ $xml ; Value: "<people><person><firstname>Peter</firstname></person><person><firstname>Michael</firstname></person></people>" ]
# 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"; $xml1) ]
Set Variable [ $xml2 ; Value: GetValue($list; 2) ]
Show Custom Dialog [ "xml2" ; MBS("XML.Format"; $xml2) ]
# free memory
Set Variable [ $r ; Value: MBS( "XML.Release"; $list ) ]

See also

Release notes

  • Version 11.5
    • Added XML.ItemRefs function.

Blog Entries

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


XML.Import.Work - XML.ListAttributes

Feedback: Report problem or ask question.




Links
MBS Xojo blog

Start Chat