i*****t 发帖数: 220 | 1 My tool is JAXP DOM. My idea is this: to realize XML file transfer between
two sockets. I finished several step so far at the sender side:
1. use DocumentBuilder to generate a new Document.
2. insert a root Element into the Document.
3. add new nodes into the root Element.
My question is how to do:
4. how to convert the Document type into OutputStream so I can send it out
using the socket. Maybe I should convert the Document into byte[] first or
something else, but how?
Thank you very much. |
m******o 发帖数: 33 | 2 serialze DOM to xml. see org.apache.xml.serialize
【在 i*****t 的大作中提到】 : My tool is JAXP DOM. My idea is this: to realize XML file transfer between : two sockets. I finished several step so far at the sender side: : 1. use DocumentBuilder to generate a new Document. : 2. insert a root Element into the Document. : 3. add new nodes into the root Element. : My question is how to do: : 4. how to convert the Document type into OutputStream so I can send it out : using the socket. Maybe I should convert the Document into byte[] first or : something else, but how? : Thank you very much.
|
i*****t 发帖数: 220 | 3 thanks. but i am using jaxp so i shall use org.w3c.dom. i am still looking
for the way for w3c to do the serialization.
between
【在 m******o 的大作中提到】 : serialze DOM to xml. see org.apache.xml.serialize
|
m******o 发帖数: 33 | 4 I don't think there's standard API for xml serialization.
【在 i*****t 的大作中提到】 : thanks. but i am using jaxp so i shall use org.w3c.dom. i am still looking : for the way for w3c to do the serialization. : : between
|