|
|
|
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?fid=59&tid=2153075]: |
0ms |
get settings: |
5ms |
get forum list: |
8ms |
check forum access: |
2ms |
check topic access: |
2ms |
track hit: |
48ms |
get topic data: |
6ms |
get forum data: |
1ms |
get page messages: |
17ms |
get tp. blocked users: |
1ms |
| others: | 188ms |
| total: | 278ms |

| 0 / 0 |
