File: programming/cocoa/

 *  UKXMLPersistence.c
 *  Created by Uli Kusterer on 07.10.04.
 *  Copyright 2004 M. Uli Kusterer. All rights reserved.
#include "UKXMLPersistence.h"
#if 0
#define UK_XML_SHOWSTR(s)	{ char tmp[1024]; CFStringGetCString( (s), tmp, 1024, kCFStringEncodingUTF8 ); printf("\"%s\"\n",tmp); }
#define UK_XML_SHOWSTR(s)	// (s)
// CFStringFindAndReplace Is only available in 10.2 and later, so we roll our own:
"&lt;"), CFSTR("<") );
	UKFindAndReplace( s, CFSTR("&gt;"), CFSTR(">") );
	UKFindAndReplace( s, CFSTR("&quot;"), CFSTR("\"") );
	UKFindAndReplace( s, CFSTR("&amp;"), CFSTR("&""&"), CFSTR("&amp;") );
	UKFindAndReplace( s, CFSTR("<"), CFSTR("&lt;") );
	UKFindAndReplace( s, CFSTR(">"), CFSTR("&gt;") );
	UKFindAndReplace( s, CFSTR("\""), CFSTR("&quot;"'<''>'// Regular start tag.
// Start tag with integrated end tag.
						CFDictionaryAddValue( dict, startToken, CFSTR(""// Just ate owner's end tag.
// No slash? This is beginning tag for sub-object:
""// Just ate owner's end tag.
'/''<''>''?''?'"?xml""?xml"""'\t', '\t', '\t', '\t', '\t', '\t', '\t', '\t', '\t', '\t'//CFStringAppendFormat( s, NULL, CFSTR("%u:"), count );
"<"">\n""</"">\n""?xml""<"">\n""<""/>\n""<"">""</"">\n""<"">""</"">\n""?xml""<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"

This code uses the PclZip Zip File reading code, which is subject to the GNU LGPL. It also uses the GeSHi syntax highlighter, subject to the GPL. Ask if you want this for your own web site, it's free.