public static void createDocumentXml(){
//����һƪ�ĵ�
Document document=DocumentHelper.createDocument();
//���һ��Ԫ��
Element root= document.addElement("Students");
//���ע��
root.addComment("学生信息");
root.addProcessingInstruction("target", "instruction");
//����Ԫ��
Element student=new BaseElement("student");
//ΪԪ���������
student.addAttribute("title", "XML Zone");
student.addAttribute("id", "001");
//����rootĿ¼����
root.add(student);
//����ѧ�����Ϣ
Element stuName=student.addElement("name");
//����һƪ�ĵ�
Document document=DocumentHelper.createDocument();
//���һ��Ԫ��
Element root= document.addElement("Students");
//���ע��
root.addComment("学生信息");
root.addProcessingInstruction("target", "instruction");
//����Ԫ��
Element student=new BaseElement("student");
//ΪԪ���������
student.addAttribute("title", "XML Zone");
student.addAttribute("id", "001");
//����rootĿ¼����
root.add(student);
//����ѧ�����Ϣ
Element stuName=student.addElement("name");
解决方案 »
- 怎么知道一个类是在哪个jar包里呢
- 循环写入xml
- 求一Java递归算法
- 将WSAD开发的WAR包部署到Tomcat中出错
- tomcat5.0.*迁移到tomcat5.5.*的问题:jsp显示空白内容
- 请教如何有效的包含jsp页面?
- Struts中的哪个标签可以在jsp中写session的内容?
- weblogic 中配SQL SERVER出错,有谁能提供个ODBC的通用连接POOL设定
- illegal attempt to dereference collection
- Hibernate 主键生成策略问题
- jsp插入applet问题,麻烦各位帮忙看看,谢谢
- jsp视频播放,怎么建播放列表,可以选择文件来播放的那种,急啊!
这句不是乱码?
如果不行,windows--preference--general--workspace--输入编码方式试试