Microsoft KB Archive/890167

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

Article ID: 890167

Article Last Modified on 1/4/2005

-

APPLIES TO

 Microsoft Office FrontPage 2003, when used with:  Microsoft Office SharePoint Portal Server 2003

 Microsoft Windows SharePoint Services 

-





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.''



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.



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.

<div class="workaround_section">

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   page, click All Items under View.
 * 4) On the  : 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
<ol> Start FrontPage 2003, and then open the Windows SharePoint Services Web site where you want to display the list data.</li> On the Data menu, click Insert Data View.</li> Expand XML Web Services in the Data View Catalog pane.</li> Click Add to Catalog. Then, type the following line in the Service description location box:

http:// /_vti_bin/lists.asmx

Note is the URL of the Web site that contains the list data that you want to add.</li> Click Connect Now.</li> In the Operation box, click GetListItems. Then, double-click listName in the Parameters box.</li> 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.</li> Click the Login tab.</li> 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 \  format.</li> Click OK two times.</li></ol>

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 tag is inserted in the table as &quot;&lt;div&gt;&quot; (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: <ol> 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.</li> 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=&quot;@ows_Body&quot;>

</li> Add the following line to the tag:

disable-output-escaping=&quot;yes&quot;

The tag should read as follows:

<xsl-value-of select=&quot;@ows_Body&quot; disable-output-escaping=&quot;yes&quot;>

Important The information in the tag is case-sensitive.</li> Click the Enter button.

Note The Enter button appears as a green check mark.</li></ol>

<div class="references_section">