易截截图软件、单文件、免安装、纯绿色、仅160KB

xml和java Bean的直接转换,Xmap

package test;
import java.util.ArrayList;
import java.util.List;

import org.nuxeo.common.xmap.annotation.XNode;
import org.nuxeo.common.xmap.annotation.XNodeList;
import org.nuxeo.common.xmap.annotation.XObject;


/**
* Book 实体对象,此处用XMap注解
* @author Administrator
*
*/
@XObject
public class Book {
@XNode("title")
private String title;

@XNode("@no")
private String no;

@XNodeList(value = "subject", type = ArrayList.class, componentType = String.class)
private List<String> subjects;

@XNode("price")
private int price;

public String getTitle() {
return title;
}

public void setTitle(String title) {
this.title = title;
}

public List<String> getSubjects() {
return subjects;
}

public void setSubjects(List<String> subjects) {
this.subjects = subjects;
}

public int getPrice() {
return price;
}

public void setPrice(int price) {
this.price = price;
}

public String getNo() {
return no;
}

public void setNo(String no) {
this.no = no;
}
}
/**==================================================**/
package test;
import java.util.ArrayList;
import java.util.List;

import org.nuxeo.common.xmap.annotation.XNodeList;
import org.nuxeo.common.xmap.annotation.XObject;

/**
* 图书对象集合类
* @author zhouyu
*
*/
@XObject(value = "books")
public class Books {
@XNodeList(value = "book", type = ArrayList.class, componentType = Book.class)
private List<Book> book;

public List<Book> getBook() {
return book;
}

public void setBook(List<Book> book) {
this.book = book;
}

public void ad


相关文档:

Java 字符串,byte[],16进制的字符串互转

在调试的时候,如果要显示byte的值是否与预期一致,一般转换为16进制的字符串,或者使用base64转换后,然后显示出来。
/**
* 字符串转换成十六进制字符串
*/
public static String str2HexStr(String str) {
char[] chars = "0123456789ABCDEF".toCharArray();
StringBuilder sb = new StringBuilder(""); ......

数据库查询XML结构,FOR XML PATH 语句的应用


/*
数据库查询XML结构,FOR XML PATH 语句的应用
*/
FOR XML PATH 语句的应用:
CREATE  TABLE TempTable(UserID int , UserName nvarchar(50));
insert into TempTable (UserID,UserName) values (1,'a')
insert into TempTable (UserID,UserName) values (2,'b')
select UserID,UserName from TempTable FOR ......

使用MsXML读写XML文件

// MsXmlTest.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include "MsXmlTest.h"
#include <clocale>
#include "comutil.h"
#import "msxml4.dll"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// 唯一的应用程序对象
CWinApp theApp;
using namespace std;
void WritePerson(MSXML2: ......

操作XML,对XML的增删改查操作。asp.net C#

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Xml;
namespace jiu ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号