使用Stringstoken將這些變量轉換為數組並保存。
3 xml文件讀寫壹般由dom4j實現。使用dom4j根據您需要的格式從數組的內容生成XML文件,並調用該方法。
導入org . dom4j . attribute;
導入org . dom4j . document exception;
導入org . dom4j . document helper;
導入org . dom4j . element;
...............
//創建Xml文件
element User = document helper . createelement(" User ");
user.addAttribute("type "," user ");
user.addElement("name ")。addAttribute("type ","拼音")。setText(" July SEEA ");
user.addElement("age ")。setText(" 29 ");
string one XML = user . as XML();
buffered writer out = new buffered writer(new FileWriter(" one XML . XML "));
out . write(one XML);
out . close();