This version is out of date, covering development from v9.5.0 to v9.7.3. It is maintained here only for inbound reference links from elsewhere. It is no longer actively updated.

Jump to the current version of aTbRef

Tinderbox v9 Icon

String.captureXML()


Operator Type: 

Operator Scope of Action: 

Operator Purpose: 

Operator First Added: 

Operator Last Altered: 

 Function  [other Function type actions]

 Item  [operators of similar scope]

 Stream parsing  [other Stream parsing operators]

 Baseline

 As at baseline


Syntax note: Operators without any defined mandatory arguments may omit their empty closing parentheses


String.captureXML()

String.captureXML

Attempts to parse the string as fully/partially XML and fails if unsuccessful. The parsed XML is saved as the current XML (stream) object.

Essentially, this re-scopes the current stream so that it contains only the contents of the first section of XML detected within the original stream. The focus of the stream parsing is set to the beginning of the extracted XML code.

Consider a note whose $Text contains some text followed by some XML code:

vXML = $Text.captureXM(); 

results in variable vXML holding the XML code part of $Text.

Be aware that only one XML object may be current at any time. If the source stream contains multiple discrete XML code sections, only the first is detected/used.