²ËÄñÇóÖú¹ØÓÚjava½âÎöxmlµÄÎÊÌâ - Java / JavaÏà¹Ø
СµÜ¸Õѧϰjava½âÎöxml£¬Óöµ½Ò»Ð©ÎÊÌ⣬ϣÍûµÃµ½¸ßÊֵİïÖú£¬²»Ê¤¸Ð¼¤£¡£¡
¶ÔÓÚÒ»°ã¹Ì¶¨µÄ±êÇ©¸ñʽ£¬Ð¡µÜ¿ÉÒÔ½âÎö¡£ÀýÈ磺
Department.xml
<?xml version="1.0" encoding="gb2312"?>
<?xml-stylesheet type="text/xsl" href="Department.xsl"?>
<department>
<depname>
<Zh>´ó´ó·¢</Zh>
<En>BigandRich</En>
</depname>
<depadress>¹ãÖÝÊÐÖÐɽÈý·</depadress>
<depInfo>¾ÓªÁ¸ÓÍ´óÃ×ʳƷ</depInfo>
</department>
½âÎöjavaÎļþ£ºDepartmentInfo.java
import java.io.IOException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.*;
import org.xml.sax.SAXException;
public class DepartmentInfo
{
public static void main(String [] args)
{
//»ñµÃÒ»¸ö¹¤³§ÀàµÄʵÀý
DocumentBuilderFactory bdf =DocumentBuilderFactory.newInstance();
try
{
//»ñµÃ½âÎöÆ÷·â×°µÄDOM½âÎöÆ÷
DocumentBuilder db=bdf.newDocumentBuilder();
//Ö¸¶¨Òª·ÖÎöµÄxmlÎĵµ
File f=new File("Department.xml");
//»ñµÃxmlÎĵµµÄ¶ÔÏó
Document dep=db.parse(f);<
Ïà¹ØÎÊ´ð£º
µ±ÖªµÀÒ»¸öÈÕÆÚ£¬ÈçºÎ°ÑÕâ¸öÈÕÆÚËùÔÚÑ®µÄǰºóÁ½¸öÈÕÆÚÈ¡³ö
±ÈÈçÊäÈë20090905£¬¾ÍÊäÈë20090901 20090910
Êä³ö20090901 20090910
È¡µÃÌìÊýºó×÷Ò»ÏÂÅжÏÔÙ°ÑÕâ¸ö·½·¨ÓÃÏÂvoid set(int field, int value)
......
txt ºÍXML ¸ñʽÏàÓ¦
²»½èÖúDataSet
µ¼Èë¶ÁÈ¡TXTÎļþ
È»ºóÖ±½ÓдÈëXML(ͬһÎļþ,²»Í¬Êý¾Ý,µÝÔöÔÊý¾ÝûÓб»¸²¸ÇÇé¿öÏÂÔö¼ÓÊý¾Ý.)
½Ì¸öÒªµã»ò×îºÃÊÇÓиö´úÂëÌáʾµÄ
¹ý·ºÃºº °ï¸öæÈö^^
²»»á£¬°ïÂ¥Ö÷ ......
JSPÒ³ÃæÖÐÓжà¸öradio°´Å¥
JSPÒ³Ãæ½«²ÎÊýPOST¸øservlet
ÒªÇóÈçÏÂ;
1.Ñ¡ÔñÒ»¸öradio£¬µ÷ÓÃservlet servletÖиù¾Ý²ÎÊýµ÷ÓÃÆäËû½Ó¿Ú£¬³ý·ÇÑ¡ÖиÃradio²¢µã»÷JSPÖеÄʵР......
<?xml version="1.0" encoding="utf-8" ?>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical&q ......
×î½üÒ»¸öÏîÄ¿ÖÐÓöµ½Ò»¸öÎÊÌ⣺ÔÚÔÓеÄÒ»Ì×ϵͳÖÐ(php¿ª·¢)Ìí¼ÓһЩС¹¦ÄÜ(jsp¿ª·¢)£¬ÔÀ´Óû§ÏµÍ³¶¼ÊÇphp¿ª·¢µÄ£¬ÎÒÈçºÎÔÚjsp¿ª·¢µÄ¹¦ÄÜÖÐ×öµ½Óû§ÐÅÏ¢sessionͬ²½ÄØ£¿ ÓÐÈËÊÇ·ñÓÐ×ö¹ýÀàÒÔÏîÄ¿£¬ÏëÌýÌý´ó¼ÒµÄ¿´·¨
......