Permalink
Browse files

Minor optimization to the description / XMLString method.

  • Loading branch information...
1 parent 55edeb9 commit a1218bfd0b6be32edc99c9b4396a07015e57a0e7 @robbiehanson committed Apr 14, 2011
Showing with 13 additions and 13 deletions.
  1. +13 −13 DDXMLNode.m
View
@@ -601,8 +601,8 @@ - (DDXMLNode *)childAtIndex:(NSUInteger)index
/**
* Returns the previous DDXMLNode object that is a sibling node to the receiver.
*
- * This object will have an index value that is one less than the receiver’s.
- * If there are no more previous siblings (that is, other child nodes of the receiver’s parent) the method returns nil.
+ * This object will have an index value that is one less than the receiverÕs.
+ * If there are no more previous siblings (that is, other child nodes of the receiverÕs parent) the method returns nil.
**/
- (DDXMLNode *)previousSibling
{
@@ -618,8 +618,8 @@ - (DDXMLNode *)previousSibling
/**
* Returns the next DDXMLNode object that is a sibling node to the receiver.
*
- * This object will have an index value that is one more than the receiver’s.
- * If there are no more subsequent siblings (that is, other child nodes of the receiver’s parent) the
+ * This object will have an index value that is one more than the receiverÕs.
+ * If there are no more subsequent siblings (that is, other child nodes of the receiverÕs parent) the
* method returns nil.
**/
- (DDXMLNode *)nextSibling
@@ -636,7 +636,7 @@ - (DDXMLNode *)nextSibling
/**
* Returns the previous DDXMLNode object in document order.
*
- * You use this method to “walk” backward through the tree structure representing an XML document or document section.
+ * You use this method to ÒwalkÓ backward through the tree structure representing an XML document or document section.
* (Use nextNode to traverse the tree in the opposite direction.) Document order is the natural order that XML
* constructs appear in markup text. If you send this message to the first node in the tree (that is, the root element),
* nil is returned. DDXMLNode bypasses namespace and attribute nodes when it traverses a tree in document order.
@@ -685,7 +685,7 @@ - (DDXMLNode *)previousNode
/**
* Returns the next DDXMLNode object in document order.
*
- * You use this method to “walk” forward through the tree structure representing an XML document or document section.
+ * You use this method to ÒwalkÓ forward through the tree structure representing an XML document or document section.
* (Use previousNode to traverse the tree in the opposite direction.) Document order is the natural order that XML
* constructs appear in markup text. If you send this message to the last node in the tree, nil is returned.
* DDXMLNode bypasses namespace and attribute nodes when it traverses a tree in document order.
@@ -832,7 +832,7 @@ - (NSString *)XPath
* Returns the local name of the receiver.
*
* The local name is the part of a node name that follows a namespace-qualifying colon or the full name if
- * there is no colon. For example, “chapter” is the local name in the qualified name “acme:chapter”.
+ * there is no colon. For example, ÒchapterÓ is the local name in the qualified name Òacme:chapterÓ.
**/
- (NSString *)localName
{
@@ -850,11 +850,11 @@ - (NSString *)localName
}
/**
- * Returns the prefix of the receiver’s name.
+ * Returns the prefix of the receiverÕs name.
*
* The prefix is the part of a namespace-qualified name that precedes the colon.
- * For example, “acme” is the local name in the qualified name “acme:chapter”.
- * This method returns an empty string if the receiver’s name is not qualified by a namespace.
+ * For example, ÒacmeÓ is the local name in the qualified name Òacme:chapterÓ.
+ * This method returns an empty string if the receiverÕs name is not qualified by a namespace.
**/
- (NSString *)prefix
{
@@ -914,7 +914,7 @@ - (void)setURI:(NSString *)URI
/**
* Returns the URI associated with the receiver.
*
- * A node’s URI is derived from its namespace or a document’s URI; for documents, the URI comes either from the
+ * A nodeÕs URI is derived from its namespace or a documentÕs URI; for documents, the URI comes either from the
* parsed XML or is explicitly set. You cannot change the URI for a particular node other for than a namespace
* or document node.
**/
@@ -1039,11 +1039,11 @@ - (NSString *)XMLStringWithOptions:(NSUInteger)options
else
{
NSMutableString *resTmp = [NSMutableString stringWithUTF8String:(const char *)bufferPtr->content];
- NSString *result = [resTmp stringByTrimming];
+ CFStringTrimWhitespace((CFMutableStringRef)resTmp);
xmlBufferFree(bufferPtr);
- return result;
+ return [[resTmp copy] autorelease];
}
}

0 comments on commit a1218bf

Please sign in to comment.