Perl Examples

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

Perl Examples

Quick Start
Unicode
Byte Array
Bz2
Certificates
CSV
Email
Encryption
FTP
HTML Conversion
HTTP
IMAP
MHT
MIME
POP3
RSA
S/MIME
Signatures
SMTP
Socket / SSL
Spider
SFTP
SSH Key
SSH
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
DH Key Exchange
DSA
Bzip2
LZW

 

 

 

 

 

 

 

Dropping HTML Tag Types

 Chilkat Perl Module Downloads for Windows, Linux, and MAC OS X

Perl script showing how to drop specific HTML tag types during an HTML to XML conversion.

Download Perl Programming Example Scripts

# file: DropTagType.pl

use chilkat;

# Demonstrates how specific HTML tags can be selected to be dropped
# during the HTML to XML conversion process.


$htmlConv = new chilkat::CkHtmlToXml();
$success = $htmlConv->UnlockComponent("anything for 30-day trial");
if (! $success) {
	print "component is locked!\n";
	exit;
}

$html = "<html><body><span>This <b>is</b> a <i>test</i><hr></span></body></html>";
	
# First, call UndropTextFormattingTags to prevent the text formatting tags
# from being dropped by default.
$htmlConv->UndropTextFormattingTags();

# We'll want to drop <hr>, <i>, and <span> tags:
$htmlConv->DropTagType("hr");
$htmlConv->DropTagType("i");
$htmlConv->DropTagType("span");

# To convert, set the HTML and get the XML:
$htmlConv->put_Html($html);
$xml = $htmlConv->xml();

print $xml . "\n";


#	The output is this:
#	
#	<?xml version="1.0" encoding="utf-8" ?>
#
#	<root>
#	    <html>
#	        <body>
#	            <text>This </text>
#	            <b>
#	                <text>is</text>
#	            </b>
#	            <text>a  test</text>
#	        </body>
#	    </html>
#	</root>	
			





 

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