Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicCkPythonChilkat2-PythonRubySQL ServerSwift 2Swift 3/4TclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcelGo

Xojo Plugin Examples

ASN.1
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Async
Azure Cloud Storage
Azure Service Bus
Base64
Bounced Email
Box
CSR
CSV
Certificates
Compression
DKIM / DomainKey
DSA
Diffie-Hellman
Digital Signatures
Dropbox
Dynamics CRM
ECC
Email Object
Encryption
FTP
Facebook
FileAccess
Firebase
GMail REST API
GeoOp
Google APIs
Google Calendar
Google Cloud Storage
Google Drive
Google Sheets
Gzip
HTML-to-XML/Text
HTTP
HTTP Misc
IMAP
JSON
JSON Web Encryption (JWE)
JSON Web Signatures (JWS)
JSON Web Token (JWT)

Java KeyStore (JKS)
Jira
MHT / HTML Email
MIME
Microsoft Graph
NTLM
OAuth1
OAuth2
OneDrive
OpenSSL
Outlook
PEM
PFX/P12
POP3
PRNG
PayPal
Peoplevox
QuickBooks
REST
REST Misc
RSA Encryption
SCP
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
SharePoint
Shopify
Socket/SSL/TLS
Spider
Stream
Stripe
SugarCRM
Tar Archive
Twitter
Upload
VoiceBase
Walmart
WebSocket
XAdES
XML
XML Digital Signatures
XMP
Xero
Zip
curl
eBay

 

 

 

(Xojo Plugin) Demonstrate the XML FindNextRecord Method

Imagine we have an XML file as follows:

<CompleteMultipartUpload>
  <Part>
    <PartNumber>1</PartNumber>
    <ETag>abc</ETag>
  </Part>
  <Part>
    <PartNumber>2</PartNumber>
    <ETag>def</ETag>
  </Part>
  <Part>
    <PartNumber>3</PartNumber>
    <ETag>ghi</ETag>
  </Part>
</CompleteMultipartUpload>
We want to find the record where PartNumber = 2. To do so, we simply position ourselves at the first "Part" tag, and then call FindNextRecord. (See below..)

Chilkat Xojo Plugin Download

Xojo Plugin for Windows, Linux, Mac OS X, and ARM

Dim xml As New Chilkat.Xml

success = xml.LoadXmlFile("qa_data/xml/multipartUpload.xml")

//  Position ourselves at the 1st record.
success = xml.GetChild2(0)

Dim foundRec As Chilkat.Xml
foundRec = xml.FindNextRecord("PartNumber","2")
If (xml.LastMethodSuccess = True) Then
    System.DebugLog("Found the record where PartNumber = 2.")
    System.DebugLog(foundRec.GetXml())

    //  Let's examine the ETag for this record...
    System.DebugLog("ETag for PartNumber 2 = " + foundRec.GetChildContent("ETag"))

Else
    System.DebugLog("No record exists where PartNumber = 2.")
End If

//  What if we want to find the record where ETag = "abc"?
foundRec = xml.FindNextRecord("ETag","abc")
If (xml.LastMethodSuccess = True) Then
    System.DebugLog("Found the record where ETag = abc")
    System.DebugLog(foundRec.GetXml())

    //  Let's examine the PartNumber for this record...
    System.DebugLog("Part number for Etag(abc) = " + foundRec.GetChildContent("PartNumber"))

Else
    System.DebugLog("No record exists where ETag = abc.")
End If

//  Go back to the XML root..
xml.GetRoot2 

 

© 2000-2019 Chilkat Software, Inc. All Rights Reserved.