Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

XMPIteratorMBS class

Type Topic Plugin Version macOS Windows Linux Console & Web iOS
class XMP MBS XMP Plugin 6.4 Yes Yes Yes Yes No
Function: The XMPIteratorMBS class provides a uniform means to iterate over several XMP data structures, including the schema and properties within an XMP object plus global tables such as registered namespaces.
Notes:
Note: Only XMP object iteration is implemented at this time. There are no table iterators yet.

Iteration over the schema and properties within an XMP object is the most important and complex use of XMPIteratorMBS. It is helpful to have a thorough understanding of the XMP data tree. One way to learn this is to create some complex XMP and examine the output of XMPMetaMBS.DumpObject. This is also described in the XMP Specification, in the XMP Data Model chapter.
The top of the XMP data tree is a single root node. This does not explicitly appear in the dump and is never visited by an iterator (that is, it is never returned from XMPIteratorMBS.Next). Beneath the root are schema nodes. These are just collectors for top level properties in the same namespace. They are created and destroyed implicitly. Beneath the schema nodes are the property nodes. The nodes below a property node depend on its type (simple, struct, or array) and whether it has qualifiers.

A XMPIteratorMBS constructor defines a starting point for the iteration and options that control how it proceeds. By default the iteration starts at the root and visits all nodes beneath it in a depth first manner. The root node is not visited, the first visited node is a schema node. You can provide a schema name or property path to select a different starting node. By default this visits the named root node first then all nodes beneath it in a depth first manner.

The XMPIteratorMBS.Next method delivers the schema URI, path, and option flags for the node being visited. If the node is simple it also delivers the value. Qualifiers for this node are visited next. The fields of a struct or items of an array are visited after the qualifiers of the parent.

The options to control the iteration are:

kXMP_IterJustChildrenVisit just the immediate children of the root. Skip the root itself and all nodes below the immediate children. This omits the qualifiers of the immediate children, the qualifier nodes being below what they qualify.
kXMP_IterJustLeafNodesVisit just the leaf property nodes and their qualifiers.
kXMP_IterJustLeafNameReturn just the leaf component of the node names. The default is to return the full path name.
kXMP_IterIncludeAliasesInclude aliases as part of the iteration. Since aliases are not actual nodes the default iteration does not visit them.
kXMP_IterOmitQualifiersDo not visit the qualifiers of a node.

Feedback, Comments & Corrections

  • 11 methods
    • method Constructor
    • method Constructor(meta as XMPMetaMBS, options as Integer=0)
    • method Constructor(meta as XMPMetaMBS, schemaNS as string, options as Integer=0)
    • method Constructor(meta as XMPMetaMBS, schemaNS as string, propName as string, options as Integer=0)
    • method Constructor(schemaNS as string, propName as string, options as Integer)
    • method NextItem() as boolean
    • method NextItem(byref schemaNS as string) as boolean
    • method NextItem(byref schemaNS as string, byref propPath as string) as boolean
    • method NextItem(byref schemaNS as string, byref propPath as string, byref propValue as string) as boolean
    • method NextItem(byref schemaNS as string, byref propPath as string, byref propValue as string, byref options as Integer) as boolean
    • method Skip(options as Integer)

This class has no sub classes.

Some methods using this class:

  • XMPMetaMBS.Iterator(schemaNS as string, propName as string, options as Integer) as XMPIteratorMBS

Some examples which use this class:


The items on this page are in the following plugins: MBS XMP Plugin.


XMPFilesMBS   -   XMPMetaMBS




Links
MBS Xojo Plugins