Role of XML

Would you please describe what you see as the relationship between the xml file and the .cs (or vb.net) file that uses it? I initially thought the .xml was mandatory, that you used the xml file to define format and the .cs file to populate the format (an excellent idea). But then to figure something out I used your EmployeeSales example, and have removed everything but the and tags. For all I know they are optional too.

So my questions would be
1) is the .xml file entirely optional?
2) if not, what elements of it are mandatory?
3) Again, if not, do any of the .xml elements provide functionality I cant place in the .cs?

Thanks, Mark

Dear Mark,

1) is the .xml file entirely optional?

Yes.

2) if not, what elements of it are mandatory?

No element is mandatory.


3) Again, if not, do any of the .xml elements provide functionality I cant place in the .cs?

Yes.



In summary, XML is an alternative to APIs using C# or VB. If you are comfortable writing XML files they are definitely simpler than APIs using C#/VB.