XMLGram.Match et AfterInternalInstruction
Bonsoir,
Dans un projet XMLRAD 2005 dernière release, IIS5, WinXP, SharpDevelop, C# :
J'ai une instruction Match qui doit matcher des éléments <item>.
Après chaque <item> rencontré, un gestionnaire AfterInternalInstruction exécute du code et doit injecter un nouvel élément dans l'élément <item> courant.
Code:
1 2 3 4 5 6 7 8 9 10
| private void FormReaderRSS_AfterInternalInstruction(XMLCLX.IXMLInstruction XMLInstruction, XMLComponent.TAfterInternalInstructionEventArgs e)
{
DateTime dt;
if (XMLInstruction.Name == "Items")
{
dt = Convert.ToDateTime(Context.GetValue("pubDate"));
e.Output.SetValue("pubDateFormatted",dt.ToString("dd/MM/yyyy"));
}
} |
Le problème est que dans mon XML résultat, je retrouve ma donnée insérée après mes éléments <item>, et non à l'intérieur de chaque élément <item> :
Code:
1 2 3 4 5 6 7 8
| <item>
<title>Cutting Edge: Implement Custom Cache Dependencies in ASP.NET 1.x</title>
<link>http://msdn.microsoft.com/msdnmag/issues/04/07/CuttingEdge</link>
<description>Cutting Edge: Implement Custom Cache Dependencies in ASP.NET 1.x</description>
<creator>Dino Esposito</creator>
<pubDate>Tue, 15 Jun 2004 00:00:00 GMT</pubDate>
</item>
<pubDateFormatted>18/07/2000</pubDateFormatted> |
(<pubDateFormatted> aurait du se trouver en tant qu'élément enfant de <item>, non ?
Merci pour vos éventuelles suggestions,
Sylvain