Perl Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

Perl Examples

Quick Start
Perl Unicode
Perl Byte Array
Perl Certs
Perl Email
Perl Encryption
Perl FTP
HTML-to-XML
Perl HTTP
Perl IMAP
Perl MHT
Perl MIME
Perl RSA
Perl S/MIME
Perl Signatures
Perl Socket
Perl Spider
Perl Tar
Perl Upload
Perl XML
Perl XMP
Perl Zip

More Examples...
String
Email Object
POP3
SMTP
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA
SSH Key
SSH
SSH Tunnel
SFTP

Unreleased...
Bzip2
LZW
Bz2
Icon

 

 

 

 

 

 

 

Create XML Child Nodes with Attributes

How to create XML child nodes with attributes.

Download Chilkat Perl Module

use chilkat;


$xml = new chilkat::CkXml();

#  The Chilkat XML component is freeware.

$xml->put_Tag("product");

$xNode0 = $xml->NewChild("properties","");

$xChild = $xNode0->NewChild("price","");
$xChild->AddAttribute("SellPrice","11.99");

$xChild = $xNode0->NewChild("price","");
$xChild->AddAttribute("BasePrice","11.99");

print $xml->getXml() . "\r\n";

#  Prints this:
#  <product>
#     <properties>
#         <price SellPrice="11.99"></price>
#         <price BasePrice="11.99"></price>
#     </properties>
# </product>


 

Need a specific example? Send a request to support@chilkatsoft.com

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