* Source/NSXMLDocument.m

* Source/NSXMLNode.m: Add / to xpath if it is not there.
	Thes matches behavior observed on Mac OS X/Cocoa.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/branches/nsxml_using_libxml2@34562 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2012-01-17 08:51:23 +00:00
parent c28fe9a54b
commit 96e464fc49
3 changed files with 17 additions and 1 deletions

View file

@ -931,6 +931,11 @@ NSArray *execute_xpath(NSXMLNode *node,
- (NSArray*) nodesForXPath: (NSString*)anxpath error: (NSError**)error
{
if([[anxpath substringWithRange: NSMakeRange(0,1)] isEqual: @"/"] == NO)
{
anxpath = [@"/" stringByAppendingString: anxpath];
}
*error = NULL;
return execute_xpath(self, anxpath, NULL);
}