Home » Sharepoint 2010

Where to find (or how to make) OOB WebPart CDATA xml for onet.xml file

When you are attempting to add Web Parts in Modules to an onet.xml file, what is the best way to find (or make) the appropriate xml information that goes inside the <[CDATA [ ]]> element.

In particular, I'm trying to add the "Shared Documents" webpart, but from the sts (OOB Team Site template), the onet.xml does not have it listed (or is the oob template for Team Site not "sts"?).

But in general, how do you get this info for customizing web part include referencs in an onet.xml?


2 Answers Found


Answer 1

I assume you're talking about provisioning a custom site  definition, and the onet.xml you're referring to is your own site definition file? I also assume you're trying to add  the web  part to a page you're provisioning in the site definition? If this is the case you should do the following:

1) avoid, if possible, adding stuff to onet.xml - it's a throwback from the olden days. Create a feature for the module, then create another feature to 'staple' the first feature to the site definition. Chris O'Brien's blogs are always very clear and concise - try this one out http://www.sharepointnutsandbolts.com/2007/05/feature-stapling.html

2) if you're wanting to drop a View of a list or library onto a web part  page then put something like this under the <File> element:

<ViewList="Path/To/Shared Documents"Name="Shared Documents"BaseViewID="1"WebPartZoneID="Left"ShowHeaderUI="TRUE"/>

To add a web part on a page you'll need this kind of thing:

     <?xml version="1.0" encoding="utf-8"?>
     <WebPart xmlns="http://schemas.microsoft.com/WebPart/v2">
	     <Assembly>Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
	     <Title>Relevant Documents</Title>
	     <Description>Displays documents  that are relevant to the current user.</Description>

The code that goes inside  your <![CDATA[...]]> you can find  by navigating to Site Settings (Top level) > Web Part Gallery, click the Edit link on your desired web part, then click 'Export' to get the .dwp or .webpart file. Copy the xml  from there into your CDATA in your AllUsersWebPart element. I've only tried this with .dwp files, and I'm assuming that it works with .webpart files too - check out Corey Roth's blog post about the different formats.

I've made a lot of assumptions about your question - could be making an ____ out of you and mption, let me know if I've got the wrong end of the stick!


Answer 2

____ is not a swear word, it's just a damn donkey!


Using Powershell, I am trying to deploy the our custom solution to SP 2010.  The script is doing the following:

Deleting the web application using Remove-SPWebApplication Creating a new web application using New-SPWebApplication Adding and deploying a series of WSP files (one of which has the site definition file in it) using Add-SPSolution and Install-SPSolution Create a root site collection based on the site definition file provided in the WSPs using New-SPSite
I get the error "WARNING: Template is not found and is not applied."

When I run Get-SPWebTemplate, my site definition does not show up.

I saw this:

but I want a solution that does not involve me reloading a DLL, as, I feel there is something else I am forgetting.

I have also tried:
IISReset Resetting the timer service Cleaning the Cache (as described here: http://support.microsoft.com/kb/939308)
Nothing seems to work.  Does anyone have any ideas?


I have created an Out Of Browser Silverlight app and I'm having trouble loading an xml file.

In the "My Documents" folder I have 2 xml files that I load at various times in my application. The path locations are as follows.

File1 = testApp\Programs\models.xml

File2 = testApp\Database\Stats.xml

Loading and saving File1 works fine but loading File2 gives me the following error

Cannot open 'file://gbbed01fi01/HOME01/GBCO0101/My Documents/testApp/Database/Stats.xml'. The Uri parameter must be a relative path pointing to content inside the Silverlight application's XAP package. If you need to load content from an arbitrary Uri, please see the documentation on Loading XML content using WebClient/HttpWebRequest.

Saving File2 works fine also so why do I get the error while trying to load File2?


Please take a look at the file http://www.windwardreports.com/temp/Bug541.docx

In chart1.xml:
1. It has <a:schemeClr val="bg1"/> and <a:schemeClr val="tx1"/> but those do not exist in theme1.xml. Where do I find what color those themes are?
2. How do I determine that the text is written in white? It appears to have a fill color, but no text color.

??? - thanks - dave

Very funny video - What's your Metaphor?

I have an xml file that I need to edit using Microsoft Word 2003. Everything works fine but the CDATA section is lost and is converted to normal html. For example


Gets converted to


Is there any way to preserve the CDATA section while editing in MS Word. I want to fix some typos and grammer in the xml file so I am using this approach.



Hi Guys,

I'm adding metadata to pages in my page library by adding properties to the module in ONET. Specifically I'm trying to add a user to a SPFieldUser field and I can't work out what information to put into the XML to make Sharepoint recognise the user.

My attempt:

<Property Name="UserName" Value="My Name" />

Where UserName is a field which expects a user object.


Thanks in advance!




I want to set MajorVersionLimit to 10 in the library that is being created with my site, which has customized onet.xml.

<Configuration ID="-1"Name="NewWeb"/>
<Configuration ID="0"Name="Default"
<List FeatureId="xxx"Type="101"Title="xxx"Url="xxx"QuickLaunchUrl="xxx"VersioningEnabled="TRUE"EnableMinorVersions="TRUE"EnableContentTypes="TRUE"MajorVersionLimit="10"MajorWithMinorVersionsLimit="5"ForceCheckout="TRUE"/>

Versioning and ForceCheckout seems to work with previous but MajorVersionLimit and MajorWithMinorVersionsLimit does not. Anyone know why?


I noticed that the SiteLogoUrl attibute in the project element no longer works in SharePoint 2010. 

I used to have this attribute in my custom site template in SharePoint 2007 to set a custom logo.  However when I port this site template to SharePoint 2010, the new site does not use the SiteLogoUrl as the site logo. 

I tried to add this logo to the out of the box SharePoint 2010 site template and it doesn't work as well.  Of course I can set this via feature receiver.  But I would like to know if this attribute got deprecated in SharePoint 2010?? Of is this a bug?

I checked the project element doc http://msdn.microsoft.com/en-us/library/ms438080.aspx and SiteLogoUrl is still here.  And intellisense still brings up SiteLogoUrl as a valid attribute for Project.



Hello all,

I am having difficulty in understand how to deploy site definitions. Let me explain in details.

I created custom list definition using visual studio along with an event receiver (itemadding) attached to it. This works fine. I can see that my list definition appears in sharepoint browser and I can create an instance from my definition and create columns on top and the event fires perfectly fine.

A need has arrived for me to create site definitions. So I created a site definition project in Visual Studio and I see the ONET.xml. Now, provided that my list definition and the event associated with it is already deployed on the sharepoint environment how can I simply activate both these on the new site definition. Looking at ONET.xml I have not got a clue what to put where.

Will you please guide me on this and share your experiences. In the mean time, I experimented with Solutions Generator and found that although the list definition was picked up but it did not pick up the event receiver. Did you experience the same?

Please share your thoughts and provide me with the steps to activate already deployed list definition and its event receiver in onet.xml of my site definition.



Dear all,

I created a list definition from solutions generator and deployed it and it works fine when invoked at any site. First have a look at my feature.xml obtained from list definition deployment.

<?xml version="1.0" encoding="utf-8"?>
<Feature Id="6ae037af-3fe7-4f2f-a0ab-b1cc8ef74c28" Title="ABC" Scope="Web" Version="" Hidden="FALSE" DefaultResourceFile="core" xmlns="http://schemas.microsoft.com/sharepoint/">
    <ElementManifest Location="Members\ListDefinition.xml" />
    <ElementFile Location="ABC\schema.xml" />
    <ElementFile Location="ABC\AllItems.aspx" />
    <ElementFile Location="ABC\DispForm.aspx" />
    <ElementFile Location="ABC\EditForm.aspx" />
    <ElementFile Location="ABC\NewForm.aspx" />

However, I am trying to now use this list to appear on my custom site definition which for some reason (bad coding probably) is not working. Now look at how I am trying to get invoke this list inside ONET.xml so that it appears on the left navigation panel. I took this code sample from other onet.xml from some site definition. Just you're wondering the 1008 type is actually a unique type I defined inside the list definition project before deloying via solutions generator.

Inside ONET.xml

    <Configuration ID="1" Name="Blank">
            <List FeatureId="6ae037af-3fe7-4f2f-a0ab-b1cc8ef74c28" Type="1008" Title="Projects" Url="Lists/Projects" /></List>

There is nothing inside <ListTemplate> section and currently I am also not invoking any default view for this list so no reference in the <Module> section either.

Observations -

When I create new site from site definition I get "File Not Found *" Error. However, accessing the list contents from /newsite/_layouts/settings.aspx from url and stepping into the Content and Structure settings for new site I observed that default.aspx main page for my new site has not been created. The list is created but has no newform.aspx, allitems.aspx etc, no view either and no url attached to the list but I can see that the columns on the list was created. 
So List is being created, columns are being created, no form pages, no url for list (eg /newsite/lists/projects/).

How to resolve this issue? What am I not doing correctly?

File Not Found.   at Microsoft.SharePoint.Library.SPRequestInternalClass.CreateList(String bstrWebUrl, String bstrTitle, String bstrDescription, String bstrListUrl, String bstrFeatureId, Int32 lTemplateID, String bstrDocTemplateType, ListQuickLaunchOptions qlOpt)
   at Microsoft.SharePoint.Library.SPRequest.CreateList(String bstrWebUrl, String bstrTitle, String bstrDescription, String bstrListUrl, String bstrFeatureId, Int32 lTemplateID, String bstrDocTemplateType, ListQuickLaunchOptions qlOpt)
   at Microsoft.SharePoint.SPListCollection.CreateList(String strTitle, String strDescription, String strListUrl, String strFeatureId, Int32 templateID, String strDocTemplateType, QuickLaunchOptions qlOpt)
   at Microsoft.SharePoint.SPListCollection.Add(String strTitle, String strDescription, String strUrl, String strFeatureId, Int32 templateType, String docTemplateType, QuickLaunchOptions quickLaunchOptions)
   at Microsoft.SharePoint.SPListInstanceElement.EnsureListExists(SPWeb web)
   at Microsoft.SharePoint.SPListInstanceElement.ElementActivated(SPFeaturePropertyCollection props, SPSqlCommand sqlcmdAppendOnly, SPWebApplication webApp, SPSite site, SPWeb web, Boolean fForce)
   at Microsoft.SharePoint.Administration.SPElementDefinitionCollection.ProvisionListInstances(SPFeaturePropertyCollection props, SPSite site, SPWeb web, Boolean fForce)
   at Microsoft.SharePoint.Administration.SPElementDefinitionCollection.ProvisionElements(SPFeaturePropertyCollection props, SPWebApplication webapp, SPSite site, SPWeb web, Boolean fForce)
   at Microsoft.SharePoint.SPFeature.ProvisionElements(SPFeaturePropertyCollection props, SPWebApplication webapp, SPSite site, SPWeb web, Boolean fForce)
   at Microsoft.SharePoint.SPFeature.Activate(SPSite siteParent, SPWeb webParent, SPFeaturePropertyCollection props, Boolean fForce)
   at Microsoft.SharePoint.SPFeatureCollection.AddInternal(Guid featureId, SPFeaturePropertyCollection properties, Boolean force, Boolean fMarkOnly)
   at Microsoft.SharePoint.SPFeatureManager.EnsureFeaturesActivatedAtWebInternal(SPWeb web, String sFeatures, Boolean fMarkOnly)
   at Microsoft.SharePoint.SPFeatureManager.<>c__DisplayClass7.<EnsureFeaturesActivatedAtWeb>b__6()
   at Microsoft.SharePoint.SPSecurity.CodeToRunElevatedWrapper(Object state)
   at Microsoft.SharePoint.SPSecurity.RunAsUser(SPUserToken userToken, Boolean bResetContext, WaitCallback code, Object param)
   at Microsoft.SharePoint.SPSecurity.RunAsUser(SPUserToken userToken, CodeToRunElevated code)
   at Microsoft.SharePoint.SPFeatureManager.EnsureFeaturesActivatedAtWeb(Byte[]& userToken, Int32 nZone, Guid siteid, Guid webid, String sFeatures)
   at Microsoft.SharePoint.Library.SPRequestInternalClass.ApplyWebTemplate(String bstrUrl, String& bstrWebTemplate, Int32& plWebTemplateId)
   at Microsoft.SharePoint.Library.SPRequest.ApplyWebTemplate(String bstrUrl, String& bstrWebTemplate, Int32& plWebTemplateId)
   at Microsoft.SharePoint.SPWeb.ApplyWebTemplate(String strWebTemplate)
   at Microsoft.SharePoint.ApplicationPages.TemplatePickerUtil.ApplyWebTemplateAndRedirect(SPWeb Web, String strWebTemplate, Boolean bSharedNav, Boolean bOnTopNav, Boolean bOnQuickLaunch, Page page)
   at Microsoft.SharePoint.ApplicationPages.NewSubwebPage.BtnCreateSubweb_Click(Object sender, EventArgs e)
   at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
   at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


Ihave created a Site definition and added a Posts Listview in the same.

<View List="$Resources:core,lists_Folder;/$Resources:core,blogpost_Folder;" BaseViewID="10" WebPartZoneID="Left" WebPartOrder="1"/>

This list is created using my own schema.xml which i have copied from the Blog site template.

I wanted to rename the title of the list [not Title field] which is coming to be Posts right now.

Is there anyway to do it?

Any help appreciated



How is it possible to store xml (untyped) content with CDATA tags ito a xml field without automatic removing of the CDATA tag?
At the moment I need a second field varchar(max) to store the real xml contet and I use the xml field for xQuery searches.

But there is a problem is characters like '<' in the node text will be replaced with escaped characters! - for other processes I need the real stored content!
To use a xml schema is not possible because the xml structure can be variable - I need untyped xml.

Any sugestions welcome

Thanks for your response



I working with a custom site template based on the Publishing template. I cannot find a reference on how to define in the onet.xml file some standard document template that are not included in the Publishing site.
I need to add survey capability to my custom site.

I'm looking for something like this (These are the definition for BasicPage and WebPartPage) related to the Survey:


Can anyone help me?

Thank you,


I get this error in the ULS logs when I create a site based on my custom site definition :-

01/24/2011 17:00:47.10w3wp.exe (0x0D70)0x10ACSharePoint FoundationGeneraltkneHighWebPartUpdater::updateBinaryPropertiesForWebParts failed with 0x8013150A for doc default.aspxec920bb8-125f-458d-a3d1-3b966b0cc89e

01/24/2011 17:00:47.10w3wp.exe (0x0D70)0x10ACSharePoint FoundationGeneral8jbeHighupdateBinaryPropertiesForWebParts failedin module for file 'default.aspx'ec920bb8-125f-458d-a3d1-3b966b0cc89e

Here is my onet.xml fragment

    <Module Name="DefaultBlank" Url="" Path="">
      <File Url="default.aspx" NavBarHome="True" Type="Ghostable">
        <NavBarPage Name="$Resources:core,nav_Home;" Url="~site" ID="1002" Position="Start" />
        <NavBarPage Name="$Resources:core,nav_Home;" Url="" ID="0" Position="Start" />
        <AllUsersWebPart WebPartZoneID="Right" WebPartOrder="1" >
  <webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
      <type name="MyNamespace.MyLibrary.MyClass, MyNamespace.MyLibrary, Version=, Culture=neutral, PublicKeyToken=1234567890123456" />
        <property name="Title" type="string">Title</property>
        <property name="Description" type="string">Description</property>

My site definition is a copy of the blank one. When I manually create a site through the UI it works fine. Just creating the site programmatically that fails. If I remove the AllUsersWebPart node from onet.xml then the programmatic site creation starts to work again.

Anyone got any ideas?


Mark Wilson



Sample file at http://www.windwardreports.com/temp/StillBad.zip - I removed the BOM at the beginning. And Open XML still won't open it. But...

If I write the contents of the docx file out with WinZip and then create a new DOCX file using those files with WinZip - then it works. I don't change the contents of the files at all, I just write them out then read them in to a new zip file.

WinZip says the original file is good - all diagnostics pass. So why dos Open XML (or packaging) not like the zip file?

??? - thanks - dave


I need to be able to take the results of a policy evaluation run and produce an exception report from it.  I've tried over and over again using XSLT to extract the policy name, the server instance, and results into a table but get nothing or I get multiple copies of the same data.  When I specify the path to the node I get nothing ( "model/instances/document/data/DMF:EvaluationHistory/DMF:PolicyName").  Has anyone been able to perform a transform on the results of a policy evaluation export? 



I have to implement sorting order for OOB search results.

I have one solution :

In search core results webpart,

Updated  XSLT as

<xsl:template name="dvt_1.body">

    <xsl:param name="Rows"/>

    <xsl:for-each select="$Rows">

      <xsl:sort select="title" order="ascending" />

      <xsl:call-template name="dvt_1.rowview"/>




I need sort order for total results. But, it is sorting in the currentpage only.

Is there any full fleged OOB solution to get sorting order for search core results webpart, for total results?

Advanced Thanks,


Hi All,

I have a requirement to modify the sharepoint OOB My Tasks webpart.I have requirments like ,when the user hovers over the title of the task, a description of the task should appear.Basically i have to capture the mouse hover event in the my tasks webpart.Is this possbible? If yes, any pointers on ways to achive this is appreciated.


Is there any  OOB webpart available in Sharepoint designer 2010 to compose and send e-mails to the list by picking using the people picker.


Im trying to create an XMl File or stream from a SharePoint BDC which displays the data as a list.

Theres the option to use owssvr.dll to get what im after from a standard list with just het site name and GUID

example:  http://server/sites/_vti_bin/owssvr.dll?Cmd=Display&List={GUId}&XMLDATA=TRUE

Is there a way to use this with the BDC web part? THe BDC creates what it calls a list and looks the same as a normal SharePoint List, but it grabs the data on page load and does not have a GUID for the list not what i could spot anyway

MOSS 2007





i having some problems with my webpart.

the user can upload a document.

and add extra information.

when i test this webpart on the server i can upload a document, and the document stands in the library.

when i now try this webpart with my browser it failse.

i recieve an error "file not found"?

anybody any suggestion?



<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure