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

.netÖУ¬¶ÁÈ¡XMLÔÚÒ³ÃæÏÔʾ£¬²¼¾ÖÓÃRepeater¿Ø¼þ

 public static IList<News> GetAllNews()
        {
            XmlDocument xdoc = new XmlDocument();
            xdoc.Load("Äã¶ÁÈ¡µÄµØÖ·£ºÀýÈ磺http://www.123.com/ok/a.xml");
            IList<News> news = new List<News>();
            XmlNode root = xdoc.DocumentElement;
           
            foreach (XmlNode node in root.ChildNodes)
            {
                if (node.Name == "match")
                {
                    foreach (XmlNode childNode in node.ChildNodes)
                    {
                        if (childNode.Name == "m")
                        {
                            News n = new News();
                            foreach (XmlNode childElement in childNode.Ch


Ïà¹ØÎĵµ£º

¹ØÓÚdom4j¡¢domÈçºÎÇåÀíÄÚ´æÖÐÒѾ­¼ÓÔصÄxmlÊ÷

Ä¿Ç°ÔÚʹÓÃDOMºÍdom4j¶ÔXMLÎļþ½øÐÐÔöɾ¸Ä²é£¬Èç¹ûÎÒÔÚͬһ¸öÏß³ÌÖÐ×ö¶à´ÎÔöɾ¸Ä²Ù×÷£¬ÈçºÎ±£Ö¤DOMÄÚ´æͬ²½ºÍÎïÀíÎļþͬ²½£¿ÓÖÈçºÎÇåÀíÔÚÄÚ´æÖÐÒѼÓÔصÄÊý¾Ý£¿
ÎÊÌâ²¹³ä£º
Äã˵µÄÕâÖÖ¾ÍÊǺܵ¥´¿µÄÔÚÒ»¸öÏß³ÌÖÐÖ´ÐÐËùÓеIJÙ×÷£¬Èç¹ûÎÒÊÇÔÚµ¥Ïß³ÌÖвÙ×÷£¬Ã¿×öÒ»´ÎÔöɾ¸Ä²éµÄÒ»ÖÖ£¬ÎÒ¶¼Òª±£´æµ½ÎļþÖÐÈ¥£¬È磺
µÚÒ»´Î£ºÔö¼ ......

SAX½âÎöXML(Ô´´úÂ룩

package book.xml;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Stack;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.Default ......

xml¡¢xsdºÍxslÖ®¼äµÄ¹ØϵºÍʹÓÃʵÀý

¼òµ¥µØ˵£¬xslÊÇ˵Ã÷xmlÈçºÎ±í´ï³öÀ´µÄÑùʽÎļþ£¬¶øxsd¸ø³öxmlÎļþµÄ¸ñʽÃèÊö
Èç¹û˵xmlÊÇÒ»µþ³®Æ±£¬xsd¾ÍÊÇÑé³®»ú£¬¿´¿´ÀïÃæÓÐûÓмٳ®£¬¶øxslÊǵ㳮»ú£¬¿´¿´µ½µ×ÊǶàÉÙÇ®¡£ÓÃxml¿ÉÒÔ²»ÓÃxsd£¬¾ÍÏñ»¨Ç®µÄʱºò²»Ò»¶¨ÒªÑé³®Ò»Ñù£¬µ«ÊÇÊÕÇ®µÄÈËÒ»°ãÊÇÏëÒªÑéµÄ¡£¶ø»¨Ç®µÄʱºò²»Äܲ»µã³®£¬²»µãÄǾͲ»ÊÇ»¨Ç®ÁË£¬ÊÇÍæÇ®¡£µ±È»ÁË£ ......

xml ¶Áд

¶Á£º
//´ò¿ªÄ³Îļþ(¼ÙÉèweb.configÔÚ¸ùĿ¼ÖÐ)
string filename=Server.MapPath("/") + @"WebApplication1\web.config";
XmlDocument xmldoc= new XmlDocument();
xmldoc.Load(filename);
//µÃµ½¶¥²ã½ÚµãÁбí
XmlNodeList topM=xmldoc.DocumentElement.ChildNodes;
foreach(XmlElement element in topM)
{
if(ele ......

½áºÏ·´ÉäÓë XML ʵÏÖ Java ±à³ÌµÄ¶¯Ì¬ÐÔ

·´ÉäÊÇ Java ÓïÑÔ±»ÊÓΪ¶¯Ì¬»ò×¼¶¯Ì¬ÓïÑÔµÄÒ»¸ö¹Ø¼üÐÔÖÊ£¬½áºÏ·´ÉäºÍ XML »á°ïÖúÎÒÃǸü¿ì¡¢¸ü·½±ãµØʵÏÖһЩ¶¯Ì¬´úÂ룬´Ó¶ø½â¾ö±à³ÌÖпÉÄÜÓöµ½µÄ²»È·¶¨ÎÊÌâ¡£±¾ÎĽ«½áºÏ·´ÉäÓë XML ¶Ô Java ±à³ÌµÄ¶¯Ì¬ÐÔ½øÐÐÉîÈëdz³öµÄÌÖÂÛ¡£ÔÚÀí½â±¾ÎĵÄ˼ÏëÖ®ºó£¬Äú¿ÉÒÔ½«ÆäÓ¦Óõ½³ÌÐòÖÐÒÔ´´½¨Áé»îµÄ´úÂë¡£
ÒýÑÔ
ÔÚÏÖʵÉú»îÖУ¬¾­³£»á·¢ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ