Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/netyouli/whc_xml
自动把字典转换为xml数据
https://github.com/netyouli/whc_xml
Last synced: about 1 month ago
JSON representation
自动把字典转换为xml数据
- Host: GitHub
- URL: https://github.com/netyouli/whc_xml
- Owner: netyouli
- Created: 2015-05-04T03:41:04.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-05-04T08:04:31.000Z (over 9 years ago)
- Last Synced: 2023-03-01T16:56:00.617Z (almost 2 years ago)
- Language: Objective-C
- Size: 121 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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\
\
\
";```