Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ : xml

ÔÚXMLÖж¨Òå²Ëµ¥

ºÍAndroid UI layoutÒ»Ñù£¬ÎÒÃÇÒ²¿ÉÒÔÔÚXMLÖж¨ÒåÓ¦ÓóÌÐòµÄ²Ëµ¥¡£Í¨¹ýÔڲ˵¥µÄonCreateOptionsMenu·½·¨ÖÐÅòÕͲ˵¥layout¡£ÕâÑù×ö»áʹÎÒÃǵijÌÐò´úÂë¼òµ¥¶àÁË£¬¶øÇÒ¾¡¿ÉÄܵĽ«¸ü¶àµÄ½çÃæÉè¼Æ²¿·Ö·Åµ½XML£¬±ãÓÚä¯ÀÀ¡£
 
1. ÔÚ¹¤³ÌµÄ/res/Îļþ¼ÐÏ´´½¨menuÎļþ¼Ð£¬ÓÃÀ´±£´æÄãΪӦÓóÌÐò¶¨ÒåµÄ²Ëµ¥XMLÎļþ¡£
Ôڲ˵¥XML layoutÖУ¬ÓÐÈý¸öÓÐЧµÄÔªËØ£ºmenu¡¢group¡¢item¡£itemºÍgroup±ØÐëÊÇmenuµÄ×ÓÔªËØ£¬ÇÒitem±ØÐëÊÇgroupµÄ×ÓÔªËØ¡£ÁíÍâµÄmenu¿ÉÒÔÊÇitemµÄ×ÓÔªËØ£¨ÎªÁË´´½¨×Ӳ˵¥£©¡£ÏÂÃæµÄXMLƬ¶ÎÏÔʾÁ˲˵¥µÄ²ã´Î¶¨Ò壺
 
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:title="Play" android:id="@+id/media_play"
  android:icon="@android:drawable/ic_media_play"/>
<item android:title="Pause" android:id="@+id/media_pause"
  android:icon="@android:drawable/ic_media_pause"/>
<item android:title="File" android:id="@+id/file">
<menu>
<item android:title="Open..." android:id="@+id/file_open"/> ......

Linq to XML customize distinct function

Definition comparer class,
class ItemComparer : IEqualityComparer<XElement>
{
public bool Equals(XElement x, XElement y)
{
return x.Attribute("Name").Value == x.Attribute("Name").Value;
}
public int GetHashCode(XElement obj)
{
return obj.Attribute("Name").Value.GetHashCode();
}
}
How to use this one to distinct:
public List<string> LoadDistrict(string region)
{
if (m_DataDoc == null)
return null;
List<string> list = new List<string>();
try
{
var query = from r in m_DataDoc.Elements("DashBoardData").Elements("LevelData").Elements("Region").Where(a => a.Attribute("Name").Value.ToLower() == region.ToLower())
select r;
foreach (var district in query.Elements("District").Distinct(new ItemComparer()))
{
......

DataSet XMl DateTable »¥×ª

/// <summary>
/// DataTable-------------------->XML --String
/// </summary>
public static String ToXmlString(DataTable dt)
{
StringWriter tr = new StringWriter();
try
{
dt.WriteXml(tr);
return tr.ToString();
}
catch
{
throw;
}
finally
{
tr.Dispose();
}
}
/// <summary>
/// DataSet----------------->XML---String
/// </summary>
public static String ToXmlString(DataSet ds)
{
StringWriter tr = new StringWriter();
try
{
ds.WriteXml(tr, XmlWriteMode.IgnoreSchema);
return tr.ToString();
}
catch
{
throw;
}
finally
......

xmlÎļþ½á¹¹

Ò»¸öXMLÎļþͨ³£°üº¬ÎļþÍ·ºÍÎļþÌåÁ½´ó²¿·Ö
1.     ÎļþÍ·
XMLÎļþÍ·ÓÉXMLÉùÃ÷ÓëDTDÎļþÀàÐÍÉùÃ÷×é³É¡£ÆäÖÐDTDÎļþÀàÐÍÉùÃ÷ÊÇ¿ÉÒÔȱÉٵģ¬¹ØÓÚDTDÉùÃ÷½«ÔÚºóÐøµÄÄÚÈÝÖнéÉÜ£¬¶øXMLÉùÃ÷ÊDZØÐëÒªÓеģ¬ÒÔʹÎļþ·ûºÏXMLµÄ±ê×¼¹æ¸ñ¡£
ÔÚÇ°ÃæµÄFlowers.xmlÎļþÖеĵÚÒ»ÐдúÂ뼴ΪXMLÉùÃ÷£º
<?xml °æ±¾ÐÅÏ¢ £¨±àÂëÐÅÏ¢£© Îĵµ¶ÀÁ¢ÐÔÐÅÏ¢ ?>
°æ±¾ÐÅÏ¢ÓÃÓÚ˵Ã÷xmlÓïÑÔÊÇÓõİ汾£¬°æ±¾Îª1.0»òÕß1.1 £ºversion="1.0"
±àÂëÐÅÏ¢ÓÃÓÚ˵Ã÷xmlµÄ±àÂëÓïÑÔ£¬Èç¹ûΪÖÐÎÄÔò±íʾΪ£ºencoding="gb2312"
Îĵµ¶ÀÁ¢ÐÔÐÅÏ¢ÓÃÓÚ˵Ã÷xmlÎļþÊÇ·ñ¿ÉÒÔ¶ÀÁ¢¶ø²»ÒÀÀµÆäËüÎĵµ£ºstandalone="yes"±íʾ¶ÀÁ¢ÏÔʾ
<?xml version="1.0" encoding="gb2312"?>
              ÆäÖУº
“<?”´ú±íÒ»ÌõÖ¸ÁîµÄ¿ªÊ¼£¬“?>”´ú±íÒ»ÌõÖ¸ÁîµÄ½áÊø£»
“xml”´ú±í´ËÎļþÊÇXMLÎļþ£»
“ version="1.0" ”´ú±í´ËÎļþÓõÄÊÇXML1.0±ê×¼£»
“ encoding="gb2312" ” ´ú±í´ËÎļþËùÓõÄ×Ö·û¼¯£¬Ä¬ÈÏֵΪUnicode£¬Èç¹û¸ÃÎļþÖÐÒªÓõ½ÖÐÎÄ£¬¾Í±ØÐ뽫´ËÖµÉè¶ ......

XML½âÎö¼¼Êõ

 XMLѧϰÍêÁË£¬ÀÏʦ˵ÔÚÃæÊÔµÄʱºòÓпÉÄÜÒªÎʵ½ÕâЩ£¬ËùÒÔÓÖÕÒÁËЩ×ÊÁÏ£¬ÔÚMLDNµÄÕâ¶ÎÈÕ×ÓÀÀÏʦÃǶ¼°Ñ¸÷¸öÃæÊÔÖÐÓпÉÄÜÒªÎʵ½µÄÎÊÌⶼ°ïÎÒÃÇÒ»Ò»×ܽᣬÕæµÄºÜ¸ÐлMLDNµÄÈ«²¿ÀÏʦ,ÏîÄ¿ÀÏʦ°ïÎÒÃÇÈÏÕæµÄ½²½âÏîÄ¿£¬¸¨µ¼ÏîÄ¿£¬½ÌѧÀÏʦ°ïÎÒÃÇÈÏÕæ×ܽá¸÷¸ö¼¼Êõ£¬¸Ðл£¬ÕæµÄÊǸÐл£¬ºÇºÇ£¬ÎÒ»áŬÁ¦¸ãºÃµÄ
JavaÖÐËÄÖÖXML½âÎö¼¼Êõ
¡¡ÔÚƽʱ¹¤×÷ÖУ¬ÄÑÃâ»áÓöµ½°Ñ XML ×÷ΪÊý¾Ý´æ´¢¸ñʽ¡£Ãæ¶ÔÄ¿Ç°ÖÖÀà·±¶àµÄ½â¾ö·½°¸£¬Äĸö×îÊʺÏÎÒÃÇÄØ£¿ÔÚÕâƪÎÄÕÂÖУ¬ÎÒ¶ÔÕâËÄÖÖÖ÷Á÷·½°¸×öÒ»¸ö²»ÍêÈ«ÆÀ²â£¬½ö½öÕë¶Ô±éÀú XML Õâ¿éÀ´²âÊÔ£¬ÒòΪ±éÀú XML Êǹ¤×÷ÖÐʹÓÃ×î¶àµÄ£¨ÖÁÉÙÎÒÈÏΪ£©¡£
¡¡¡¡Ô¤ ±¸
¡¡¡¡²âÊÔ»·¾³£º
¡¡¡¡AMD ¶¾Áú1.4G OC 1.5G¡¢256M DDR333¡¢Windows2000 Server SP4¡¢Sun JDK 1.4.1+Eclipse 2.1+Resin 2.1.8£¬ÔÚ Debug ģʽϲâÊÔ¡£
¡¡¡¡XML Îļþ¸ñʽÈçÏ£º
¡¡¡¡£¼?xml version="1.0" encoding="GB2312"?£¾
¡¡¡¡£¼RESULT£¾
¡¡¡¡£¼VALUE£¾
¡¡¡¡£¼NO£¾A1234£¼/NO£¾
¡¡¡¡£¼ADDR£¾ËÄ´¨Ê¡XXÏØXXÕòXX·X¶ÎXXºÅ£¼/ADDR£¾
¡¡¡¡£¼/VALUE£¾
¡¡¡¡£¼VALUE£¾
¡¡¡¡£¼NO£¾B1234£¼/NO£¾
¡¡¡¡£¼ADDR£¾ËÄ´¨Ê¡XXÊÐXXÏçXX´åXX×飼/ADDR£¾
¡¡¡¡£¼/VALUE£¾
¡¡¡¡£¼/ ......

phpÊý¾Ý¿âµ¼³öÀà µ¼³öJSON,XML,WORD,EXCEL

from£ºhttp://www.xland.com.cn/article/7/81/0804/28778.htm
±¾ÀàʵÏÖ£º
Êý¾Ý¿âÐÅÏ¢µ¼³ö£ºword£¬excel£¬json£¬xml£¬sql
Êý¾Ý¿â»Ö¸´£º´Ósql£¬´ÓÎļþ
¾ßÌåÓ÷¨:
Ê×ÏÈн¨²âÊÔÓÃÊý¾Ý¿âmytest£¬È»ºóÔÚÀïÃ潨Õűí
PHP´úÂë:
ÒÔÏÂÊÇ´úÂëƬ¶Î£º
--
-- ±íµÄ½á¹¹ `test`
--
CREATE TABLE `test` (
   `id` int(11) NOT NULL auto_increment,
   `name` varchar(100) NOT NULL,
   `email` varchar(200) NOT NULL,
   `age` int(3) NOT NULL,
   PRIMARY KEY   (`id`)
) ENGINE=MyISAM   DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
--
-- µ¼³ö±íÖеÄÊý¾Ý `test`
--
INSERT INTO `test` (`id`, `name`, `email`, `age`) VALUES
(1, 'pjq518', [email=]'pjq518@126.com'[/email], 22),
(2, 'xiaoyu', [email=]'xiaoyu@126.com'[/email], 21);
1.µ¼³öextÄÜ·½±ãµ÷ÓõÄjson
PHP´úÂë:
ÒÔÏÂÊÇ´úÂëƬ¶Î£º
 $db=new db();
echo  $db->toExtJson('test');
//Êä³ö½á¹ûΪ
//{'totalCount':'2','rows':[{'id':'1','name':'pjq518','email':'pjq518@126.com','ag ......

phpÊý¾Ý¿âµ¼³öÀà µ¼³öJSON,XML,WORD,EXCEL

from£ºhttp://www.xland.com.cn/article/7/81/0804/28778.htm
±¾ÀàʵÏÖ£º
Êý¾Ý¿âÐÅÏ¢µ¼³ö£ºword£¬excel£¬json£¬xml£¬sql
Êý¾Ý¿â»Ö¸´£º´Ósql£¬´ÓÎļþ
¾ßÌåÓ÷¨:
Ê×ÏÈн¨²âÊÔÓÃÊý¾Ý¿âmytest£¬È»ºóÔÚÀïÃ潨Õűí
PHP´úÂë:
ÒÔÏÂÊÇ´úÂëƬ¶Î£º
--
-- ±íµÄ½á¹¹ `test`
--
CREATE TABLE `test` (
   `id` int(11) NOT NULL auto_increment,
   `name` varchar(100) NOT NULL,
   `email` varchar(200) NOT NULL,
   `age` int(3) NOT NULL,
   PRIMARY KEY   (`id`)
) ENGINE=MyISAM   DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
--
-- µ¼³ö±íÖеÄÊý¾Ý `test`
--
INSERT INTO `test` (`id`, `name`, `email`, `age`) VALUES
(1, 'pjq518', [email=]'pjq518@126.com'[/email], 22),
(2, 'xiaoyu', [email=]'xiaoyu@126.com'[/email], 21);
1.µ¼³öextÄÜ·½±ãµ÷ÓõÄjson
PHP´úÂë:
ÒÔÏÂÊÇ´úÂëƬ¶Î£º
 $db=new db();
echo  $db->toExtJson('test');
//Êä³ö½á¹ûΪ
//{'totalCount':'2','rows':[{'id':'1','name':'pjq518','email':'pjq518@126.com','ag ......
×ܼǼÊý:815; ×ÜÒ³Êý:136; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [1] [2] [3] 4 [5] [6] [7] [8] [9] [10]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ