Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Nested Types, Same Name

Status
Not open for further replies.

HisMightiness

Programmer
Mar 17, 2004
54
US
I have a vendor XML message that I am attempting to consume in .Net. I have created the necessary XML Schema files for them to allow me to generate the strongly-typed .Net classes to allow me to work with them easier. However, in the vendor XML response, there is a nested type that has the same name as the root node.

Here is an example:
Code:
<response type="somestring">
    <node1 id="1" attr1="value">
        <childNode1 attr1="value" />
        <childNode2 attr2="value" />
        <childNode3>
            <node1>
                <subChildNode1>value</subChildNode1>
                <subChildNode2>value</subChildNode2>
                <subChildNode3>value</subChildNode3>
            </node1>
        </childNode3>
    </node1>
</response>

I cannot generate the necessary classes for this XML message because of "node1". Even though the structure is completely different, the class generator turns this into a DataSet object. So, there would be two DataTables named "node1". Does anyone know of a way around this?

Will
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top