Dim id As String = Page.Request.QueryString.Get("article") 'Ici on passe "200910001"
'le nom du fichier XML est au format News_AAAAMM.xml. L'id d'un article est AAAAMMXXX où XXX est un incrément pour chaque article de ce mois.
Dim article As New XPathDocument(MapPath("~/App_Data/News_" & id.Remove(6) & ".xml"))
Dim navigator As XPathNavigator
Dim iterator as XPathNodeIterator
Dim expr as XPathExpression = XPathExpression.Compile("/news/entry[@id='" & id & "']")
navigator = article.CreateNavigator()
iterator = navigator.Select(expr)
While iterator.MoveNext()
Page.Response.Write(iterator.Current.Name & " : " & iterator.Current.Value & "<hr />")
End While |