Frameworks/Adium Framework/Source/AIXMLElement.m
author Stephen Holt <sholt@adium.im>
Wed, 26 Aug 2009 13:17:35 -0400
changeset 2597 07e07f9788a6
parent 2578 c5b0c0b0c141
child 2791 a18df53b0617
permissions -rw-r--r--
Undo the part of [3855f70905bd]: It caused strings to be incorrectly escaped and causing our XML parsing to break. Rather, escape hash-symbols when parsing in XML data as not to confuse AIHTMLDecoder. Refs #8141. Fixes #12856.
1226
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
     1
/* AIXMLElement.m
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
     2
 *
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
     3
 * Created by Peter Hosey on 2006-06-07.
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
     4
 *
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
     5
 * This class is explicitly released under the BSD license with the following modification:
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
     6
 * It may be used without reproduction of its copyright notice within The Adium Project.
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
     7
 *
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
     8
 * This class was created for use in the Adium project, which is released under the GPL.
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
     9
 * The release of this specific class (AIXMLElement) under BSD in no way changes the licensing of any other portion
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    10
 * of the Adium project.
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    11
 *
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    12
 ****
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    13
 Copyright ?? 2006 Peter Hosey, Colin Barrett
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    14
 All rights reserved.
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    15
 
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    16
 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    17
 Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    18
 Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    19
 Neither the name of Peter Hosey nor the names of his contributors may be used to endorse or promote products derived from this software without specific prior written permission.
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    20
 
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    21
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    22
 */
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    23
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    24
#import <Adium/AIXMLElement.h>
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    25
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    26
#import <AIUtilities/AIStringAdditions.h>
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    27
1643
bdb155493a36 Make AIXMLElement -copyWithZone: not leak
David Smith
parents: 1227
diff changeset
    28
@interface AIXMLElement()
bdb155493a36 Make AIXMLElement -copyWithZone: not leak
David Smith
parents: 1227
diff changeset
    29
@property (readwrite, retain, nonatomic) NSMutableArray *attributeNames;
bdb155493a36 Make AIXMLElement -copyWithZone: not leak
David Smith
parents: 1227
diff changeset
    30
@property (readwrite, retain, nonatomic) NSMutableArray *attributeValues;
bdb155493a36 Make AIXMLElement -copyWithZone: not leak
David Smith
parents: 1227
diff changeset
    31
@end
bdb155493a36 Make AIXMLElement -copyWithZone: not leak
David Smith
parents: 1227
diff changeset
    32
1226
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    33
@implementation AIXMLElement
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    34
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    35
+ (id) elementWithNamespaceName:(NSString *)namespace elementName:(NSString *)newName
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    36
{
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    37
	if (namespace)
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    38
		newName = [NSString stringWithFormat:@"%@:%@", namespace, newName];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    39
	return [self elementWithName:newName];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    40
}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    41
- (id) initWithNamespaceName:(NSString *)namespace elementName:(NSString *)newName
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    42
{
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    43
	if (namespace)
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    44
		newName = [NSString stringWithFormat:@"%@:%@", namespace, newName];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    45
	return [self initWithName:newName];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    46
}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    47
+ (id) elementWithName:(NSString *)newName
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    48
{
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    49
	return [[[self alloc] initWithName:newName] autorelease];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    50
}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    51
- (id) initWithName:(NSString *)newName
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    52
{
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    53
	NSParameterAssert(newName != nil);
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    54
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    55
	if ((self = [super init])) {
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    56
		name = [newName copy];
1643
bdb155493a36 Make AIXMLElement -copyWithZone: not leak
David Smith
parents: 1227
diff changeset
    57
		self.attributeNames  = [NSMutableArray array];
bdb155493a36 Make AIXMLElement -copyWithZone: not leak
David Smith
parents: 1227
diff changeset
    58
		self.attributeValues = [NSMutableArray array];
1226
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    59
		contents = [[NSMutableArray alloc] init];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    60
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    61
		//If a list of self-closing tags exists, this could change to a lookup into a static NSSet
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    62
		selfCloses = (([newName caseInsensitiveCompare:@"br"] == NSOrderedSame) ? YES : NO);
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    63
	}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    64
	return self;
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    65
}
1643
bdb155493a36 Make AIXMLElement -copyWithZone: not leak
David Smith
parents: 1227
diff changeset
    66
bdb155493a36 Make AIXMLElement -copyWithZone: not leak
David Smith
parents: 1227
diff changeset
    67
@synthesize attributeNames, attributeValues;
bdb155493a36 Make AIXMLElement -copyWithZone: not leak
David Smith
parents: 1227
diff changeset
    68
1226
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    69
- (id) init
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    70
{
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    71
	NSException *exc = [NSException exceptionWithName:@"Can't init AIXMLElement"
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    72
											   reason:@"AIXMLElement does not support the -init method; use -initWithName: instead."
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    73
											 userInfo:nil];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    74
	[exc raise];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    75
	return nil;
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    76
}
1643
bdb155493a36 Make AIXMLElement -copyWithZone: not leak
David Smith
parents: 1227
diff changeset
    77
1226
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    78
- (void) dealloc
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    79
{
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    80
	[name release];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    81
	[attributeNames  release];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    82
	[attributeValues release];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    83
	[contents release];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    84
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    85
	[super dealloc];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    86
}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    87
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    88
- (id) copyWithZone:(NSZone *)zone {
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    89
	AIXMLElement *other = [[AIXMLElement allocWithZone:zone] initWithName:name];
1643
bdb155493a36 Make AIXMLElement -copyWithZone: not leak
David Smith
parents: 1227
diff changeset
    90
	other.attributeNames  = [NSMutableArray arrayWithArray:attributeNames];
bdb155493a36 Make AIXMLElement -copyWithZone: not leak
David Smith
parents: 1227
diff changeset
    91
	other.attributeValues = [NSMutableArray arrayWithArray:attributeValues];
bdb155493a36 Make AIXMLElement -copyWithZone: not leak
David Smith
parents: 1227
diff changeset
    92
	other.selfCloses = selfCloses;
bdb155493a36 Make AIXMLElement -copyWithZone: not leak
David Smith
parents: 1227
diff changeset
    93
	other.contents = self.contents; //uses setArray, so this copies
1226
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    94
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    95
	return other;
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    96
}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    97
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    98
#pragma mark -
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
    99
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   100
- (NSString *) name
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   101
{
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   102
	return name;
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   103
}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   104
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   105
- (unsigned)numberOfAttributes
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   106
{
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   107
	return [attributeNames count];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   108
}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   109
- (NSDictionary *)attributes
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   110
{
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   111
	return [NSDictionary dictionaryWithObjects:attributeValues forKeys:attributeNames];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   112
}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   113
- (void) setAttributeNames:(NSArray *)newAttrNames values:(NSArray *)newAttrVals
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   114
{
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   115
	NSAssert2([newAttrNames count] == [newAttrVals count], @"Attribute names and values have different lengths, %ui and %ui respectively", [newAttrNames count], [newAttrVals count]);
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   116
	unsigned numberOfDuplicates = [newAttrNames count] - [[NSSet setWithArray:newAttrNames] count];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   117
	NSAssert1(numberOfDuplicates == 0, @"Duplicate attributes are not allowed; found %ui duplicate(s)",  numberOfDuplicates);
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   118
	
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   119
	[attributeNames setArray:newAttrNames];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   120
	[attributeValues setArray:newAttrVals];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   121
}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   122
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   123
- (void)setValue:(NSString *)attrVal forAttribute:(NSString *)attrName
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   124
{
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   125
	NSUInteger index = [attributeNames indexOfObject:attrName];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   126
	if (index != NSNotFound) {
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   127
		[attributeValues replaceObjectAtIndex:index withObject:attrVal];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   128
	} else {
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   129
		[attributeNames addObject:attrName];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   130
		[attributeValues addObject:attrVal];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   131
	}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   132
}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   133
- (NSString *)valueForAttribute:(NSString *)attrName
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   134
{
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   135
	NSUInteger index = [attributeNames indexOfObject:attrName];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   136
	if (index != NSNotFound)
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   137
		return [attributeValues objectAtIndex:index];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   138
	return nil;
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   139
}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   140
1643
bdb155493a36 Make AIXMLElement -copyWithZone: not leak
David Smith
parents: 1227
diff changeset
   141
@synthesize selfCloses;
1226
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   142
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   143
#pragma mark -
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   144
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   145
//NSString: Unescaped string data (will be escaped for XMLification).
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   146
//AIXMLElement: Sub-element (e.g. span in a p).
1227
78a272b0a45f Completes [26431], but doesn't revert [25499]. Modifies AIXMLAppender to use AIXMLElements instead of NSXMLElements (which lack the ability to put spaces between elements, log > as &gt;, which are major killjoys). Fixes all the issues I've found with logging.
Zachary West <zacw@adiumx.com>
parents: 1226
diff changeset
   147
- (void)addEscapedObject:(id)obj
78a272b0a45f Completes [26431], but doesn't revert [25499]. Modifies AIXMLAppender to use AIXMLElements instead of NSXMLElements (which lack the ability to put spaces between elements, log > as &gt;, which are major killjoys). Fixes all the issues I've found with logging.
Zachary West <zacw@adiumx.com>
parents: 1226
diff changeset
   148
{
78a272b0a45f Completes [26431], but doesn't revert [25499]. Modifies AIXMLAppender to use AIXMLElements instead of NSXMLElements (which lack the ability to put spaces between elements, log > as &gt;, which are major killjoys). Fixes all the issues I've found with logging.
Zachary West <zacw@adiumx.com>
parents: 1226
diff changeset
   149
	//Warn but don't assert if null is added.  Adding nothing is a no-op, but we may want to investigate where this is happening further.
78a272b0a45f Completes [26431], but doesn't revert [25499]. Modifies AIXMLAppender to use AIXMLElements instead of NSXMLElements (which lack the ability to put spaces between elements, log > as &gt;, which are major killjoys). Fixes all the issues I've found with logging.
Zachary West <zacw@adiumx.com>
parents: 1226
diff changeset
   150
	if (!obj) NSLog(@"Warning: Attempted to add (null) to %@", obj);
78a272b0a45f Completes [26431], but doesn't revert [25499]. Modifies AIXMLAppender to use AIXMLElements instead of NSXMLElements (which lack the ability to put spaces between elements, log > as &gt;, which are major killjoys). Fixes all the issues I've found with logging.
Zachary West <zacw@adiumx.com>
parents: 1226
diff changeset
   151
78a272b0a45f Completes [26431], but doesn't revert [25499]. Modifies AIXMLAppender to use AIXMLElements instead of NSXMLElements (which lack the ability to put spaces between elements, log > as &gt;, which are major killjoys). Fixes all the issues I've found with logging.
Zachary West <zacw@adiumx.com>
parents: 1226
diff changeset
   152
	NSAssert2(([obj isKindOfClass:[NSString class]] || [obj isKindOfClass:[AIXMLElement class]]), @"%@: addObject: %@ is of incorrect class",self,obj);
78a272b0a45f Completes [26431], but doesn't revert [25499]. Modifies AIXMLAppender to use AIXMLElements instead of NSXMLElements (which lack the ability to put spaces between elements, log > as &gt;, which are major killjoys). Fixes all the issues I've found with logging.
Zachary West <zacw@adiumx.com>
parents: 1226
diff changeset
   153
	
78a272b0a45f Completes [26431], but doesn't revert [25499]. Modifies AIXMLAppender to use AIXMLElements instead of NSXMLElements (which lack the ability to put spaces between elements, log > as &gt;, which are major killjoys). Fixes all the issues I've found with logging.
Zachary West <zacw@adiumx.com>
parents: 1226
diff changeset
   154
	[contents addObject:obj];
78a272b0a45f Completes [26431], but doesn't revert [25499]. Modifies AIXMLAppender to use AIXMLElements instead of NSXMLElements (which lack the ability to put spaces between elements, log > as &gt;, which are major killjoys). Fixes all the issues I've found with logging.
Zachary West <zacw@adiumx.com>
parents: 1226
diff changeset
   155
}
78a272b0a45f Completes [26431], but doesn't revert [25499]. Modifies AIXMLAppender to use AIXMLElements instead of NSXMLElements (which lack the ability to put spaces between elements, log > as &gt;, which are major killjoys). Fixes all the issues I've found with logging.
Zachary West <zacw@adiumx.com>
parents: 1226
diff changeset
   156
1226
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   157
- (void) addObject:(id)obj
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   158
{
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   159
	//Warn but don't assert if null is added.  Adding nothing is a no-op, but we may want to investigate where this is happening further.
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   160
	if (!obj) NSLog(@"Warning: Attempted to add (null) to %@", obj);
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   161
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   162
	BOOL isString = [obj isKindOfClass:[NSString class]];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   163
	NSAssert2((isString || [obj isKindOfClass:[AIXMLElement class]]), @"%@: addObject: %@ is of incorrect class",self,obj);
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   164
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   165
	if(isString) {
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   166
		obj = [obj stringByEscapingForXMLWithEntities:nil];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   167
	}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   168
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   169
	[contents addObject:obj];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   170
}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   171
- (void) addObjectsFromArray:(NSArray *)array
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   172
{
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   173
	//We do it this way for the assertion, and to get free escaping of strings.
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   174
	id obj;
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   175
	for (obj in array) {
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   176
		[self addObject:obj];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   177
	}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   178
}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   179
- (void) insertObject:(id)obj atIndex:(unsigned)idx
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   180
{
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   181
	BOOL isString = [obj isKindOfClass:[NSString class]];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   182
	NSParameterAssert(isString || [obj isKindOfClass:[AIXMLElement class]]);
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   183
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   184
	if(isString) {
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   185
		obj = [obj stringByEscapingForXMLWithEntities:nil];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   186
	}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   187
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   188
	[contents insertObject:obj atIndex:idx];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   189
}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   190
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   191
- (NSArray *)contents
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   192
{
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   193
	return contents;
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   194
}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   195
- (void)setContents:(NSArray *)newContents
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   196
{
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   197
	[contents setArray:newContents];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   198
}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   199
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   200
- (NSString *)contentsAsXMLString
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   201
{
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   202
	NSMutableString *contentString = [NSMutableString string];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   203
	id obj = nil;
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   204
	for (obj in contents) {
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   205
		if ([obj isKindOfClass:[NSString class]])
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   206
			[contentString appendString:obj];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   207
		else if ([obj isKindOfClass:[AIXMLElement class]])
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   208
			[contentString appendString:[obj XMLString]];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   209
	}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   210
	return contentString;
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   211
}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   212
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   213
#pragma mark -
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   214
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   215
- (NSString *) quotedXMLAttributeValueStringForString:(NSString *)str
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   216
{
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   217
	return [NSString stringWithFormat:@"\"%@\"", [str stringByEscapingForXMLWithEntities:nil]];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   218
}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   219
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   220
- (void) appendXMLStringtoString:(NSMutableString *)string
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   221
{
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   222
	[string appendFormat:@"<%@", name];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   223
	if ([attributeNames count]) {
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   224
		unsigned attributeIdx = 0U;
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   225
		NSString *key;
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   226
		for (key in attributeNames) {
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   227
			NSString *value = [attributeValues objectAtIndex:attributeIdx++];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   228
			if ([value respondsToSelector:@selector(stringValue)]) {
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   229
				value = [(NSNumber *)value stringValue];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   230
			} else if ([value respondsToSelector:@selector(absoluteString)]) {
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   231
				value = [(NSURL *)value absoluteString];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   232
			}
2597
07e07f9788a6 Undo the part of [3855f70905bd]: It caused strings to be incorrectly escaped and causing our XML parsing to break. Rather, escape hash-symbols when parsing in XML data as not to confuse AIHTMLDecoder. Refs #8141. Fixes #12856.
Stephen Holt <sholt@adium.im>
parents: 2578
diff changeset
   233
			[string appendFormat:@" %@=%@", key, [self quotedXMLAttributeValueStringForString:value]];
1226
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   234
		}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   235
	}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   236
	if ((![contents count]) && (selfCloses)) {
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   237
		[string appendString:@" /"];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   238
	}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   239
	[string appendString:@">"];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   240
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   241
	id obj;
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   242
	for (obj in contents) {
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   243
		if ([obj isKindOfClass:[NSString class]]) {
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   244
			[string appendString:(NSString *)obj];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   245
		} else if([obj isKindOfClass:[AIXMLElement class]]) {
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   246
			[(AIXMLElement *)obj appendXMLStringtoString:string];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   247
		}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   248
	}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   249
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   250
	if ([contents count] || !selfCloses) {
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   251
		[string appendFormat:@"</%@>", name];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   252
	}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   253
}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   254
- (NSString *) XMLString
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   255
{
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   256
	NSMutableString *string = [NSMutableString string];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   257
	[self appendXMLStringtoString:string];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   258
	return [NSString stringWithString:string];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   259
}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   260
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   261
- (void) appendUTF8XMLBytesToData:(NSMutableData *)data
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   262
{
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   263
	NSMutableString *startTag = [NSMutableString stringWithFormat:@"<%@", name];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   264
	if ([self numberOfAttributes]) {
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   265
		unsigned attributeIdx = 0U;
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   266
		NSString *key;
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   267
		for (key in attributeNames) {
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   268
			NSString *value = [attributeValues objectAtIndex:attributeIdx++];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   269
			if ([value respondsToSelector:@selector(stringValue)]) {
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   270
				value = [(NSNumber *)value stringValue];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   271
			} else if ([value respondsToSelector:@selector(absoluteString)]) {
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   272
				value = [(NSURL *)value absoluteString];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   273
			}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   274
			[startTag appendFormat:@" %@=%@", key, [self quotedXMLAttributeValueStringForString:value]];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   275
		}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   276
	}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   277
	if ((![contents count]) && (selfCloses)) {
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   278
		[startTag appendString:@" /"];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   279
	}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   280
	[startTag appendString:@">"];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   281
	[data appendData:[startTag dataUsingEncoding:NSUTF8StringEncoding]];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   282
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   283
	id obj;
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   284
	for (obj in contents) {
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   285
		if ([obj isKindOfClass:[NSString class]]) {
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   286
			[data appendData:[(NSString *)obj dataUsingEncoding:NSUTF8StringEncoding]];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   287
		} else if([obj isKindOfClass:[AIXMLElement class]]) {
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   288
			[(AIXMLElement *)obj appendUTF8XMLBytesToData:data];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   289
		}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   290
	}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   291
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   292
	if ([contents count] || !selfCloses) {
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   293
		[data appendData:[[NSString stringWithFormat:@"</%@>", name] dataUsingEncoding:NSUTF8StringEncoding]];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   294
	}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   295
}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   296
- (NSData *)UTF8XMLData
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   297
{
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   298
	NSMutableData *data = [NSMutableData data];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   299
	[self appendUTF8XMLBytesToData:data];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   300
	return [NSData dataWithData:data];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   301
}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   302
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   303
- (NSString *)description
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   304
{
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   305
	NSMutableString *string = [NSMutableString stringWithFormat:@"<%@ AIXMLElement:id=\"%p\"", name, self];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   306
	if ([attributeNames count] && [attributeValues count]) { //there's no way these could be different values, but whatever
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   307
		unsigned attributeIdx = 0U;
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   308
		NSString *key;
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   309
		for (key in attributeNames) {
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   310
			NSString *value = [attributeValues objectAtIndex:attributeIdx++];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   311
			if ([value respondsToSelector:@selector(stringValue)]) {
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   312
				value = [(NSNumber *)value stringValue];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   313
			} else if ([value respondsToSelector:@selector(absoluteString)]) {
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   314
				value = [(NSURL *)value absoluteString];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   315
			}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   316
			[string appendFormat:@" %@=%@", key, [self quotedXMLAttributeValueStringForString:value]];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   317
		}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   318
	}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   319
	[string appendString:@" />"];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   320
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   321
	return [NSString stringWithString:string];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   322
}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   323
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   324
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   325
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   326
#pragma mark KVC
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   327
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   328
/*
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   329
These aren't working. I recommend calling -objectForKey on the return value of -attributes.
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   330
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   331
Adium[302:117] The following unhandled exception was ignored: NSUnknownKeyException ([<AIXMLElement 0xce582b0> valueForUndefinedKey:]: this class is not key value coding-compliant for the key auto.)
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   332
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   333
*/
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   334
/*
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   335
- (id) valueForKey:(NSString *)key {
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   336
	unsigned idx = [attributeNames indexOfObject:key];	
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   337
	return (idx != NSNotFound) ? [attributeValues objectAtIndex:idx] : [super valueForKey:key];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   338
}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   339
//FIXME: this shouldn't clobber setObject:forKey: on NSObject.
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   340
- (void) setValue:(id)obj forKey:(NSString *)key {
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   341
	unsigned idx = [attributeNames indexOfObject:key];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   342
	if(idx == NSNotFound) {
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   343
		[attributeNames addObject:key];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   344
		[attributeValues addObject:obj];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   345
	} else {
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   346
		[attributeValues replaceObjectAtIndex:idx withObject:obj];
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   347
	}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   348
}
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   349
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   350
*/
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   351
83a767c75be7 Revert [25511], [25538], [25539] which removed AIXMLElement. This breaks our ability to log elements the way we want (notably, > as &gt; to avoid problems with LMX's reverse-parsing). This is still broken, though: [25499]'s use of NSXMLElement causes the changes to encoding we've made in AIXMLElement to be reverted.
Zachary West <zacw@adiumx.com>
parents:
diff changeset
   352
@end