search

Home  >  Q&A  >  body text

spring - java使用HttpURLConnection发送一个请求,获得xml的返回值,如何解析

和三方做对接,使用HttpURLConnection发送一个请求,获得一个xml的返回值,如何解析这个返回值,获得节点下面的值,还有就是如何生成一个xml字符串,发送请求的xml字符串是我用字符串拼接的,有没有更好的方法

怪我咯怪我咯2807 days ago1004

reply all(5)I'll reply

  • PHPz

    PHPz2017-04-18 10:52:35

    There is a well-known XML parsing library on Java called Jdom. You need to study it.

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-18 10:52:35

    Just use the xml parsing tool to parse it

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-18 10:52:35

    The JDK has an API for processing XML, but it is not user-friendly. Recommend Dom4j, recommend a usage tutorial that I have watched before

    reply
    0
  • 黄舟

    黄舟2017-04-18 10:52:35

    dom4j, necessary

    reply
    0
  • PHP中文网

    PHP中文网2017-04-18 10:52:35

    x-stream

    reply
    0
  • Cancelreply