c# - Easiest way to read XML with attributes -


i have xml file read (with xml atrributes). structure doesn't change, content does.

sample xml: http://www.yr.no/place/norway/oslo/oslo/oslo/forecast.xml (the url must copied , pasted address field manually or you'll 404 seems.)

i'm unable make xsd using code (and using xsd.exe):

xmltextreader myxmltextreader = new xmltextreader("forecast.xml"); dataset mydataset = new dataset(); mydataset.readxml(myxmltextreader); mydataset.writexmlschema("forecast.xsd"); 

results in:

column name 'name' defined different mapping types.

now, imagine i'm lazy on top of , don't feel spending whole evening manually mapping xml objects. want managed code objects generated me can read data.

what options?

...and if knows, xsd convert error message mean?

to answer final point xsd.exe error, it's having problems multiple location elements. if save xml , rename first location element baselocation convert okay.

you may able manually amend xsd or generated classes handle this.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -