C#ÏÔʾXMLÔªËØÄÚÈݵļòµ¥Àý×Ó
½ÓÉÏһƪ
ÏÔʾËùÓнáµãµÄÄÚÈÝ
1 ÔxmlÎļþ bookstore.xml
<?xml version="1.0" encoding="gb2312"?>
<bookstore>
<book ISBN="1234123">
<title>who am i </title>
<author>who</author>
<price>999</price>
</book>
<book>
</book>
</bookstore>
2 program.cs
using System;
using System.Xml;
namespace ReadXml
{
class Class1
{
static void Main(string[] args)
{
//ʵÀý»¯Ò»¸öXmlDocument¶ÔÏó
XmlDocument xmlDoc = new XmlDocument();
//ʵÀý¶ÔÏó¶ÁȡҪдÈëµÄXMLÎļþ
xmlDoc.Load("bookstore.xml");
XmlNode xn = xmlDoc.SelectSingleNode("bookstore");
XmlNodeList xnl = xn.ChildNodes;
foreach (XmlNode xnf in xnl)
{
XmlElement xe = (XmlElement)xnf;
//¸ÃÊôÐÔûÓУ¬²»ÏÔʾ£¬µ«²»»á±¨´í
Console.WriteLine(xe.GetAttribute("genre"));
//ÏÔʾÊôÐÔÖµ
&nb
Ïà¹ØÎĵµ£º
1¡¢mian.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute" creationComplete="HTTPSrv.send();" width="242" height="442">
<mx:Script>
<!--[CDATA[
import mx.rpc.events.ResultEv ......
ÒÔÏÂΪһÌìµÄ»ù±¾Ñ§Ï°Çé¿ö£¬°üÀ¨Ñ§Ï°ºÍ¸´Ï°£¬Ä£Ê½²¿·ÖÇ°Ç°ºóºóÒ²¿´Á˺ܶàÁË£¬µ«ÊÇһֱûÄܼá³Ö¿´Í꣬ϣÍûÕâ´Î¿ÉÒÔ¼á³ÖÏÂÈ¥¡£
ģʽ²¿·ÖÎÒûÓÐÖ±½ÓÈ¥¿´±È½Ï¾µäµÄ¡¶javaÓëģʽ¡·£¬ÕâÊéÌ«ºñÈÝÒ×ÈÃÎÒ¼á³Ö²»ÏÂÈ¥£¬¶øÊDzÉÓÃÁ˳̽ÜдµÄ¡¶´ó»°Éè¼Æģʽ¡·£¬
ÕâÊéдµÄºÜÓÐÒâ˼£¬Ò²ºÜÈÝÒ×Àí½â¡£Ï£ÍûÕâÑùµÄÊé¿ÉÒÔ¶àЩ¡£ºÇºÇ£¬µ±È»µÈ¿´ ......
ZT:http://www.mobpub.net/archiver/?tid-28.html
Symbianѧϰ±Ê¼Ç(15)——½âÎöXMLÎļþ(ÉÏ)
½ñÌìÏë·ÖÏíµÄÊÇÈçºÎÔÚSymbianƽ̨ÉϽâÎöXMLÎļþ£¬²»ÐèÒªµÚÈý·½µÄ¶«Î÷£¬SymbianÒѾΪÎÒÃÇÌṩÁËÕâ¸öÀàCParser¡£
ÍøÉÏÒ²ÓÐÕâ·½ÃæµÄ×ÊÁÏ£¬½¨Òé²Î¿¼£º
[url]http://wiki.forum.nokia.com/index.php/How_to_parse_XML_fi ......
Ïêϸ½éÉÜFlexÖвÙ×÷XML(ÉÏ)
2009Äê12ÔÂ30ÈÕ ÐÇÆÚÈý 12:05
Ò» ÔÚ½éÉÜFlexÖвÙ×÷XML֮ǰ£¬Ê×Ïȼòµ¥½éÉÜÏÂXMLÖеĻù±¾ÊõÓï¡£
ÔªËØ£ºXMLÖÐÓµÓпªÊ¼±êÇ©ºÍ½áÊø±êÇ©µÄÕâÒ»¿é³ÆΪ“ÔªËØ”
½Úµã£º°ÑXMLÔªËØÓëÎı¾½áºÏÆðÀ´Í³³ÆΪ½Úµã
¸ù½Úµã£ºÎ»ÓÚÕû¸öXMLÎÄ ......
Ò»£ºÉè¼Æģʽ²¿·Ö
״̬ģʽ£¨state£©
״̬ģʽÀàËÆÓÚÒ»ÖÖ¼òµ¥µÄ¹¤×÷Á÷£¬ÓÃÀ´°Ñ´óÁ¿µÄÅжϷÖÖ§½øÐвð·Ö£¬¸øÿһÖÖÅжÏÔö¼ÓÒ»¸ö״̬£¬Èç¹û²»Âú×ã¸ÃÅжϿÉÒÔ½øÐÐ״̬ת»»£¬ÖªµÀÓöµ½Âú×ãÌõ¼þΪֹ
ÕâÑù×öµÄºÃ´¦¾ÍÊÇ£¬µ±ÐèÒªÔö¼ÓÅжϵÄʱºò£¬²»ÐèÒª¸Ä±äÒѾ´æÔڵĴúÂë¡£Ö»ÐèÒªÔö¼ÓÅжϵÄÀ࣬ÔʼÅжÏÀàÖÐÔö¼ÓеÄ״̬ת»»¡£
Ê ......