Chilkat Examples

ChilkatHOME.NET Core C#Android™AutoItCC#C++Chilkat2-PythonCkPythonClassic ASPDataFlexDelphi ActiveXDelphi DLLGoJavaLianjaMono C#Node.jsObjective-CPHP ActiveXPHP ExtensionPerlPowerBuilderPowerShellPureBasicRubySQL ServerSwift 2Swift 3,4,5...TclUnicode CUnicode C++VB.NETVBScriptVisual Basic 6.0Visual FoxProXojo Plugin

Xojo Plugin Examples

Web API Categories

ASN.1
AWS KMS
AWS Misc
Amazon EC2
Amazon Glacier
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Async
Azure Cloud Storage
Azure Key Vault
Azure Service Bus
Azure Table Service
Base64
Bounced Email
Box
CAdES
CSR
CSV
Certificates
Cloud Signature CSC
Code Signing
Compression
DKIM / DomainKey
DNS
DSA
Diffie-Hellman
Digital Signatures
Dropbox
Dynamics CRM
EBICS
ECC
Ed25519
Email Object
Encryption
FTP
FileAccess
Firebase
GMail REST API
GMail SMTP/IMAP/POP
Geolocation
Google APIs
Google Calendar
Google Cloud SQL
Google Cloud Storage
Google Drive
Google Photos
Google Sheets
Google Tasks
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)
MHT / HTML Email
MIME
MS Storage Providers
Microsoft Graph
Misc
NTLM
OAuth1
OAuth2
OIDC
Office365
OneDrive
OpenSSL
Outlook
Outlook Calendar
Outlook Contact
PDF Signatures
PEM
PFX/P12
PKCS11
POP3
PRNG
REST
REST Misc
RSA
SCP
SCard
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
ScMinidriver
Secrets
SharePoint
SharePoint Online
Signing in the Cloud
Socket/SSL/TLS
Spider
Stream
Tar Archive
ULID/UUID
Upload
WebSocket
XAdES
XML
XML Digital Signatures
XMP
Zip
curl
uncategorized

 

 

 

(Xojo Plugin) XML Add Child Tree

Demonstrates the Xml.AddChildTree method.

Chilkat Xojo Plugin Download

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

Dim success As Boolean

// Build the following XML:

// <?xml version="1.0" encoding="utf-8"?>
// <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
//     <soap12:Body>
//         <cteDadosMsg xmlns="http://www.portalfiscal.inf.br/cte/wsdl/CTeStatusServicoV4">
// 	   </cteDadosMsg>
//     </soap12:Body>
// </soap12:Envelope>

Dim xml As New Chilkat.Xml
xml.Tag = "soap12:Envelope"
success = xml.AddAttribute("xmlns:xsi","http://www.w3.org/2001/XMLSchema-instance")
success = xml.AddAttribute("xmlns:xsd","http://www.w3.org/2001/XMLSchema")
success = xml.AddAttribute("xmlns:soap12","http://www.w3.org/2003/05/soap-envelope")
success = xml.UpdateAttrAt("soap12:Body|cteDadosMsg",True,"xmlns","http://www.portalfiscal.inf.br/cte/wsdl/CTeStatusServicoV4")

// We want to add the following XML as a sub-tree under the "cteDadosMsg" element.

// <consStatServCTe versao="4.00" xmlns="http://www.portalfiscal.inf.br/cte">
//     <tpAmb>2</tpAmb>
//     <cUF>43</cUF>
//     <xServ>STATUS</xServ>
// </consStatServCTe>

// Build the XML to be added as a child tree.

Dim xml2 As New Chilkat.Xml
xml2.Tag = "consStatServCTe"
success = xml2.AddAttribute("versao","4.00")
success = xml2.AddAttribute("xmlns","http://www.portalfiscal.inf.br/cte")
xml2.UpdateChildContent "tpAmb","2"
xml2.UpdateChildContent "cUF","43"
xml2.UpdateChildContent "xServ","STATUS"

// Add the child tree at the desired location:
// Temporarily point to the location where we wish to add the child tree.
success = xml.FindChild2("soap12:Body|cteDadosMsg")
If (success = False) Then
    // Restore current location to the root.
    xml.GetRoot2 
    Return
End If

success = xml.AddChildTree(xml2)
// Restore the current location to the root.
xml.GetRoot2 

// You can see now that the XML contain the child tree:

System.DebugLog(xml.GetXml())

// <?xml version="1.0" encoding="utf-8"?>
// <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
//     <soap12:Body>
//         <cteDadosMsg xmlns="http://www.portalfiscal.inf.br/cte/wsdl/CTeStatusServicoV4">
//             <consStatServCTe versao="4.00" xmlns="http://www.portalfiscal.inf.br/cte">
//                 <tpAmb>2</tpAmb>
//                 <cUF>43</cUF>
//                 <xServ>STATUS</xServ>
//             </consStatServCTe>
//         </cteDadosMsg>
//     </soap12:Body>
// </soap12:Envelope>

 

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