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

grails½âÎöxmlÎļþ

xmlÎļþ£º
<?xml version="1.0" encoding="iso-8859-1"?>
<Products>
    <product>
        <name>lovechoosesun</name>
        <buyNowURL>http://merch.danecook.com/ProductDetails.asp?ProductCode=DC101</buyNowURL>
        <imageUrl>http://merch.danecook.com/v/vspfiles/photos/DC101-1.jpg</imageUrl>
        <status>ACTIVE</status>
        <description>desc1</description>
        <price>12.0</price>
        <dateCreated>2009-12-30 14:07:46</dateCreated>
        <lastUpdated>2009-12-30 14:07:46</lastUpdated>
    </product>
    <product>
        <name>zhaoweisun</name>
        <buyNowURL>http://merch.danecook.com/ProductDetails.asp?ProductCode=DC101</buyNowURL>
        <imageUrl>http://merch.danecook.com/v/vspfiles/photos/DC101-1.jpg</imageUrl>
        <status>ACTIVE</status>
        <description>desc2</description>
        <price>13.5</price>
        <dateCreated>2009-12-30 14:07:46</dateCreated>
        <lastUpdated>2009-12-30 14:07:46</lastUpdated>
    </product>
</Products>
action£º
  def saveRealGifts = {
    def products = new XmlParser().parse("Products.xml"


Ïà¹ØÎĵµ£º

¼òµ¥µÄXMLÎļþ¶Áд £¨×ª£©

×¼±¸
¿ª·¢¹¤¾ß£ºVS2005£¬
Ç°Ì᣺°²×°msxml6½âÎöÆ÷£¬msÍøÕ¾¿ÉÏÂÔØ
ͨ¹ýÏòµ¼´´½¨VC++ MFC ¹¤³Ì£¬»ùÓÚ¶Ô»°¿ò
Ìí¼ÓÒýÓÃ:
//ÔÚStdAfx.hÖÐÒýÈ붯̬Á´½Ó¿â MSXML.DLL(C:\windows\system32\msxml6.dll)
#import <msxml6.dll>
±à¼­×ÊÔ´£¬Ìí¼Ó¿Ø¼þ
ÔÚbookid¶ÔÓ¦µÄÎı¾¿òÓÒ¼ü£¬Ìí¼Ó±äÁ¿°ó¶¨£¨ÈçÏÂͼ£¬°ó¶¨¿Ø¼þÖµ£¬±äÁ¿Ã ......

xml½âÎö



 
ʹÓÃSAX½âÎöºÍDOM½âÎöµÄʵÀý
ÊÕ²Ø



document.body.oncopy = function() {
if (window.clipboardData) {
s ......

Struts2.0»ùÓÚxmlÅäÖÃÎļþ¶ÔActionµÄÊôÐÔ½øÐÐУÑé

java´úÂë
package com.xml.action;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
public class XMLAction extends ActionSupport{

private static final long serialVersionUID = 1L;
private String username;
private String mobile;
public void setUs ......

Spring XMLÅäÖõÄ12¸ö¼¼ÇÉ

SpringÊÇÒ»¸öÇ¿ÓÐÁ¦µÄjava³ÌÐò¿ò¼Ü£¬Æä±»¹ã·ºÓ¦ÓÃÓÚjavaµÄ³ÌÐòÖС£ËüÓÃPOJOÌṩÁËÆóÒµ¼¶·þÎñ¡£SpringÀûÓÃÒÀÀµ×¢Èë¿ÉÒÔ»ñµÃ¼òµ¥¶øÓÐЧµÄ²âÊÔÄÜÁ¦¡£Spring beans£¬ÒÀÀµ¹Øϵ£¬ÒÔ¼°·þÎñËùÐèÒªµÄbean¶¼½«ÔÚÅäÖÃÎļþÖÐÓèÒÔÃèÊö£¬ÅäÖÃÎļþÒ»°ã²ÉÓÃXML¸ñʽ¡£È»¶øXMLÅäÖÃÎļþÈß³¤¶ø²»Ò×ʹÓã¬ÔÚÄã½øÐÐÒ»¸öʹÓÃÁË´óÁ¿beanµÄ´óÏîÄ¿ÖÐËü ......

ʹÓÃDOM4JºÍxpath½âÎöXML(¶þ)

ÔÚʹÓÃDom4j½âÎöxmlÎĵµÊ±,ÎÒÃǺÜÏ£ÍûÓÐÒ»ÖÖÀàËÆÕýÔò±í´ïʽµÄ¶«Î÷À´¹æ·¶²éѯÌõ¼þ,¶øxpathÕýÊÇÕâÑùÒ»ÖֺܱãÀûµÄ¹æÔò°É.
    ÒÔÏÂÊDZ¾ÈËÓÃдµÄÒ»¸öÀà,ժȡ²¿·Ö´úÂë;
Java´úÂë
Java´úÂë
String xmlName = path + "/" + userName + ".xml";  &n ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ