Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

You receive a "The Data Source does not contain valid XML data" error message when you use FrontPage 2003 to insert a Data View of a Windows SharePoint Services list


View products that this article applies to.

Summary

This article describes a scenario where you receive an error message when you use Microsoft Office FrontPage 2003 to insert a Data View of a Microsoft Windows SharePoint list to your Windows SharePoint Services Web site. You experience these symptoms if the list is stored on a Windows SharePoint Services Web site that is located on a different virtual server. By default, you cannot use Data Views to retrieve list data from a Windows SharePoint Services Web site that is located on a different virtual server. To work around this behavior, add the Lists.asmx Web service to the data source catalog, and then insert the Data View to a Web page on your Windows SharePoint Services Web site. This workaround lets you add list data from a Windows SharePoint Services Web site that is located on a different virtual server.

↑ Back to the top


Symptoms

When you use FrontPage 2003 to insert a Data View of a Windows SharePoint Services list to a Web page of your Windows SharePoint Services Web site, you receive an error message that is similar to the following:
The Data Source does not contain valid XML data.

The server for the data source returned a non-specific error when trying to execute your query. Check the format and content of your query and try again. If the problem persists contact the system administrator.

↑ Back to the top


Cause

This behavior occurs if the list is stored in a Windows SharePoint Services Web site that is located on a different virtual server. By default, you cannot use Data Views to retrieve list data from a Windows SharePoint Services Web site that is located on a different virtual server. You can only use Data Views to retrieve list data from a Windows SharePoint Services Web site that is located on the same virtual server as the Windows SharePoint Services Web site that you are working with. Windows SharePoint Services works this way by design.

↑ Back to the top


Workaround

To work around this behavior, use FrontPage 2003 to add the Lists.asmx Web service to the data source catalog, and then insert the Data View. To do this, follow these steps.

Step 1: Customize the Windows SharePoint Services list to display the Body column

  1. Connect to the list on your Windows SharePoint Services Web site.
  2. Click Modify settings and columns.
  3. On the Customize ListName page, click All Items under View.
  4. On the ListName: Edit View page, click to select the Body check box in the Columns area.
  5. Click OK.
Note The columns in the default view determine the columns that are available for you to add to the Data View. Repeat step 1 as needed to add more columns.

Step 2: Add the Web service to the data source catalog

  1. Start FrontPage 2003, and then open the Windows SharePoint Services Web site where you want to display the list data.
  2. On the Data menu, click Insert Data View.
  3. Expand XML Web Services in the Data View Catalog pane.
  4. Click Add to Catalog. Then, type the following line in the Service description location box:
    http://URLOfWebSite/_vti_bin/lists.asmx
    Note URLOfWebSite is the URL of the Web site that contains the list data that you want to add.
  5. Click Connect Now.
  6. In the Operation box, click GetListItems. Then, double-click listName in the Parameters box.
  7. Type the name of the list in the Value box, and then click OK.

    Note To determine the name of the list, right-click the list in FrontPage 2003 in the Folder List pane, click Properties, and then click the Settings tab. The name of the list is displayed in the Name box.
  8. Click the Login tab.
  9. Click Save this username and password in the data connection. Type a user name in the User name box, and then type a password in the Password box.

    Note Type the user name in DomainName\UserName format.
  10. Click OK two times.

Step 3: Display the data for the Web service

  1. Expand XML Web Services in the Data View Catalog pane.
  2. Move the pointer over the list that you added, click the down arrow, and then click Show Data.
The data that is retrieved from the list is displayed in the Data View Details pane.

Step 4: Insert a Data View

  1. Open the Web page where you want to insert the Data View, and then at the bottom of the Web page, click Design.
  2. In the Data View Details pane, select the columns that you want to display. To do this, press and hold down the CTRL key, and then click the columns that you want.
  3. Click the area of the Web page where you want to insert the Data View, and then click Insert Data View.
This step creates an Extensible Stylesheet Language Transformation (XSLT) Data View of the data and formats the list items in a table. FrontPage 2003 automatically adds a row for each list item. For example, if you have a list that contains five items, FrontPage 2003 adds five rows to the table. When additional items are added to the list, the items are dynamically displayed in the Data View.

Note If the table has cells that contain Rich-Text formatting, the cells may contain HTML tags. By default, HTML tags use escape characters. To display HTML content correctly, you may have to add the disable-output-escaping attribute. To do this, go to step 5.

Step 5: Add the disable-output-escaping attribute

Use this step if Rich-Text cells in the ows_Body column of the table contain HTML tags. By default, HTML tags use escape characters. For example, the <div> tag is inserted in the table as "&lt;div&gt;" (without quotation marks). This behavior causes the HTML tags to display on the Web page, and the text is not formatted. To prevent HTML tags from being displayed on the Web page, add the disable-output-escaping attribute to the ows_Body column of the table.

To add the disable-output-escaping attribute, follow these steps:
  1. Click a cell that contains Rich-Text formatting in the ows_Body column of the table.

    After you do this, the <xsl-value-of> tag in the Quick Tag Selector toolbar at the top of the window is selected.
  2. Move the pointer over the <xsl-value-of> tag in the Quick Tag Selector toolbar, click the down arrow, and then click Edit Tag.

    The following line is displayed for the tag in the Quick Tag Editor dialog box:
    <xsl-value-of select="@ows_Body">
  3. Add the following line to the tag:
    disable-output-escaping="yes"
    The tag should read as follows:
    <xsl-value-of select="@ows_Body" disable-output-escaping="yes">
    Important The information in the tag is case-sensitive.
  4. Click the Enter button.

    Note The Enter button appears as a green check mark.

↑ Back to the top


References

For additional information about how to work with Data Views in FrontPage 2003, see FrontPage 2003 Help. To do this, click Microsoft Office FrontPage Help on the Help menu, type data views in the Search for box, and then press ENTER.

↑ Back to the top


Keywords: KB890167, kbtshoot, kberrmsg, kbprb

↑ Back to the top

Article Info
Article ID : 890167
Revision : 3
Created on : 1/4/2005
Published on : 1/4/2005
Exists online : False
Views : 459