XML Data Source Weirdness in SharePoint Designer 2010

Home > Blogs > SharePoint > XML Data Source Weirdness in SharePoint Designer 2010

XML Data Source Weirdness in SharePoint Designer 2010

Like This Blog 2 Spike Xavier
Added by February 25, 2013

Using the XML File Data source is SharePoint Designer 2010 is a very handy thing indeed. In my experience it can be a bit buggy to get it to work. Sometimes it just works and many times I find myself staring at the screen waiting..and waiting..and waiting.. and nothing. Somehow I figured out a weird way to get it to work and so far it's always worked for me, although I am at a loss to understand why but here it is.


Environment Out-Of-Box Team Site


I'll start with an out of the box team site at the top level site of a new site collection. Out of the box other than the change I made to the Title, Description and some text on the front page.



Open SharePoint Designer


I almost always use Site Actions> Edit in SharePoint Designer so I'm in the right site.



Click All Files


You can put the file in the site pages library if you like but I'll put mine here.



Add an XML file


Choose File>XML



Name the file


I named mime Books.xml since the XML file I'm using is a list of books. After I name it I click the name to open the file for editing.



Paste in content


Microsoft offers a great sample XML file called books at this URL: http://msdn.microsoft.com/en-us/library/ms762271(VS.85).aspx but I could have used any well formed XML document. I just went to Microsoft.com and searched for books.xml



Verify Well Formed XML


I click the edit tab in the ribbon and then click verify well formed XML which is a very handy tool to be included.



Check Message the click OK


As long as the file is all right as indicated by the message I'll click OK otherwise i would have had to work with the file a bit first.



Be sure to save


Save often in SharePoint Designer 2010.



Close Books File


I just right click the tab, Books.xml and choose close.



Click Data Sources in Navigation


Now that I have my file I'll configure it as a data source. It might actually show up in the data sources list since it's an XML file but i want to configure security and give it a name.



Click XML File Connection icon in the ribbon



Click Browse button



Select Books.xml file



Set Security


I'll be using Windows authentication so i choose the radio button as shown.



Click General Name Data Source


I'll name mine BooksXMLFile and be sure to choose that vs. the raw XML file when adding a Data View. When I'm done i click OK.



Click all Files



Add New ASPX page


I choose File>ASPX page.



Name file and Edit File in Advanced Mode


I name the file Books.aspx and then right click on it and choose Edit File in Advanced Mode.



Delete form tag


A Short cut is to hit escape and then delete when your mouse is in a white area on the page, but delete the form tag for sure.



Attach Master Page


I select the Style Tab in the ribbon, and then click Attach and Choose the Default Master Page.



Add Custom Content PlaceHolder Main


Once again i go back to the PlaceHolderMain and grab the glyph and choose Create Custom Content.



Place cursor in PlaceHolderMain then click Insert tab


I be sure to place my cursor within the now editable PlaceHolderMain and click the Insert Tab on the Ribbon.



Click Data View then choose BooksXMLFile


I choose DataView> BooksXMLFile (you might have to scroll down) , If it just goes in, it's cool, it does happen sometimes, but more often than not….nothing happens.



If nothing happens, click View TaskPanes Data Source Details


By the way if your data went in you can stop here because the rest is only for if nothing happened. But if nothing happens after completing the steps above, in other words your XML data isn't showing, then click View in the ribbon and then click Data Source Details.



Insert Web Part Zone


Every once in a while that does the trick, but if it doesn't you can make sure your cursor is in the PlaceHolderMain and then choose the Insert Tab and click the Web Part Zone Icon in the Ribbon, this inserts a traditional web part zone into the PlaceHolderMain.



Insert Data Source


Once the Web Part Zone is inserted you can click the Data Source Icon in the ribbon and choose BooksXMLFile, you might have to scroll down.





Always remember to Save often when using SharePoint Designer.



Default to Masters Content


At this point even if something happens I default to Masters Content using the glyph for PlaceHolderMain I choose Default to Masters Content.



Create Custom Content


Then I try again. Using the glyph for PlaceHolderMain, select Create Custom Content.



Place cursor click Insert Tab Save Page


Place the cursor inside of the PlaceHolderMain, Click the Insert Tab in the ribbon and click save.



Click Insert Tab DataView BooksXMLFile


Just like before.



The data should now be showing


Not sure why this works but it seems to work every time i try it. I'm not even sure how i figured out to try these steps. Sometimes it's just best to know it works.



Spike Xavier
SharePoint Instructor – Interface Technical Training
Phoenix, AZ

Videos You May Like

Creating Users and Managing Passwords in Microsoft Office 365

0 643 3

In this Office 365 training video, instructor Spike Xavier demonstrates how to create users and manage passwords in Office 365.   For instructor-led Office 365 training classes, see our course schedulle: Spike Xavier SharePoint Instructor – Interface Technical Training Phoenix, AZ 20347: Enabling and Managing Office 365    

Using Navigation Controls in a Collaboration Site in SharePoint

0 338 1

In this SharePoint training video, I want to talk about the Navigation Controls in SharePoint. They tend to fall into two kind of different categories; one with the navigation controls in a typical Collaboration Site such as a Team Site or a Project Site. These are Sites that are based on the Team Site Template … Continue reading Using Navigation Controls in a Collaboration Site in SharePoint

Detailed Forensic Investigation of Malware Infections – April 21, 2015

4 608 5

How does an investigator hunt down and identify unknown malware? In this recording of our IT Security training webinar on April 21, 2015, Security expert Mike Danseglio (CISSP / CEH) performed several malware investigations on infected computers and identify symptoms, find root cause, and follow the leads to determine what’s happening. He demonstrated his preferred … Continue reading Detailed Forensic Investigation of Malware Infections – April 21, 2015

Write a Comment

See what people are saying...

  1. Avatar Nagarajan

    How to bind data from Console application to seattle Master page in SharePoint

    I have a requirement, user will be entering some data in the console application(command prompt). We have to capture that value and pass those value in to a function where we can connect sql connection string and fetch some data from different SQL Table. Finally that returned value should be displayed in SharePoint Seattle MasterPage.
    Whenever console application runs user enters data then that data should be displayed to the masterpage. Kindly give me a solution in detail.
    Thanks Nagarajan

  2. Avatar Bharadwaj


    It’s a good step by step explanation. I have sometihng very basic to ask. How does it differe from what I can achieve using one XML and XSL file uploaded in Doc Library and then using XML Viewer webpart to display the XML file.


Share your thoughts...

Please fill out the comment form below to post a reply.