Sample code for 30+ languages & platforms
Objective-C

HasChildWithTag using a Tag Path

Demonstrates calling HasChildWithTag with a tag path.

Chilkat Objective-C Downloads

Objective-C
#import <CkoXml.h>

CkoXml *xml = [[CkoXml alloc] init];

xml.Tag = @"world";

[xml NewChild2: @"north_america|united_states|california|san_francisco" content: @"Silicon Valley"];
[xml NewChild2: @"north_america|united_states|california|san_diego" content: @"Birthplace of California"];
[xml NewChild2: @"north_america|united_states|illinois|chicago" content: @"Windy City"];

NSLog(@"%@",[xml GetXml]);

//  Produces the following XML
//  
//  	<?xml version="1.0" encoding="utf-8" ?>
//  	<world>
//  	    <north_america>
//  	        <united_states>
//  	            <california>
//  	                <san_francisco>Silicon Valley</san_francisco>
//  	                <san_diego>Birthplace of California</san_diego>
//  	            </california>
//  	            <illinois>
//  	                <chicago>Windy City</chicago>
//  	            </illinois>
//  	        </united_states>
//  	    </north_america>
//  	</world>
//  

BOOL hasChicago = [xml HasChildWithTag: @"north_america|united_states|illinois|chicago"];
NSLog(@"%@%d",@"hasChicago = ",hasChicago);

BOOL hasNaperville = [xml HasChildWithTag: @"north_america|united_states|illinois|naperville"];
NSLog(@"%@%d",@"hasNaperville = ",hasNaperville);

BOOL hasIllinois = [xml HasChildWithTag: @"north_america|united_states|illinois"];
NSLog(@"%@%d",@"hasIllinois = ",hasIllinois);