Pages

Showing posts with label schema file. Show all posts
Showing posts with label schema file. Show all posts

Tuesday, February 5, 2013

How to generate .NET Classes from XSD file



Most of the time when we are working with web services, we have to generate .NET classes from XSD schema file to start with coding. Microsoft provides xsd.exe tool in SDK for generating classes but I personally feel it’s not BEST tool to start with, because sometime xsd.exe tool is generating unnecessary classes.

To overcome this situation we can do two things –
1) change schema file respectively
2) change generated .NET classes to satisfy requirements.

Here is very good link which talks about different options for generating classes from XSD :

Sunday, August 23, 2009

How to assign lookup values into List definition – schema.xml file

I had requirements in which I wanted to deploy my custom lists from one server to another server, I had generated my schema and forms files using solution generator tool, now when I open one of my generated schema file in which I have lookup columns linked to another custom list, I have observed that solution generator tool commented custom lookup columns, I mean it didn’t figured out which custom list to attached for lookup columns.

There are many ways to achieve these challenges, one way would be if we know GUID of custom list which we are going to look up on then we can write same GUID into list definition schema file, but in my case all custom list was deployed at same time, so I don’t know what’s GUID of lookup list.

Another solution I found was, we can write feature event receiver on custom list, so when feature install/deploy custom list at same time we can take lookup column list name and assign into lookup columns into list definition file.

But at the last I have found simplest solution to assign lookup values into list definition, there is property called "LIST" into fields columns for schema.xml file, so in same list definition file, we can write List="Name of List" for lookup columns, so it will attached lookup list name for columns.

I hope that above information makes some sense to reader, but if it’s too confusing then please let me know about your challenges we can work out :)

Enjoy!

Monday, July 20, 2009

How to give intelligence into feature XML file

One day I was creating my feature file into solution package, at that time I saw that I didn’t get intelligence of all elements and attribute into my file and I have found that by adding below schema file, we will be having intelligence in any XML file. Though it’s very small things, but I thought to share with you.

Schema file:

"C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\XML\wss.xsd"