Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Symbianѧϰ±Ê¼Ç(15) ½âÎöXMLÎļþ(ÉÏ)

ÊÕ²Ø
ÎÒÔøÔÚÇ°Ãæ½éÉܹýÒ»¸ö¿ÉÓÃÓÚBREW»·¾³ÏµÄXML Parser£¬½ñÌìÏë·ÖÏíµÄÊÇÈçºÎÔÚSymbianƽ̨ÉϽâÎöXMLÎļþ£¬²»ÐèÒªµÚÈý·½µÄ¶«Î÷£¬SymbianÒѾ­ÎªÎÒÃÇÌṩÁËÕâ¸öÀàCParser¡£
ÍøÉÏÒ²ÓÐÕâ·½ÃæµÄ×ÊÁÏ£¬½¨Òé²Î¿¼£º
http://wiki.forum.nokia.com/index.php/How_to_parse_XML_file_using_CParser_class
²»¹ý£¬Òª×¢ÒâµÄÊÇSymbianÖеÄCParserÊÇ»ùÓÚSAX·½Ê½À´½âÎöµÄÒ²¾ÍÊÇ˵ËüÊÇ»ùÓÚʼþÁ÷·½Ê½£¬¶ÔÓÚSAX£¬Èç¹û×ö¹ýJAVA¿ª·¢µÄÒ»°ã²»»áÄ°ÉúÁË¡£ÓëDOMÏà±ÈSAX·½Ê½ÔÚ²Ù×÷ÉÏ»áÓеãÂé·³¶øÇÒÏÔµÃûÄÇôºÃÀí½â¡£
¼òÒª±È½Ïһϰɣ¬DOMÊǽ«XMLÔÚÄÚ´æÖÐÕ¹¿ª³ÉÒ»¸öÊ÷µÄÄ£ÐÍ£¬ÎÒÃÇ¿ÉÒÔ·½±ãµØ·ÃÎÊËüµÄÿ¸ö×ӽڵ㣬¿É¶Á¿Éд¡£µ«ÊÇSAXÄØ£¿ÎÒÃÇÖ»ÄÜͨ¹ýÒ»¸öµ¥ÏòÎı¾Á÷È¥½âÎöXML£¬ÔÚ¹ý³ÌÖÐÓжà¸öʼþ»Øµ÷£¨¿ªÊ¼Ä³¸öÔªËØ´¦Àí¡¢½áÊøij¸öÔªËØ´¦ÀíµÈµÈ£©£¬ËüÊǵ¥ÏòÖ»¶ÁµÄ¡£
ÏÂÃæÎÒÃÇÀ´Ïêϸ˵Ã÷Ò»ÏÂÈçºÎʵÏÖ°É¡£
Ê×ÏÈ£¬ÎÒÃǽ¨Á¢Ò»¸ö½âÎöÆ÷ÅÉÉúÓÚCActive£¬ÓÉËü¸ºÔðÕû¸ö½âÎö¹ý³Ì£¨ÒòΪÕâÊÇÒ»¸öÒì²½²Ù×÷£©¡£
#include <xmlparser.h>
#include <xmlcontenthandler.h>
using namespace Xml;
class MXMLHandlerObserver
...{
public:
    virtual void OnParseCompleted( TInt aError ) = 0;
};
class CXMLActiveParser : public CActive ...{
public:
    ~CXMLActiveParser();
    static CXMLActiveParser* NewL(MXMLHandlerObserver& aObserver,MContentHandler& aHandler);
    static CXMLActiveParser* NewLC(MXMLHandlerObserver& aObserver,MContentHandler& aHandler);
public:
    void StartL(const TDesC& aFileName);
private:
    CXMLActiveParser(MXMLHandlerObserver& aObserver,MContentHandler& aHandler);
    void ConstructL();
private:
    void RunL();
    void DoCancel();
    TInt RunError(TInt aError);
private:
   
    CParser*            iParser;
    HBufC8*             iBuffer;
    RFile     


Ïà¹ØÎĵµ£º

Java¶ÁÈ¡xmlµÄËÄÖÖ·½Ê½

¡¡¡¡ÔÚƽʱ¹¤×÷ÖУ¬ÄÑÃâ»áÓöµ½°Ñ XML ×÷ΪÊý¾Ý´æ´¢¸ñʽ¡£Ãæ¶ÔÄ¿Ç°ÖÖÀà·±¶àµÄ½â¾ö·½°¸£¬Äĸö×îÊʺÏÎÒÃÇÄØ£¿ÔÚÕâƪÎÄÕÂÖУ¬ÎÒ¶ÔÕâËÄÖÖÖ÷Á÷·½°¸×öÒ»¸ö²»ÍêÈ«ÆÀ²â£¬½ö½öÕë¶Ô±éÀú XML Õâ¿éÀ´²âÊÔ£¬ÒòΪ±éÀú XML Êǹ¤×÷ÖÐʹÓÃ×î¶àµÄ£¨ÖÁÉÙÎÒÈÏΪ£©¡£
¡¡¡¡Ô¤ ±¸
¡¡¡¡²âÊÔ»·¾³£º
¡¡¡¡AMD ¶¾Áú1.4G OC 1.5G¡¢256M DDR333¡¢Wind ......

ʹÓÃdom4j¶ÁÈ¡xmlÎļþ

Ê×ÏȽ«dom4j-1.6.1.jar,jaxen-1.1.1.jarÁ½¸öjar°üµ¼Èëµ½ÏîÄ¿ÖÐ
reader_config.xml
<?xml version="1.0" encoding="UTF-8"?>
<config>
<db-info>
<driver-name>oracle.jdbc.driver.OracleDriver</driver-name>
<url>jdbc:oracle:thin:@192.168.1.100:1521:orcl</url> ......

JAVA²Ù×÷XMLµÄÍêÕûÀý×Ó——W3C DOMƪ

ÕâÊÇÒ»¸öÓÃJAVA W3C DOM ½øÐÐXML²Ù×÷µÄÀý×Ó£¬°üº¬Á˲éѯ¡¢Ôö¼Ó¡¢Ð޸ġ¢É¾³ý¡¢±£´æµÄ»ù±¾²Ù×÷¡£½ÏÍêÕûµÄÃèÊöÁËÒ»¸öXMLµÄÕû¸ö²Ù×÷Á÷³Ì¡£ÊʺϸÕÈëÃÅJAVA XML²Ù×÷µÄÅóÓѲο¼ºÍѧϰ¡£
¼ÙÉèÓÐXMLÎļþ£ºtest1.xml
<?xml version="1.0" encoding="UTF-8"?>
<books>
 <book>
  <name>¹þÀï²¨Ì ......

XMLµÄһЩ¼òµ¥ÎÊÌ⣡

£¨µÚ1Õ£©
(P1~3)1£®ÓÃ×Ô¼ºµÄÓïÑÔ¶ÔSGML¡¢HTMLºÍXML×÷¼òµ¥½éÉܺͶԱȡ£
SGML  ÊÇÒ»ÖÖ²ÉÓñê¼ÇÀ´ÃèÊöÎĵµÊý¾ÝµÄͨÓÃÓïÑÔ£¬SGML¶¨ÒåÁË»ù±¾µÄÓï·¨ºÃ£¬Í¬Ê±Ò²ÔÊÐíÓû§½¨Á¢×Ô¼ºµÄÔªËرê¼Ç¡£
HTML ²ÉÓÃÁ˺ÜСһ²¿·ÖSGMLµÄ±ê¼Ç£¬Í¬Ê±HTML²ÉÓõÄÊǹ̶¨±ê¼ÇÒ²²»ÐèÒª°üº¬DTD¡£
XML ͬHTMLÒ»Ñù£¬¶¼Êdzö×ÔÓÚSGML±ê׼ͨÓñê¼ÇÓï ......

Symbian OSϽâÎöXMLÎĵµµÄһЩ·½·¨

2009-10-27 22:44×ÊÁÏÀ´Ô´ÓÚÍøÂç,ËÄÖÖ·½Ê½,´ó¼Ò¿ÉÒÔ×Ô¼º³¢ÊÔÏÂ.
=========11111=================
tinyXML
www.grinninglizard.com/tinyxml/
=========22222================================
symbian s60 µÚÈý°æÖ®ºó£¬ÒѾ­ÌṩÁ˽âÎöxmlµÄϵͳapi,²ÉÓõÄÊÇSAX·½Ê½¡£
XML parsing in Symbian OS v9.x À´Ô´Ä¿Â¼£º
htt ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ