Ruby Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CMFCDelphiFoxProJavaPerl
PHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

Ruby
Examples

Quick Start
Unicode
Byte Array
Bz2
Certificates
CSV
Email
Encryption
FTP
HTML Conversion
HTTP
IMAP
MHT
MIME
POP3
RSA
S/MIME
Signatures
SFTP
SMTP
Socket / SSL
Spider
SSH
SSH Key
SSH Tunnel
Tar
HTTP Upload
XML
XMP
Zip

More Examples...
String
Amazon S3
Email Object
DKIM / DomainKey
NTLM
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
Bzip2
DH Key Exchange
DSA
LZW

 

 

 

 

 

 

 

Create Simple XML Document

Downloads for Windows/Linux and Install Instructions

Create a simple XML document in Ruby.

# file: xmlCreate.rb
# 
# Demonstrates how to create a simple XML document and save it to disk.

require 'rubygems'
require 'chilkat'

# The Chilkat XML parser for Ruby is freeware.  The code demonstrated in this
# example can be used in both commercial and non-commercial applications without 
# restriction.  

# The Chilkat XML Ruby examples utilize these online XML data samples:
# http://www.chilkatsoft.com/xml-samples/bookstore.xml
# http://www.chilkatsoft.com/xml-samples/nutrition.xml
# http://www.chilkatsoft.com/xml-samples/pigs.xml
# http://www.chilkatsoft.com/xml-samples/plants.xml
# http://www.chilkatsoft.com/xml-samples/japanese.xml
# http://www.chilkatsoft.com/xml-samples/hamlet.xml
    
xml = Chilkat::CkXml.new()
xml.put_Tag("sample1")
xml.NewChild2("company","Chilkat Software Inc")
xml.NewChild2("city","Wheaton")
xml.NewChild2("year-founded","1998")
xml.NewChild2("industry","software")
xml.SaveXml("sample1.xml")

# The output of this progam has been uploaded to:
# http://www.chilkatsoft.com/xml-samples/sample1.xml




 

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