-
Notifications
You must be signed in to change notification settings - Fork 281
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #405 from gnustep/small_xml_fixes
Two small xml fixes
- Loading branch information
Showing
5 changed files
with
83 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
2024-04-29 Doug Simons <[email protected]> | ||
|
||
* NSXMLNode.m: | ||
Fix execute_xpath() to return an NSError when xpath expression can't | ||
be evaluated instead of just calling NSLog. | ||
|
||
* NSXMLElement.m: | ||
Fix setAttributes: and setAttributesWithDictionary: to remove previous | ||
attributes. | ||
|
||
2024-05-12 ethanc8R (github user) | ||
|
||
* Headers/Foundation/NSRegularExpression.h: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#import "ObjectTesting.h" | ||
#import <Foundation/NSAutoreleasePool.h> | ||
#import <Foundation/NSXMLElement.h> | ||
#import <Foundation/NSXMLDocument.h> | ||
#import <Foundation/NSXMLNode.h> | ||
#import <Foundation/NSError.h> | ||
|
||
int main() | ||
{ | ||
NSAutoreleasePool *arp = [NSAutoreleasePool new]; | ||
|
||
NSString *sourceXML = @"<parent>" | ||
"<chyld>buzz</chyld>" | ||
"<otherchyld>woody</otherchyld>" | ||
"<zorgtree>gollyfoo</zorgtree>" | ||
"<ln:loner xmlns:ln=\"http://loner.ns\">POW</ln:loner>" | ||
"</parent>"; | ||
NSXMLDocument *doc = [[[NSXMLDocument alloc] initWithXMLString:sourceXML options:0 error:NULL] autorelease]; | ||
PASS(doc != nil, "created a document from an XML string"); | ||
|
||
NSError *anError = nil; | ||
NSXMLNode *node = [[doc nodesForXPath:@"//chyld" error:&anError] lastObject]; | ||
PASS(node != nil, "access chyld node"); | ||
PASS(anError == nil, "no error accessing chyld node"); | ||
PASS_EQUAL([node stringValue], @"buzz", "retrieve chyld node"); | ||
|
||
node = [[doc nodesForXPath:@"//ln:loner" error:&anError] lastObject]; | ||
PASS(node == nil, "can't access ln:loner node if namespace not defined at top"); | ||
PASS(anError != nil, "should get error when fail to access node"); | ||
|
||
[arp release]; | ||
arp = nil; | ||
|
||
return 0; | ||
} |