Wednesday, September 7, 2011

Parsing Typed XML

I had a task to parse XML into Database.  I started to plan execution of the task. First of all XML has a constant structure. So the plan was to create the schema (XSD) of the XML and then produce from the schema collection of classes. Afterwards the XML can be de serialized .The schema creation in .Net can be done with the XSD tool. But the problem that I wanted that collection of classes 
will support LINQ.  I was confident that someone already wrote framework that does it and I found it. Project called “Linq to XSD”.  (  The project creates  schema from the XML and produce classes from it.  The collection of classes can be queried in LINQ manner. That’s exactly what I was looking for!   The single problem that I had with it , was to installed it. Because the project in the Beta phase, need to work a litle. But after I finished
that, it was really easy to use.  My tip for using the framework is to remove unnecessary functions,  that was created by the framework.  Functions that  you are not using simply holding the pointer in virtual table.

No comments:

Post a Comment