best way to map xml to a structure

88 views
Skip to first unread message

Joel Reymont

unread,
Feb 21, 2013, 5:43:32 PM2/21/13
to golan...@googlegroups.com

What is the best way to map the following XML to a structure and back?

I don't care about obvious boilerplate like xmlns:SOAP-ENV and xmlns:m but, unfortunately, these need to be parsed and written on the way out :-(.

    Thanks in advance, Joel

---

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body>

      <m:getPresence
        xmlns:m=

"http://schemas.microsoft.com/winrtc/2002/11/sip"> <presentity uri="sip:tar...@tradewind.com"/>

      </m:getPresence>
    </SOAP-ENV:Body>
  </SOAP-ENV:Envelope>

Joel Reymont

unread,
Feb 22, 2013, 7:40:00 AM2/22/13
to golan...@googlegroups.com
This is too easy so allow me modify my question.

Is it possible to use the xml package to parse if the XML element in the SOAP envelope can vary?

For example, the element can be m:getPresence or m:addGroup or m:modifyGroup?

Would a union work here?

    Thanks in advance, Joel
Reply all
Reply to author
Forward
0 new messages