mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-01 17:12:03 +00:00
Get all attribute values data
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@14731 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
74fb5d31e8
commit
72c3b7f7a5
1 changed files with 30 additions and 21 deletions
|
@ -745,17 +745,17 @@ static NSMapTable *nodeNames = 0;
|
||||||
{
|
{
|
||||||
const void *name = prop->name;
|
const void *name = prop->name;
|
||||||
NSString *key = UTF8Str(name);
|
NSString *key = UTF8Str(name);
|
||||||
|
NSString *value = @"";
|
||||||
|
xmlNodePtr child = prop->children;
|
||||||
|
|
||||||
if (prop->children != NULL)
|
while (child != NULL)
|
||||||
{
|
{
|
||||||
const void *content = prop->children->content;
|
const void *content = child->content;
|
||||||
|
|
||||||
[d setObject: UTF8Str(content) forKey: key];
|
value = [value stringByAppendingString: UTF8Str(content)];
|
||||||
}
|
child = child->next;
|
||||||
else
|
|
||||||
{
|
|
||||||
[d setObject: @"" forKey: key];
|
|
||||||
}
|
}
|
||||||
|
[d setObject: value forKey: key];
|
||||||
prop = prop->next;
|
prop = prop->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1168,17 +1168,26 @@ static NSMapTable *nodeNames = 0;
|
||||||
|
|
||||||
if ([key isEqualToString: n] == YES)
|
if ([key isEqualToString: n] == YES)
|
||||||
{
|
{
|
||||||
if (prop->children != NULL)
|
xmlNodePtr child = prop->children;
|
||||||
{
|
|
||||||
const void *content = prop->children->content;
|
|
||||||
|
|
||||||
value = UTF8Str(content);
|
while (child != NULL)
|
||||||
|
{
|
||||||
|
const void *content = child->content;
|
||||||
|
|
||||||
|
if (value == nil)
|
||||||
|
{
|
||||||
|
value = UTF8Str(content);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
value = [value stringByAppendingString: UTF8Str(content)];
|
||||||
|
}
|
||||||
|
child = child->next;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
prop = prop->next;
|
prop = prop->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1263,25 +1272,25 @@ static NSMapTable *nodeNames = 0;
|
||||||
|
|
||||||
while (prop != NULL)
|
while (prop != NULL)
|
||||||
{
|
{
|
||||||
|
xmlNodePtr child = prop->children;
|
||||||
const void *name = prop->name;
|
const void *name = prop->name;
|
||||||
NSString *key = UTF8Str(name);
|
NSString *key = UTF8Str(name);
|
||||||
|
NSString *value = @"";
|
||||||
|
|
||||||
if (keyTransformSel != 0)
|
if (keyTransformSel != 0)
|
||||||
{
|
{
|
||||||
key = [key performSelector: keyTransformSel];
|
key = [key performSelector: keyTransformSel];
|
||||||
}
|
}
|
||||||
if (prop->children != NULL)
|
while (child != NULL)
|
||||||
{
|
{
|
||||||
const void *content = prop->children->content;
|
const void *content = child->content;
|
||||||
|
|
||||||
[d setObject: UTF8Str(content) forKey: key];
|
value = [value stringByAppendingString: UTF8Str(content)];
|
||||||
}
|
child = child->next;
|
||||||
else
|
|
||||||
{
|
|
||||||
[d setObject: @"" forKey: key];
|
|
||||||
}
|
}
|
||||||
|
[d setObject: value forKey: key];
|
||||||
prop = prop->next;
|
prop = prop->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue