nicklockwood / XMLDictionary

[DEPRECATED]
http://charcoaldesign.co.uk/source/cocoa#xml-dictionary
Other
1.14k stars 235 forks source link

NS1, NS2 and NS3 #13

Closed jorgecfg closed 10 years ago

jorgecfg commented 10 years ago

Hi, I have a structure of soap like that:

env:Header/env:Headerenv:Bodyenv:Servercom.totvs.core.exception.ServiceFault4S00011Acesso bloqueado. Entre em contato com sua agência./ns3:ServiceFault/env:Fault/env:Body/env:Envelope Some node have a suffix like 'NS1', 'NS2' or 'NS3'. Have a way to ignore it? Example, in case: ns3:ServiceFault ignore the 'ns3:' and use only 'ServiceFault' in valueForKeyPath?
nicklockwood commented 10 years ago

I'm afraid there's no way to do this currently.

jorgecfg commented 10 years ago

Hi, I'm too... Did you know some way to fixed it?

gabebear commented 10 years ago

I added this to what I use... I can push it if you want

jorgecfg commented 10 years ago

I will appreciate your push!! =)

gabebear commented 10 years ago

I'll need to update some stuff since I haven't pulled in awhile, but I'll do it today.

jorgecfg commented 10 years ago

Thanks a lot!!!!

gabebear commented 10 years ago

This should probably never be merged into the mainline... Ideally you'd use NSXMLParser's shouldProcessNamespaces stuff, but it works.

Changes are at https://github.com/gabebear/XMLDictionary/tree/master/XMLDictionary

I also added option to remove attributes since I didn't want those either.

I'm now doing something like: XMLDictionaryParser *xmlParser = [[XMLDictionaryParser alloc] init]; xmlParser.removeAttributes = YES; xmlParser.removeNameSpaces = YES; xmlDict = [xmlParser dictionaryWithData:data];

jorgecfg commented 10 years ago

Thanks a lot!!! working fine!!!

nicklockwood commented 10 years ago

The option to initialize XMLDictionary with an NSXMLParser has now been added in version 1.4. Unless I'm mistaken, this now allows you to strip the namespaces without modifying the library.