I am using the Xmldatasource Control and XPathNavigator (in code behind) to parse an XML file for output on a website. For the output I am using a Repeater doing something like this:
<asp:XmlDataSource ID=“RssFeed” runat=“server” DataFile=“example.xml” XPath=“/rss/channel/item[position()<10]”></asp:XmlDataSource>
<asp:Repeater ID=“repeater1” runat=“server” DataSourceID=“RssFeed” OnItemDataBound=“repeater1_ItemDataBound”>
<ItemTemplate>
<p><%# XPath(“title”) %></p>
<p><%# XPath(“description”) %></p>
</ItemTemplate>
</asp:Repeater>
That works fine until the one of the XML tags has a prefix like <dc:creator>.
If I try <p><%# XPath(“dc:creator”) %></p>, then I get this error message:
Exception Details: System.Xml.XPath.XPathException: Namespace Manager or XsltContext needed. This query has a prefix, variable, or user-defined function.
How would I get at a tag with a prefix?