ÔõôÑùÔÚÍøÒ³É϶ÁÈ¡Ô¶³ÌxmlµÄÊý¾Ý
±¾ÎÄת×Ô£ºhttp://www.10086web.com/html/wangluobiancheng/Xmlbiancheng/2009/0612/90.html
Ò»¸ö¿Í»§Ìṩһ¸ö¹É¼ÛµÄÐÅÏ¢£¬ÒªÇó·ÅÔÚÒ³ÃæÉÏ£¬ÏÔʾһЩÊý¾Ý£¬ÐèÒª´ÓÔ¶³Ì»ñÈ¡xml£¬È»ºó½âÎöдÔÚÍøÒ³ÉÏ£¬¿ªÊ¼²»»á¾õµÃºÜÄÑ£¬ÆäʵÂù¼òµ¥µÄ£¬ÏÈÓÃjavascriptдÁËÒ»¸ö£º
<mce:script language=javascript><!--
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.load("http://****.com/scripts/****.asp?subcode=C22");
nodes = xmlDoc.documentElement.childNodes;
var text = xmlDoc.selectSingleNode("//last").text
document.write(text);
// --></mce:script>
http://****.com/scripts/****.asp?subcode=C22 ,ÊÇ¿Í»§ÌṩµÄÒ³Ã棬ÆäʵÊÇxmlµÄÄÚÈÝ£¬ÕâÀïÖ±½Óµ÷ÓÃwindowsµÄ×é¼þ½øÐжÁÈ¡£¬È»ºóµ÷ÓÃÆäÖÐÒ»¸öselectSingleNodeµÄ·½·¨£¬¶Á³ölast×ֶεÄÄÚÈÝ£»
VBscriptҲдÁËÒ»¸ö£¬Æäʵ²î²»¶à£¬²»¹ýÓÐÒ»µã²»Í¬£¬aspÖÐVBµÄ²»ÄÜÖ±½Ó¶ÁÈ¡Ô¶³ÌxmlµÄÄÚÈÝ£¬ºÜÆæ¹Ö£¬²»ÖªµÀÊDz»ÊÇÓÉÓÚVBµÄÏÞÖÆ£º dim XMLMorntekDocument
Set http=Server.CreateObject("Microsoft.XMLHTTP")
http.Open "GET","http://****com/scripts/******.asp?subcode=C22",False
http.send
Set XMLMorntekDocument=Server.CreateObject("Microsoft.XMLDOM")
XMLMorntekDocument.Async=False
XMLMorntekDocument.ValidateOnParse=False
XMLMorntekDocument.Load(http.ResponseXML)
price = XMLMorntekDocument.selectSingleNode("//last").text
response.write price
Set http=Nothing
Set XMLMorntekDocument=Nothing
ÕâÀïÏÈÓÃXMLHTTPµÄ·½·¨£¬getµ½xmlÎļþ£¬È»ºóÔÙ½âÎö¡£
Ïà¹ØÎĵµ£º
/// <summary>
/// DataTable-------------------->XML --String
/// </summary>
public static String ToXmlString(DataTable dt)
{
StringWriter tr = new StringWriter();
try
{
dt.WriteXml(tr); ......
×î½üÔÚsina¿´nbaµÄÎÄ×ÖÖ±²¥µÄʱºò£¬¶ÔÍøÕ¾ÓÒϽǵÄÄÇÒ»¸öÁÄÌì´°¿Ú²úÉúÐËȤ£¬¾Í¾ö¶¨×Ô¼ºÒ²×öÒ»¸ö¡£
ÉÏÍø²é²é×ÊÁÏ£¬ÕâÑùµÄÁÄÌìÊÒÎ޷ǾÍÊÇÓû§ÊäÈëÊý¾Ý´«µ½·þÎñÆ÷±£´æ£¬È»ºóÓû§Ò³ÃæÔÙʵʱµØ´ÓÊý¾Ý¿âÈ¡³öÊý¾Ý£¬ÏÔʾÔÚÒ³ÃæÉÏ£¬¼´¿ÉÍê³ÉÒ»´ÎÁÄÌì²Ù×÷¡£
Ê×ÏÈÎÒ¶¨ÒåÁËÒ»¸öxmlÎļþ£¬ÓÃÓÚ±£´æÓû§ ......
from:
http://zhidao.baidu.com/question/67891842.html?si=1
ÏÂÃæµÄÒ»ÐоÍÊÇÔÚµÚ¶þ±¾ÊéµÄ¶¨Òå֮ǰµÄ£º
<?page render multiple authors ?>
ËäÈ»Ëü¿´ÉÏÈ¥ºÜÏñXMLÐòÑÔ£¬µ«Êµ¼ÊÉÏÊÇÒ»ÖÖ³ÆΪ´¦ÀíÖ¸Áprocessing instruction£©µÄ²»Í¬ÀàÐ͵ÄÓï·¨¡£´¦ÀíÖ¸ÁÒÔϼò³ÆPI£©µÄÄ¿µÄÊÇΪÁ˸ø´¦ÀíÒ³ÃæµÄ³ÌÐò£¨ÀýÈçXML½âÎöÆ ......
import java.io.File;
import java.io.FileNotFoundException;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
public class ResolveXmlFile {
public void resolverXml() throws DocumentException, FileNotFoundExcept ......