|
|
|
ArrayList to XML
|
|||
|---|---|---|---|
|
#18+
Здравствуйте Вопрос: Подскажите пожалуйста чайнику, как можно представить элементы java.ArrayList содержащие другие java.ArrayList в виде XML - XSL Подскажите пожалуйста какие-нибудь ресурсы, если можно с простыми примерами. Спасибо. Буду благодарен за любую информацию. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 21.01.2005, 17:33 |
|
||
|
ArrayList to XML
|
|||
|---|---|---|---|
|
#18+
юзай например DOM. На джаве это JAXP или JDOM. строй из своих листов дерево в виде объекта Document. Выводи дерево в xml файл. Пример: import org.w3c.dom.*; import java.io.*; import org.apache.xml.serialize.DOMSerializer; import org.apache.xml.serialize.XMLSerializer; import org.apache.xml.serialize.OutputFormat; public class XMLFileCreater { public static void main(String[] args) { } public void createXmlFile(String fullPath,Document doc) throws IOException{//Create file with given path using given Document. Encoding windows-1251 use default File treeFile= new File (fullPath); FileOutputStream streamToFile=new FileOutputStream(treeFile); PrintWriter prt= new PrintWriter(streamToFile); OutputFormat format = new OutputFormat(doc, "windows-1251", true); format.setIndenting(true); DOMSerializer serializer = new XMLSerializer(prt, format); Element root=doc.getDocumentElement(); serializer.serialize(root); } } ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 22.01.2005, 07:38 |
|
||
|
|

start [/forum/topic.php?desktop=1&fid=59&tid=2153075]: |
0ms |
get settings: |
9ms |
get forum list: |
21ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
162ms |
get topic data: |
13ms |
get forum data: |
3ms |
get page messages: |
43ms |
get tp. blocked users: |
2ms |
| others: | 219ms |
| total: | 480ms |

| 0 / 0 |
