开发者

VB6 to read dataset xml response from vb.net webservice

I have no idea to do this....

I've surf the net..but none of the code working....

I have this xml response from vb.net webservice:

      <?xml version="1.0" encoding="utf-8" ?> 
- <DataSet xmlns="http://Wtechwebservice.com.my/">
- <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
- <xs:complexType>
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element name="Table">
+ <xs:complexType>
+ <xs:sequence>
  <xs:element name="MessageID" type="xs:int" minOccurs="0" /> 
  <xs:element name="MessageTitle" type="xs:string" minOccurs="0" /> 
  <xs:element name="MessageDesc" type="xs:string" minOccurs="0" /> 
  <xs:element name="StartDate" type="xs:dateTime" minOccurs="0" /> 
  <xs:element name="EndDate" type="xs:dateTime" minOccurs="0" /> 
  <xs:element name="Repeat" type="xs开发者_运维知识库:int" minOccurs="0" /> 
  <xs:element name="Status" type="xs:string" minOccurs="0" /> 
  <xs:element name="DateCreated" type="xs:dateTime" minOccurs="0" /> 
  <xs:element name="LastUpdated" type="xs:dateTime" minOccurs="0" /> 
  <xs:element name="UpdatedBy" type="xs:string" minOccurs="0" /> 
  </xs:sequence>
  </xs:complexType>
  </xs:element>
  </xs:choice>
  </xs:complexType>
  </xs:element>
  </xs:schema>
- <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
- <NewDataSet xmlns="">
- <Table diffgr:id="Table1" msdata:rowOrder="0">
  <MessageID>11</MessageID> 
  <MessageTitle>Happy New Year</MessageTitle> 
  <MessageDesc>New Year is the time to unfold new horizons & realize new dreams</MessageDesc> 
  <StartDate>2011-01-01T16:10:34.963+08:00</StartDate> 
  <EndDate>2011-01-01T16:10:34.963+08:00</EndDate> 
  <Repeat>1</Repeat> 
  <Status>Active</Status> 
  <DateCreated>2010-02-01T16:10:34.963+08:00</DateCreated> 
  <LastUpdated>2010-02-01T16:10:34.963+08:00</LastUpdated> 
  <UpdatedBy>Nosyi</UpdatedBy> 
  </Table>
  </NewDataSet>
  </diffgr:diffgram>
  </DataSet>

How do i get my VB6 app to read the result from this XML???


There are many references of processing XML in vb6. My preference is followed in the following article: http://www.xml.com/pub/a/2000/07/12/vbasic/vb_and_xml.html It suggests to process the XML via XSLT.

Most basic way is using MSXML. But that is a lot more work compared to using XSLT

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜