Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/netyouli/whc_xml

自动把字典转换为xml数据
https://github.com/netyouli/whc_xml

Last synced: about 1 month ago
JSON representation

自动把字典转换为xml数据

Awesome Lists containing this project

README

        

# WHC_XML
自动把字典转换为xml数据
####Use Example
```objective-c
NSDictionary * REQHDR = @{@"TrnNum":@"INHB2015042900000001",@"TrnCode":@"1957747793"};
NSDictionary * REQBDY = @{@"OS":@"iPhone",@"App":@"CC",@"IconVersion":@""};
NSDictionary * ebMobileStartupInqR = @{@"REQHDR":REQHDR,@"REQBDY":REQBDY};
NSDictionary * xmlDic = @{@"ebMobileStartupInqRq":ebMobileStartupInqR};
//use one
NSString * xmlStringOne = [WHC_Xml xmlWithDictionary:xmlDic];
//use two
NSString * xmlStringTwo = [WHC_Xml xmlWithDictionary:xmlDic rootAttribute:@"xmlns = \"http://ns.chinatrust.com.tw/XSD/CTCB/ESB/Message/BSMF/ebMobileStartupInqRq/01\""];

NSLog(@"xmlStringOne = %@",xmlStringOne);
//xmlStringOne = NSString * xml = @"\
\
\
INHB2015042900000001\
1957747793\
\
\
iPhone\
CC\
\
\
";


NSLog(@"xmlStringTwo = %@",xmlStringTwo);
//xmlStringTwo = NSString * xml = @"\
\
\
INHB2015042900000001\
1957747793\
\
\
iPhone\
CC\
\
\
";

```