w3pop.com :: ÍøÂçѧԺ :: XML :: XML ·þÎñÆ÷
XML can be generated on a server without installing any XML controls.
ÎÞÐë°²×°ÈκÎXML¿Ø¼þ¾Í¿ÉÒÔÔÚ·þÎñÆ÷ÉÏÉú³ÉXMLÎļþ¡£
XML files can be stored on an Internet server exactly the same way as HTML files.
XMLÎļþÔÚInternet ·þÎñÆ÷ÉϵĴ¢´æ·½Ê½ÓëHTMLÎļþÍêÈ«Ïàͬ¡£
Start Windows Notepad and write the following lines:
´ò¿ªWindows ¼Çʱ¾£¬²¢ÊéдÏÂÃæµÄ´úÂ룺
<?xml version="1.0" encoding="ISO-8859-1"?> |
Save the file on your web server with a proper name like "note.xml".
¸øÎļþÆð¸öÇ¡µ±µÄÃû×Ö£¨È磺note.xml£©£¬²¢½«Æä±£´æÔÚÍøÂç·þÎñÆ÷ÉÏ¡£
XML can be generated on a server without any installed XML software.
ÎÞÐë°²×°ÈκÎXMLÈí¼þ¾Í¿ÉÒÔÔÚ·þÎñÆ÷ÉÏÉú³ÉXML¡£
To generate an XML response from the server - simply write the following code and save it as an ASP file on the web server:
ΪÁËÔÚ·þÎñÆ÷¶Ë²úÉúÒ»¸öXMLÏìÓ¦——Ö»Ðë¼òµ¥Ð´ÏÂÈçϵĴúÂ룬²¢ÔÚÍøÂç·þÎñÆ÷ÉϰÑËü±£´æÎªÒ»·ÝASPÎļþ
<% |
Note that the content type of the response must be set to "text/xml".
×¢Òâ»Ø¸´µÄÄÚÈÝÀàÐͱØÐëÉèÖÃΪ"text/xml"¡£
See how the ASP file will be returned from the server.
¿´¿´´Ó·þÎñÆ÷·µ»ØµÄASPÎļþÀïÓÐЩʲô.
If you don't know how to write ASP, please visit our ASP tutorial
Èç¹ûÄã²»ÖªµÀÔõôдASP,¿ÉÒÔ·ÃÎÊÎÒÃÇµÄ ASP½Ì³Ì
XML can be generated from a database without any installed XML software.
ûÓа²×°ÈκÎXMLÈí¼þ¾Í¿ÉÒÔ´ÓÊý¾Ý¿âÖвúÉúXML¡£
To generate an XML database response from the server, simply write the following code and save it as an ASP file on the web server:
ΪÁË´Ó·þÎñÆ÷µÃµ½XMLÊý¾Ý¿âÏìÓ¦£¬Ö»ÐëÊéдÏÂÊö´úÂ룬²¢ÔÚÍøÂç·þÎñÆ÷ÉϰÑËü±£´æÎªÒ»·ÝASPÎļþ¾Í¿ÉÒÔÁË£º
<% rs.MoveFirst() response.write("<?xml version='1.0' encoding='ISO-8859-1'?>")
rs.close() |
See the real life database output from the ASP file above.
¿´¿´ÉÏÊöASPÎļþÖеÄÊý¾Ý¿âµÄʵ¼ÊÊä³öÇé¿ö.
The example above uses ASP with ADO. If you don't know how to use ADO, please visit our ADO tutorial.
ÉÏÊöµÄ°¸ÀýʹÓÃÁËASP£¬²¢ÔÚASPÖÐÔËÓÃÁËADO¡£Èç¹ûÄã¶ÔADOµÄÓ÷¨»¹²»Á˽⣬¿ÉÒÔ²éÔÄÎÒÃÇµÄ ADO ½Ì³Ì¡£
ÆÀÂÛ (0)
All