VC½âÎöXML ʹÓÃCMarkupÀà½âÎöXML
(Ò») ÏȽ²Ò»ÏÂXMLÖеÄÎïÊâ×Ö·û£¬ÊÖ¶¯ÌîдʱעÒâһϡ£
×Ö·û ×Ö·ûʵÌå
& &»ò&
' '»ò'
> >»ò>
< <»ò&<
" "»ò"
(¶þ) CMarkupÀàµÄÔ´´úÂë¡£
ÕâÊÇÄ¿Ç°µÄ×îа汾£»
ÕâÊǹÙÍøʾÀýÎļþ£¬È¡³öÀïÃæµÄMarkup.cppºÍMarkup.h£¬µ¼ÈëÄãµÄ¹¤³ÌÀïÃ棬CMarkupÀà¾Í¿ÉÒÔÓÃÁË£»
ÏÂÔصØÖ·£ºhttp://www.firstobject.com/Markup90.zip¡¡2007Äê10ÔÂ1ÈÕ¹ÙÍø×îаæ
Èç¹ûÏÂÔز»ÁË£¬¿ÉÒÔµ½¹ÙÍøÈ¥ÏÂÔØ¡¡http://www.firstobject.com/dn_markup.htm¡¡
(Èý) ´´½¨Ò»¸öXMLÎĵµ¡£
CMarkup xml;
xml.AddElem( "ORDER" );
xml.AddChildElem( "ITEM" );
xml.IntoElem();
xml.AddChildElem( "SN", "132487A-J" );
xml.AddChildElem( "NAME", "crank casing" );
xml.AddChildElem( "QTY", "1" );
xml.Save("c:\\UserInfo.xml");
Ч¹ûÈçÏ£º
<ORDER><ITEM><SN>132487A-J</SN><NAME>crank casing</NAME><QTY>1</QTY></ITEM></ORDER>
(ËÄ) ä¯ÀÀÌض¨ÔªËØ
CMarkup xml;xml.Load("UserInfo.xml");
while ( xml.FindChildElem("ITEM") ){ xml.IntoElem(); xml.FindChildElem( "SN" ); CString csSN = xml.GetChildData(); xml.FindChildElem( "QTY"
Ïà¹ØÎĵµ£º
Paul.Todd | 09 April, 2007 15:24
I have noticed a couple of people seem to be having problems with using the XML parser in Symbian and there are no examples outside of the devkit. The parser I will be talking about is the xml one, not the one SOAP engine as the SOAP one is Nokia specific.
The ke ......
1. login_window.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/bg_logo"
>
......
JDOM ÊÇÒ»¸ö¿ªÔ´µÄ´¿java API,ÓÃÓÚ¿ìËÙ¿ª·¢ XML Ó¦ÓóÌÐò,JDOM½«XMLÎĵµ±íʾΪÊ÷£¬°üÀ¨ÔªËØ¡¢ÊôÐÔ¡¢ËµÃ÷¡¢´¦ÀíÖ¸Áî¡¢Îı¾½Úµã¡¢CDATA¶Î£¬µÈµÈ¡£JDOM¿ÉÒÔËæʱ·ÃÎÊÊ÷ÖеÄÈÎÒⲿ·Ö¡£Ê÷ÖÐËùÓв»Í¬½Úµã¾ùΪ¾ßÌåµÄÀà¡£ÔÚhttp://jdom.org¿ÉÒÔÏÂÔØJDOMµÄ×îа汾(ÎÒÕâÀïÊÇ1.0)¡£ÏÂÔغó½âѹ£¬JDOMµÄjarÎļþ¾ÍÊÇbuildÄ ......
¸ÃʵÀýÊ×ÏÈÐèÒª´´½¨Êý¾Ý¿â£¬Êý¾Ý¿âTestΨһ±ítest,¸Ã±í¾ßÓÐÈý¸öÁзֱðΪc1,c2,c3, intÐÍ£¬Çë×ÔÐн¨Á¢Êý¾Ý¿â²¢²åÈ뼸ÐвâÊÔÊý¾Ý¡£
È»ºóÎÒÃÇÏ£ÍûÄܽ«Êý¾Ý¿âÖеÄÊý¾Ý¶ÁÈ¡³öÀ´£¬ÎÒÔÚ´Ë´¦Ö»Êǽ«Êý¾Ý¿âÊý¾ÝÒÔÊý¾Ý¼¯µÄ·½Ê½´æ·ÅÔÚ±¾µØÖУ¬ ......
¡¡ ¿ÉÒÔ½«XMLÎļþµÄÊ÷(Ö»ÓÐÒ»¸ö¶¥²ã½Úµã).ÓÚÊÇÀíËùµ±È»µÄ¿ÉÒÔÓÃÊ÷×÷ΪXMLµÄÒ»ÖÖ´æ´¢½á¹¹.
ÎÒ½«ÔÚÕâÀïÓÃC++ʵÏÖ¶Ô¼òµ¥µÄXMLÎļþµÄ½âÎö.
1.Ñ¡Ôñ´æ´¢½á¹¹:
Ê÷ÐÍÊý¾Ý½á¹¹ÓжàÖÖ´æ´¢·½Ê½,ÎÒ½«ÓÃ"º¢×ÓÐֵܱíʾ·¨",¶¨ÒåÈçÏÂ:
typedef struct CSNode
{
int subNodes;
string data;
string name;
struct CSNode *fi ......