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

ÓÃXmlReader È¡xmlÎļþ½ÚµãµÄÖµ

ÔÚÏîÄ¿ÖУ¬Í¬Ò»¸öÅäÖÃÔÚ²»Í¬µÄĿ¼ÏÂÒªÓв»Í¬µÄÖµ£¬¶øÄ¿Â¼ÓÖÊDz»È·¶¨µÄ£¬Õâʱ¾ÍÐèÒª½«ÅäÖÃÐÅÏ¢´æ·ÅÔÚÏàÓ¦µÄĿ¼ÖУ¬ÔÚÔËÐÐʱ¸ù¾Ý·¾¶È¥È¡
·½·¨£ºÓÃxmlÎļþ´æ´¢£¬·ÅÔÚʹÓÃĿ¼Ï£¬ÓÃÏÂÃæ·½·¨»ñÈ¡ÅäÖÃÐÅÏ¢
public class yzzConfig
{
/// <summary>
/// »ñÈ¡XmlÎļþÅäÖÃÐÅÏ¢
/// </summary>
/// <param name="node">½ÚµãÃû</param>
/// <param name="path">Îļþ·¾¶</param>
/// <returns></returns>
public static string AppSettings(string node, string path)
{
string result = string.Empty;
try
{
//XmlReaderSettings settings = new XmlReaderSettings();
//settings.IgnoreComments = true;
//settings.IgnoreProcessingInstructions = true;
//settings.IgnoreWhitespace = true;

using (XmlReader reader = XmlReader.Create(path))//, settings))
{
reader.MoveToContent();
while (reader.Read())
{
if (reader.NodeType == XmlNodeType.Element && reader.Name == node)
{
result = reader.ReadInnerXml();
break;
}
}
reader.Close();
}
}
catch (Exception ex)
{
throw ex;
}
return result;
}
}
XMLÎļþʾÀý
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<yzzSettings>
<xmlxslt>test</xmlxslt>
</yzzSettings>
<configSections>

µ÷ÓÃʾÀý
protected void Button1_Click(object sender, EventArgs e)
{
Response.Write(yzzConfig.AppSettings("xmlxslt", string.Format("{0}\\yzzconfig.xml",
Request.Ph


Ïà¹ØÎĵµ£º

ÓÃjdomÀ´½âÎöxmlÎļþ

xmlÎļþ£º
<?xml version="1.0" encoding="UTF-8"?>
<mobile-list>
<mobile type="Nokia2652">
<wap2>false</wap2>
<width>115</width>
</mobile>
<mobile type="Nokia2650">
......

ASP.NET ÑÝÁ·£º´´½¨ÍøÒ³ÒÔÏÔʾ XML Êý¾Ý


Êý¾Ýͨ³£ÊÇÒÔ XML ¸ñʽÌṩ¸ø Web Ó¦ÓóÌÐòµÄ¡£µ«ÊÇ£¬XML Êý¾Ý±¾ÖÊÉÏÊÇ·Ö²ãµÄ£¬Òò´ËÄú¿ÉÄÜÏ£ÍûÄܹ»ÔÚ»ùÓÚÁбíµÄ¿Ø¼þÖÐʹÓà XML Êý¾Ý£¬Èç GridView »ò DropDownList ¿Ø¼þ¡£´ËÑÝÁ·ÑÝʾÈçºÎ½« XML Êý¾ÝÊÓΪ±í¸ñÊý¾Ý¿â±íÖеÄÊý¾Ý½øÐд¦Àí¡£
 
ͨ¹ý´ËÑÝÁ·£¬Äú½«Ñ§»áÈçºÎÖ´ÐÐÒÔÏÂÈÎÎñ£º
·Ê¹ÓÃÊý¾ÝÔ´¿Ø¼þ¶ÁÈ¡ XM ......

phpÖ®XMLתÊý×麯Êý

<?
/**
* xml2array() will convert the given XML text to an array in the XML structure.
* Link: http://www.bin-co.com/php/scripts/xml2array/
* Arguments : $contents - The XML text
* $get_attributes - 1 or 0. If this is 1 the function will get the attributes as well as the ......

¸ñʽ»¯XMLÊä³ö

ËäÈ»XMLÉè¼ÆµÄ³õÖÔÊÇΪÁË·½±ã»úÆ÷Ö®¼äµÄ½»»¥£¨interoperability£©£¬¶øÐèÒªÂú×ã»úÆ÷¿ÉÔĶÁ£¨machine readable£©µÄÌØÐÔ¡£È»¶ø£¬ÓÉÓÚ³ÌÐòԱΪÁË·½±ã¿ª·¢£¬¼ÈÈ»XMLÊÇͨ¹ýÎı¾±íʾµÄ£¬²»ÈçÔÙÇ¿»¯Ò»Ð©£¬×öµ½ÈËÀà¿ÉÔĶÁ£¨human readable£©°É¡£XML¾¿¾¹ÊÇÄÄÖÖ¿ÉÔĶÁµÄÌÖÂÛÒѾ­ÊÇÀÏÉú³£Ì¸ÁË£¬ÕâÀï²»»áÉîÈë̽ÌÖ£¬Ö»ÊǽèÖúÕâ¸ö»ú»á½éÉÜÒ ......

jdom¶ÔxmlÎļþµÄ¶Áд²Ù×÷

jdom¶ÔxmlÎļþµÄ¶Áд²Ù×÷
1.         ¶ÁÈ¡XMLÎļþJavaÔ´´úÂ룺
1)        xmlÎļþ£º
<?xml version="1.0" encoding="gb2312"?>
<messages>
    <message id="1">
       < ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ