V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
leeraya
V2EX  ›  Java

老铁们请问个 xml 问题

  •  
  •   leeraya · Nov 29, 2023 · 2632 views
    This topic created in 880 days ago, the information mentioned may be changed or developed.

    java class 转 xml

    目标接口接收 xml 封装的数据请求

    我们调用方构造 class ,填充数据之后 post 到对方接口

    <ACCTTO INTERBANK="Y/N" LOCAL="Y/N"> test </ACCTTO>

    对于其中的这种 xml 节点,不知道该怎么处理.转换使用的都是 javax.xml 包下的方法和注解

    @XmlElement(name = "ACCTTO")
    private String acctTO;
    

    这样声明只能达到这样的效果,如何设置标签的 INTERBANK, LOCAL 属性呢? <ACCTTO> test </ACCTTO>

    1 replies    2023-11-29 14:30:49 +08:00
    F7TsdQL45E0jmoiG
        1
    F7TsdQL45E0jmoiG  
       Nov 29, 2023
    @XmlAttribute(name = "INTERBANK")
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1029 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 22:32 · PVG 06:32 · LAX 15:32 · JFK 18:32
    ♥ Do have faith in what you're doing.