Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert complex XML to .NET Class? [duplicate]

Tags:

c#

.net

class

xml

I have this XML and just wondering how I can convert into C# class?

<?xml version="1.0" encoding="utf-8"?>
<TextScrollerItems xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

    <Item type="text" ID="234">
     <Text Color="Blue">
       Sample text...
     </Text>
    </Item>

    <Item type="image" ID="2456">
        <Image>
          clientLogo.png
        </Image>
    </Item>

    </TextScrollerItems>
like image 791
Friend Avatar asked Nov 18 '25 02:11

Friend


1 Answers

give a try to the XSD.exe tool shipped with Visual Studio. Here's some docs: http://www.codeproject.com/Articles/11317/From-XML-to-Strong-Types-in-C

like image 128
Giorgio Minardi Avatar answered Nov 20 '25 18:11

Giorgio Minardi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!