Hi,
Using following transformation the root element will be set based on NewsID column dynamically - the HeaderXML and FooterXML property will be overwritten (in the xml tag cannot be number, therefore the orange t was edded in the code ). In case you will use some title column, the t is not needed.
<%@ Register TagPrefix="cc2" Namespace="CMS.PortalControls" Assembly="CMS.PortalControls" %>
<%@ Register TagPrefix="cc2" Src="~/CMSWebParts/Syndication/Basic/XMLRepeater.ascx" TagName="xml" %>
<script runat="server">
public CMSAbstractWebPart FindWebpart(Control o)
{
if (o is CMSAbstractWebPart)
{
return o as CMSAbstractWebPart;
}
else
{
if (o.Parent != null)
{
return FindWebpart(o.Parent);}
else
{
return null;
}
}
}
public void EditWebPart()
{
CMSAbstractWebPart currentWebpart = FindWebpart(this);
if (currentWebpart != null)
{
string title = ValidationHelper.GetString(DataRowView["NewsID"], "");
((CMSWebParts_Syndication_Basic_XMLRepeater)currentWebpart).HeaderXML = "<t" + title + ">" ;
((CMSWebParts_Syndication_Basic_XMLRepeater)currentWebpart).FooterXML= "</t" + title + ">";
}
}
protected override void OnInit(EventArgs e)
{
EditWebPart();
base.OnInit(e);
}
</script>
<CMS_News>
<NewsID><![CDATA[<%# Eval("NewsID", true) %>]]></NewsID>
<NewsTitle><![CDATA[<%# Eval("NewsTitle", true) %>]]></NewsTitle>
<NewsReleaseDate><![CDATA[<%# Eval("NewsReleaseDate", true) %>]]></NewsReleaseDate>
<NewsSummary><![CDATA[<%# Eval("NewsSummary", true) %>]]></NewsSummary>
<NewsText><![CDATA[<%# Eval("NewsText", true) %>]]></NewsText>
</CMS_News>
Best regards,
Ivana Tomanickova