SharePoint List Data as XML

Getting data as XML from a SharePoint List or Library is very helpful when we need to use the data in a custom application (developed using a programming language like C#) or in InfoPath forms. The data from a SharePoint list can be retrieved in XML format by using the following URL:

<your site URL>/_vti_bin/owssvr.dll?Cmd=Display&List={<list GUID>}&XMLDATA=TRUE

You can mention different parameters like “Query”, “FilterField” etc. for specifying columns to be retrieved and for filtering the quantity of data being retrieved. An example for these parameter options is below:

<your site URL>/_vti_bin/owssvr.dll?Cmd=Display&List={<list GUID>}&&XMLDATA=TRUE&Query=<column name>&FilterField1=<column name>&FilterValue1=<value>

The FilterFiled and FilterValue in pairs like FilterField1=<>&FilterValue1=<> and FilterField2=<>&FilterValue2=<> and such.


3 thoughts on “SharePoint List Data as XML

  1. Pingback: Programmatically Accessing SharePoint List XML Data in C# Code « Saji Viswam's Blog

  2. Hey! I realize this was last fall, however…

    Would it be possible to store the XML data in a string using JavaScript and then use selectNodes to move through the string with an XPath expression and extract values?

    Easy to do with a raw XML file, but how about this kind of data? Need to do it all from the front end.

  3. I haven’t tried it myself and I guess it’s really difficult to make an http request from JavaScript to SharePoint web service. A workaround would be to use server side C# code on the page to get this XML and store it in a hidden filed. Then use JavaScript/JQuery to parse through the XML string in the hidden filed.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s