Redian新闻
>
Help with tips for xml file transfer using socket
avatar
Help with tips for xml file transfer using socket# XML - WWW明日之星
i*t
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.
avatar
m*o
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.

avatar
i*t
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
avatar
m*o
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

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。