SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using SharePoint designer to build a page with a data view web part that displays the contents of a 6,000 record XML file that is structured like the example below with each "Details" element being a record.

<?xml version="1.0" encoding="UTF-8"?>
      <Display_Name>Weather, Wendy</Display_Name>
      <Site_Location>Denver, CO</Site_Location>

I want to filter that DVWP by the Site_Location element using an ASP dropdown control. Rather than have to maintain a list of about a hundred Site Locations as choices in the dropdown control's code, I want to simply use that XML file as the data source for my dropdown's choices.

I can insert the XML data source onto the page just fine. But, when I select it as the data source for my dropdown and then preview the page, it gives me a web part error and the page won't load.

I assume that what I am doing is possible. Is it not working because my XML file doesn't have any schema information? It seems to be well-formed enough to load in the DVWP. After-all, the entire page works great UNTIL I associate the ASP dropdown with the data source. That's when it breaks.

share|improve this question

I think you need sth. like this in your code:

<asp:DropDownList runat="server" id="siteLocationList{$Pos}" OnSelectedIndexChanged="javascript:openViewForSite();">
    <xsl:variable name="siteLocation" select="@answer"/>
    <xsl:for-each select="/Details_Collection/Details">
        <xsl:sort select="Site_Location"/>
            <xsl:value-of select="Site_Location"/>
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.