当前位置: 代码迷 >> XML/SOAP >> 一个DataSet的XML字符串, 如何用VC解析其内容
  详细解决方案

一个DataSet的XML字符串, 如何用VC解析其内容

热度:464   发布时间:2012-03-05 11:54:01.0
一个DataSet的XML字符串, 怎么用VC解析其内容?
调用一个Web服务方法, 那个方法在C#里返回类型是DataSet, 在C++代理文件中返回是个BSTR格式字符串, 内容如下: 
XML code

<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:Locale="zh-CN">
        <xs:complexType>
            <xs:choice maxOccurs="unbounded">
                <xs:element name="FieldList">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="StationNo" type="xs:string" default="" minOccurs="0"/>
                            <xs:element name="Location" type="xs:string" default="" minOccurs="0"/>
                            <xs:element name="DirectA" type="xs:string" default="" minOccurs="0"/>
                            <xs:element name="DirectB" type="xs:string" default="" minOccurs="0"/>
                            <xs:element name="DirectC" type="xs:string" default="" minOccurs="0"/>
                            <xs:element name="DirectD" type="xs:string" default="" minOccurs="0"/>
                            <xs:element name="DirectE" type="xs:string" default="" minOccurs="0"/>
                            <xs:element name="DirectF" type="xs:string" default="" minOccurs="0"/>
                            <xs:element name="DirectG" type="xs:string" default="" minOccurs="0"/>
                            <xs:element name="DirectH" type="xs:string" default="" minOccurs="0"/>
                            <xs:element name="DirectI" type="xs:string" default="" minOccurs="0"/>
                            <xs:element name="DirectJ" type="xs:string" default="" minOccurs="0"/>
                            <xs:element name="DirectK" type="xs:string" default="" minOccurs="0"/>
                            <xs:element name="DirectL" type="xs:string" default="" minOccurs="0"/>
                            <xs:element name="DirectM" type="xs:string" default="" minOccurs="0"/>
                            <xs:element name="DirectN" type="xs:string" default="" minOccurs="0"/>
                            <xs:element name="DirectO" type="xs:string" default="" minOccurs="0"/>
                            <xs:element name="DirectP" type="xs:string" default="" 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="">
        <FieldList diffgr:id="FieldList11" msdata:rowOrder="10" diffgr:hasChanges="inserted">
            <StationNo>67</StationNo>
            <Location>位置</Location>
            <DirectA>(接头A)</DirectA>
            <DirectB>(接头B)</DirectB>
            <DirectC>(接头C)</DirectC>
            <DirectD/>
            <DirectE/>
            <DirectF/>
            <DirectG/>
            <DirectH/>
            <DirectI/>
            <DirectJ/>
            <DirectK/>
            <DirectL/>
            <DirectM/>
            <DirectN/>
            <DirectO/>
            <DirectP/>
        </FieldList>
    </NewDataSet>
</diffgr:diffgram>

 
  相关解决方案