I ran into a very interesting issue today.
It should be very straight forward to assign your custom xml form as a default template for forms library in your custom site definition.
And I’m not talking about globally overwriting the default template.xml, I just want form libraries within sites created from my custom site definition to use this template.
If you are interested in the steps, here they are:
You open your ONET.xml and locate the following lines (if you don’t have it, you can add it)
<DocumentTemplate XMLForm="TRUE" Path="STS" DisplayName="$Resources:core,doctemp_BlankForm;" Type="115" Default="TRUE" Description="$Resources:core,doctemp_BlankForm_Desc;">
<DocumentTemplateFile Name="doctemp\xmlforms\blank\template.xml" TargetName="Forms/template.xml" Default="TRUE" />
NOTE: If you have custom list definition for your library, make sure TYPE property matches DocumentTemplate Type property.
So, I would expect that by simply adding my xml file to C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033\STS\DOCTEMP\XMLFORMS\BLANK\ directory and modifying the Name property to point to my xml file instead of template.xml, I would get it working.
To my surprise, the template that was picked up by my library still was the original template.xml
Well, the solution turned out to be really simple, move your custom xml template file OUT OF “\BLANK\” directory, simply put it into C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033\STS\DOCTEMP\XMLFORMS\ and modify DocumentTemplate’s Name property to point to it.
In my case it looked something like that “C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033\STS\DOCTEMP\XMLFORMS\customForm.xml”
Save ONET.xml, reset your IIS.