简体   繁体   中英

create xml from sharepoint query?

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,

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) 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM