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

AndroidÅÄÕÕÉÏ´«³ÌÐòµÄxmlÅäÖÃÎļþ

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"
>
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip"
android:text="@string/user_name"
/>
<EditText
android:id="@+id/username"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip"
android:scrollHorizontally="true"
android:autoText="false"
android:text="user"
android:capitalize="none"
android:gravity="fill_horizontal"
android:textAppearance="?android:attr/textAppearanceMedium"
/>
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip"
android:text="@string/user_passwd" />

<EditText android:id="@+id/userpasswd"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip"
android:scrollHorizontally="true"
android:autoText="false"
android:text="user"
android:capitalize="none"
android:gravity="fill_horizontal"
android:password="true"
android:textAppearance="?android:attr/textAppearanceMedium" />
<CheckBox android:id="@+id/cbx_cmwap"
android:text="CMWAP"
android:checked="false"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip"
android:layout_width="wrap_content"
android:layout_height="wrap_conten


Ïà¹ØÎĵµ£º

ʹÓÃ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> ......

XML ³£Ó÷½·¨¼¯

ÏÂÃæµÄ±í¸ñÁгöÁ˰üº¬ÔÚDOM Level 1Öеķ½·¨£¬²¢Áгö²»Í¬µÄä¯ÀÀÆ÷ÊÇ·ñÖ§³ÖÏî¡£
·½    ·¨
Ãè    Êö
IE
MOZ
OP
SAF
createAttribute
(name
)
Óøø¶¨Ãû³Æname
´´½¨ÌØÐÔ½Úµã
×
×
×
£­
createCDATASection
(text
)
Óðüº¬Îı¾
text
µÄÎı¾×Ó½Úµã
´´½ ......

ÓÃCMarkUpÀà½âÎöXMLÎļþ

½âÎö£º
 CMarkup xml;
 CString strChanText, strChanType;
 xml.Load("MyXml.xml");
 xml.ResetMainPos();
 if (!Chan.FindElem("TreeOrg"))
 {
      return;
 }
 if (xml.IntoElem())
 {
      xml.FindEle ......

ΪʲôʹÓà XML£¿


Web ʹÎÒÃÇÄܹ»ÓëÈκεط½µÄÈκÎÈËͨѶ¡£¹ã·º½ÓÊܵıê×¼£¨Õâ¶ÔÍêȫʹÓà Web µÄDZÁ¦ÊÇÖÁ¹ØÖØÒªµÄ£©ÔÊÐí Web ÔÚ¶àÖÖ½»»¥²Ù×÷µÄ¼¼Êõ²ãÉÏͨѶ¡£Ò»¸öÖØÒª²ãÊÇ¿ÉÊÓ»¯ÏÔʾºÍÓû§½çÃæ£¬ÀýÈç HTML¡¢GIF ºÍ JScript(TM) Ö®ÀàµÄÏÖÓбê×¼¡£ÕâЩ±ê×¼ÔÊÐí´´½¨Ò»´ÎÒ³Ãæ£¬²¢ÇÒÔÚ²»Í¬Ê±¼äÏòÖÚ¶à½ÓÊÕÕßÏÔʾ¡£
¾¡¹Ü¿ÉÊÓ»¯ºÍÓû§½çÃæ±ê×¼ÊÇ±Ø ......

How to parse XML file using CParser class


Reviewer Approved    
The following example shows how to parse XML file using Symbian OS C++ class, CParser. CParser is basically a SAX (Simple API for XML)-based XML parser.
It uses an active object to read the XML file chunk by chunk (see CXmlHandler::StartParsingWithAoL( ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ