objective c xml½âÎö
½ñÌìÔÚCCÉÏ¿´µ½evangelÔÚÕÐÈË£¬ÉÏÃæÐ´ÁËÒ»ÌõÊý¾Ý½âÎö£¬ÎÒÏëÓ¦¸Ã¾ÍÊǶÔXMLµÄ½âÎö°É£¬ÔÝÇÒÕâÑùÀí½âÁË£¬ºÇºÇ¡£ÏÂÎçËÑË÷ÁËÒ»µã¶«Î÷×Ô¼ºÅªÁËÒ»¸öXMLÈ»ºó¶Á¶Á¿´¿´£¬ÏÖÔÚ½ö½öÊǶÁ³öÁËһЩ¶«Î÷£¬Ïȱ£´æ´úÂ룬´ýºóÐø¸üУ¡
Õâ¸öÊÇÎÒ´´½¨µÄxmlÎļþ£¬ÓÃÓÚ²âÊÔÓõģº
<?xml version="1.0" encoding="UTF-8"?>
<book>
<book1>
<author>zhangsan</author>
<title>Hello this is book1</title>
<content>book1 is very good for testing!</content>
</book1>
<book2>
<author>lisi</author>
<title>Hello this is book2</title>
<content>book2 is very good for testing!</content>
</book2>
<book3>
<author>wangwu</author>
<title>Hello this is book3</title>
<content>book3 is very good for testing!</content>
</book3>
</book>
¶Ôxml½øÐнâÎöÐèҪʹÓÃNSXMLParserÀ࣬Ê×ÏÈÉùÃ÷Ò»¸öNSXMLParser¶ÔÏó
NSXMLParser *xmlRead;
NSString *path = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"xml"];
NSFileHandle *file = [NSFileHandle fileHandleForReadingAtPath:path];
NSData *data = [file readDataToEndOfFile];//µÃµ½xmlÎļþ
[file closeFile];
xmlRead = [[NSXMLParser alloc] initWithData:data];//³õʼ»¯NSXMLParser¶ÔÏó
[data release];
[xmlRead setDelegate:self];//ÉèÖÃNSXMLParser¶ÔÏóµÄ½âÎö·½·¨´úÀí
BOOL success = [xmlRead parse];//µ÷ÓôúÀí½âÎöNSXMLParser¶ÔÏ󣬿´½âÎöÊÇ·ñ³É¹¦
//½âÎöÆ÷£¬´ÓÁ½¸ö½áµãÖ®¼ä¶ÁÈ¡ÄÚÈÝ
- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string {
NSLog(string);
}
//»ñµÃ½áµã½áβµÄÖµ
- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName
namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName {
NSLog(elementName);
}
//»ñµÃ½áµãÍ·µÄÖµ
- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName
Ïà¹ØÎĵµ£º
1£ºÈçºÎͨ¹ýsocket´úÀíÀ´·ÃÎÊ·þÎñ¶Ë£º
String proxyHost =
"192.168.204.212"
;
String proxyPort =
"1080"
;
//֪ͨJavaҪͨ¹ý´úÀí½øÐÐÁ¬½Ó¡£
ÕýÔÚ×°ÔØÊý¾Ý……
System.get ......
Éú³É¶Ë´¦Àí
½«ÒªÐ´ÈëµÄÖµµÄǰºóдÉÏÈç:"<![CDATA[" + string+ "]]>";
XmlNode xnformchild = doc.CreateNode(XmlNodeType.Element, dc.ColumnName.ToUpper(), "");
try
{
xnformchild.InnerXml = drform[dc.ColumnName].ToString( ......
1.ÔÚc³ÌÐòµ÷ÓÃc³ÌÐòºÍc++³ÌÐòµ÷ÓÃc++³ÌÐòʱ£¬²»Éæ¼°¡£
2.ÔÚc³ÌÐòµ÷ÓÃc++³ÌÐòʱ£¬C++µÄÍ·ÎļþÐèÌí¼Óextern "C"£¬µ«ÊÇÔÚCÓïÑÔÖв»ÄÜÖ±½ÓÒýÓÃÉùÃ÷ÁËextern "C"µÄ¸ÃÍ·Îļþ£¬Ó¦¸Ã½ö½«CÎļþÖн«C++Öж¨ÒåµÄextern "C"º¯ÊýÉùÃ÷ΪexternÀàÐÍ¡£
3.ÔÚc++³ÌÐòµ÷ÓÃc³ÌÐòʱ£¬ÔÚ°üº¬CÓïÑÔÍ·Îļþ£¨¼ÙÉèΪcExample.h£©Ê±£¬Ðè½øÐÐÏÂÁд¦Àí£ ......
#include <Windows.h>
#include <math.h>
#include "resource.h"
#define PI 3.1415976/180
int dwCenterX,dwCenterY,dwRadius;
const TCHAR *szAppName=TEXT("Clock");
LRESULT CALLBACK ProcWinMain(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
void ShowTime(HWND hwnd,HDC hdc);
void ......
×îÇ¿µÄGUI¿âµ±ÊôQt£¬±Ï¾¹ÊÇÉÌÒµ»¯µÄ¶«Î÷£¬¹¦ÄÜ×îÍêÕû£¬Ê²Ã´¶¼ºÃ£¬°üÀ¨ÀàËÆjava´úÂë·ç¸ñ£¬Á¼ºÃµÄ¿ò¼ÜÉè¼Æ£¬µ«Óм¸µãÖµµÄÒ»Ì᣺
1.ËüûÓÐʹÓÃSTL£¬¶øÊÇ×Ô¼ºÊµÏÖÁËÒ»Ì×Ìæ´ú·½°¸QTL£»
2.ʼþÄ£ÐÍʹÓÃ×Ô´´µÄsignal/slot»úÖÆ£¬ËùÒÔÐèÒªmoc.exeÀ´Ô¤´¦ÀíÍ·Îļþ£»
&nbs ......