mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-20 12:16:40 +00:00
namespace bugfixes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26003 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
6425664347
commit
2b48d85f2a
2 changed files with 31 additions and 3 deletions
|
@ -26,6 +26,7 @@
|
|||
#include "config.h"
|
||||
#include <Foundation/NSArray.h>
|
||||
#include <Foundation/NSError.h>
|
||||
#include <Foundation/NSEnumerator.h>
|
||||
#include <Foundation/NSException.h>
|
||||
#include <Foundation/NSXMLParser.h>
|
||||
#include <Foundation/NSData.h>
|
||||
|
@ -74,6 +75,7 @@ NSString* const NSXMLParserErrorDomain = @"NSXMLParserErrorDomain";
|
|||
prefix: (NSString*)prefix
|
||||
href: (NSString*)href
|
||||
attributes: (NSMutableDictionary*)elementAttributes
|
||||
namespaces: (NSMutableDictionary*)elementNamespaces
|
||||
{
|
||||
NSString *qName = elementName;
|
||||
|
||||
|
@ -91,6 +93,33 @@ NSString* const NSXMLParserErrorDomain = @"NSXMLParserErrorDomain";
|
|||
}
|
||||
else
|
||||
{
|
||||
/* When we are not handling namespaces specially, any namespaces
|
||||
* should appear as attributes of the element.
|
||||
*/
|
||||
if ([elementNamespaces count] > 0)
|
||||
{
|
||||
NSEnumerator *e = [elementNamespaces keyEnumerator];
|
||||
NSString *k;
|
||||
|
||||
if (elementAttributes == nil)
|
||||
{
|
||||
elementAttributes = [NSMutableDictionary dictionary];
|
||||
}
|
||||
while ((k = [e nextObject]) != nil)
|
||||
{
|
||||
NSString *v = [elementNamespaces objectForKey: k];
|
||||
|
||||
if ([k length] == 0)
|
||||
{
|
||||
[elementAttributes setObject: v forKey: @"xmlns"];
|
||||
}
|
||||
else
|
||||
{
|
||||
k = [@"xmlns:" stringByAppendingString: k];
|
||||
[elementAttributes setObject: v forKey: k];
|
||||
}
|
||||
}
|
||||
}
|
||||
[_delegate parser: _owner
|
||||
didStartElement: qName
|
||||
namespaceURI: nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue