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

.NETÐÞ¸ÄxmlÎļþ

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using i_salesDAL;
using i_salesModels;
using i_salesBLL;
using MySql.Data.MySqlClient;
using System.Xml;
public partial class kf_total : System.Web.UI.Page
{
private XmlDocument xmlDoc;
public int gold
{
get { return V_companyManager.GetGoldNum(); }
}
public int silver
{
get { return V_companyManager.GetSilverNum(); }
}
public int AA
{
get { return V_companyManager.GetAANum(); }
}
public int B
{
get { return V_companyManager.GetBNum(); }
}
public int C
{
get { return V_companyManager.GetCNum(); }
}
public int D
{
get { return V_companyManager.GetDNum(); }
}
protected void Page_Load(object sender, EventArgs e)
{
UpdateElement();
lblcount.Text = "¹²ÓÐÊý¾Ý:"+(gold+silver).ToString()+"Ìõ";
}
//load xml fileÁ¬½Óxml
private void LoadXml()
{
xmlDoc = new XmlDocument();
xmlDoc.Load(Server.MapPath("pie.xml"));
}
//ÐÞ¸Äxml½ÚµãÀïÊôÐÔÖµ
private void UpdateElement()
{
LoadXml();
XmlNodeList nodeList = xmlDoc.SelectSingleNode("pieData").ChildNodes;//»ñÈ¡pieData½ÚµãµÄËùÓÐ×Ó½Úµã
foreach (XmlNode xn in nodeList)//±éÀúËùÓÐ×Ó½Úµã
{
XmlElement xe = (XmlElement)xn;//½«×Ó½ÚµãÀàÐÍת»»ÎªXmlElementÀàÐÍ
//gold
if (xe.GetAttribute("color") == "FFFF00")//Èç¹ûcolorÊôÐÔֵΪ“gold”
{
//xe.SetAttribute("color", "");
//Èç¹ûÏÂÃæÓÐ×Ó½ÚµãÔÚÏÂ×ß
XmlNodeList nls = xe.ChildNo


Ïà¹ØÎĵµ£º

JavaµÄXMLÎļþ²Ù×÷Ö®DOMÈëÃÅÆª £¨3£©

2£®DOMʵÀý
ÓÐÁËÉÏÃæµÄ½éÉÜ£¬ÏàÐÅÄã¶ÔDOMÀí½âµÄ¸ü¶àÁ˰ɡ£ÏÂÃæµÄÀý×Ó½«ÈÃÄã¶ÔDOM¸ü¼ÓÊìϤÆðÀ´¡£
ÏÈ˵˵Õâ¸öÀý×Óµ½µ×Òª×öµÄÊÇʲô°É£¬ÎÒÃÇÏ£ÍûÔÚÒ»¸öÃûΪlink.xmlÎļþÖб£´æÁËһЩURLµØÖ·£¬Í¨¹ýÒ»¸ö¼òµ¥µÄ³ÌÐò£¬ÎÒÃÇ¿ÉÒÔͨ¹ýDOM°ÑÕâЩURL¶Á³ö²¢ÏÔʾ³öÀ´£¬Ò²¿ÉÒÔ·´¹ýÀ´ÏòÕâ¸öXMLÎļþÖÐдÈë¼ÓÈëµÄURLµØÖ·¡£ºÜ¼òµ¥£¬È´ºÜÊµÓ ......

Struts 2 ʹÓÃXMLÎļþУÑé½Ì³Ì

Struts 2 ʹÓÃXMLÎļþУÑéÀýÌâ
ÔÚÕâ¸öÀý×ÓÖÐÎÒÃǽ«Á˽⵽ÔõôÑùͨ¹ýXMLÎļþÀ´½øÐÐУÑé¡£XMLУÑéÎļþ±ØÐëÒÔ"¶¯×÷(action)Àà-Validation.xml"µÄÐÎʽÃüÃû¡£ÔÚÕâ¸öÀý×ÓÖУ¬¶¯×÷(action)ÀàÃûÊÇ"Login.java"£¬XMLÎļþÃûÊÇ"Login-Validation.xml"¡£
Login-validation.xmlµÄÎļþÄÚÈÝÈçÏ£º
<!DOCTYPE validators PUBLIC "-//O ......

xml²Ù×÷

Ìí¼Ó¼Ç¼µ½ds±£´æµ½xml            
DataSet ds = new DataSet("myDs");
            //´ÓXMLÖжÁÈ¡Êý¾Ý
            ds.ReadXml(Serve ......

ʹÓÃkxml½âÎöxmlÎļþ(Ò»)

Õâ¸öÊDzÎÕÕibmÍøÕ¾ÉϵÄÎÄÕÂ×öµÄ¡£
xmlÔ´Îļþ£º
<?xml version="1.0"?>
<!DOCTYPE rss PUBLIC
"-//Netscape Communications//DTD RSS 0.91//EN"
"http://my.netscape.com/publish/formats/rss-0.91.dtd"
>
<rss version="0.91">
<channel>
<title>Meerkat: An Open2 Wire Servic ......

ʹÓÃkxml½âÎöxmlÎļþ(¶þ)

Ò». ²»Í¬XML¸ñʽÉϵIJîÒì
<Bil BilID="09120005">
<Product PID="XS000-3">
<Package Needuan="10"/>
<Package Needuan="8"/>
</Product>
</Bil>
 
Óë
<channel>
<title>Meerkat: An Open2 Wire Service</title>
<link>http://meerkat. ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ