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

°ÑXMLDocumentת»»³Éxml×Ö·û´®

XMLDocumentÀàÌṩÁ˷ḻµÄÊôÐԺͷ½·¨£¬¿ÉÒÔ°ïÖúÎÒÃÇÇáËÉÍê³ÉxmlµÄ±à¼­¡£µ«ÊÇ£¬Íê³ÉºóµÄxmlºÜ¶àÇé¿öÏ¿ÉÄÜ»¹ÊÇÐèÒªÒÔ×Ö·û´®ÐÎʽ´«µÝ¡£XMLDocumentÓиöSave·½·¨£¬²»½ö¿ÉÒÔ±£´æXMLÎļþÖÁ´ÅÅÌ£¬»¹Äܽ«Æä±£´æÖÁÖ¸¶¨µÄÁ÷£¬È»ºó£¬¾ÍÄÜ´ÓÕâ¸öÁ÷£¨stream£©¶ÁÈ¡ËùÐèÒªµÄ×Ö·û´®ÁË¡£
XmlDocument doc = new XmlDocument();
...
...//Éú³ÉxmlµÄ´úÂë
ʵÀý»¯Ò»¸öÁ÷£¬²¢½«Éú³ÉµÄXMLDocument±£´æÔÚÆäÖУº
MemoryStream stream = new MemoryStream();
XmlTextWriter writer = new XmlTextWriter(stream, null);
writer.Formatting = Formatting.Indented;
doc.Save(writer);
ÉùÃ÷Ò»¸öStreamReader£¬ÓÃÓÚ¶ÁÈ¡¸Õ²ÅÄǸöStreamÖеÄÊý¾Ýµ½Ò»¸ö×Ö·û´®±äÁ¿
StreamReader sr = new StreamReader(stream, Encoding.UTF8);
stream.Position = 0;
string XMLString = sr.ReadToEnd();
sr.Close();
stream.Close();
********


Ïà¹ØÎĵµ£º

Struts2Êä³öXML¸ñʽµÄResult

À©Õ¹Struts2--×Ô¶¨ÒåStringºÍXML¸ñʽµÄResult 



struts2ËäÈ»¼Ì³ÐÁËwebworkÓÅÐãµÄMVC·ÖÀ룬¿ÉÊÇÓÐºÜ¶àµØ·½ÈÃÈ˰Ù˼²»µÃÆä½â£¡×îÈÃÈËÀëÆ×µÄÊÇ£¬·µ»ØµÄ½á¹û¼¯ÖоÓȻûÓÐ
String£¬xmlÕâÁ½Öַdz£³£ÓõÄÀàÐÍ¡£»¹ÊÇ×Ô¼º¶¯ÊÖ£¬·áÒÂ×ãʳ£º
µÚÒ»ÖÖ·½Ê½£ºÊ¹ÓÓPlainText Result”
 & ......

Android£¨Èý£©Êý¾Ý´æ´¢Ö®XML½âÎö¼¼Êõ

½ñÈÕ¼ÌÐøÑ§Ï°AndroidÖÐʹÓÃPullµÄXML½âÎö¼¼ÊõʵÏÖ¶ÔXMLÎļþµÄ½âÎöºÍ´´½¨¡£ÓÉÓÚÃ÷ÌìÐÝÏ¢£¬Ê±¼ä±È½Ï³äÔ££¬ËùÒÔÎÒÒ²½«×òÌìδ×ܽáµÄSAX½âÎö¼¼ÊõÔÚ´Ë×ö¸ö×ܽᡣ
Ò»¡¢SAX½âÎö¼¼Êõ
SaxʹÓõÄÊÇʼþÇý¶¯µÄÁ÷ʽ½âÎö¼¼Êõ¡£Ê¼þÇý¶¯µÄÁ÷ʽ½âÎö·½Ê½ÊÇ£¬´ÓÎļþµÄ¿ªÊ¼Ë³Ðò½âÎöµ½ÎĵµµÄ½áÊø£¬²»¿ÉÔÝÍ£»òµ¹ÍË¡£µ±½âÎöµ½ÎĵµµÄ¿ªÊ¼»ò½áÊø¡ ......

XMLÈ¡½ÚµãÃû³ÆÓë½ÚµãֵʵÀý

declare @x xml
set @x='
<ROOT>
  <SM>
  <SMID>88</SMID>
  <SMCD>A5</SMCD>
  <SMNM>ÁõÑó</SMNM>
  <NDS>
  <ND>
  <SF>3</SF>
  <NDID>88</NDID>
  <NDCD>A5< ......

GridView ²Ù×÷XMLÎļþ

<?xml version="1.0" standalone="yes"?>
<imgs>
<pic name="/adv_pic/1.jpg" url="http://www.baidu.com/" title="test" />
<pic name="/adv_pic/2.jpg" url="http://www.baidu.com/" title="test" />
......

Parsing XML from the Net Using the SAXParser


Parsing XML from the Net - Using the SAXParser
http://www.anddev.org/parsing_xml_from_the_net_-_using_the_saxparser-t353.html
What you learn:
You will learn how to properly parse XML
(here: from the net
) using a SAXParser
.
What it will look like:
Description:
0.)
In this tutorial we ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ