views:

46

answers:

1

Hi,

I am querying a sharepoint list like

<where><Field Ref Name='Title'/><Value type='Text'>A</value></where>

now I am creating a webpart where I want to create xml based on this query.I don't know how to achieve this mainly I want sth like content query webpart like getting xml from querying a list and then apply xsl on it. Can anyone tell me how it can be possible??

Thanks,

A: 

Do you want to have the result set as XML? Then you should read these:

EDIT: to turn your DataTable into XML, you can add it to a DataSet and then call GetXml, something like this:

    Dim o As New DataTable("testTable")
    o.Columns.Add("TestCol")
    o.Rows.Add(New Object() {"Testvalue1"})
    o.Rows.Add(New Object() {"Testvalue2"})

    Dim oSet As New DataSet()
    oSet.Tables.Add(o)

    MessageBox.Show(oSet.GetXml) 
naivists
Thanks naivists for replying.I don't wanna use webservices but how I can get the XML from datatable . Actually mainly I want to apply xsl on this XML I also found this link of creating XML. So I would say its ok But how to use this XML with applying XSL..or I use ur Datatable method to get XML then how to apply xsl on that xml... http://www.developer.com/net/net/article.php/1482531/Writing-XML-in-NET-Using-XmlTextWriter.htm
AB
updated my post to show how one can get xml out of a datatble. Also, you can do like in this post http://snippets.dzone.com/posts/show/3696
naivists