SQL XML
SQL XML Contents
Summary How to display the first three nodes of a XML file with XmlDocument?
Some websites only shows the latest 3 articles or news on their website. Mainly they are using a SQL Server as a backend. However the same task can be accomplished with XML. In this small example you will learn how you can retrieve only the top 3 XML items. The key is to use again the SelectNodes function, with the position function. position is a XPath function which returns the position of the current node. Here is the xml file I am using for that example.
Output:
description of the 1st news description of the 2nd news description of the 3rd news
As you can see the XML file contains 5 items, however only 3 are displayed.
Partners
Dream.In.Code dotNet Slackers dotNet Spider Your HTML Source VisualBuilder.com DevGuru Planet Source Code ZVON.ORG Web Design ASPAlliance XML Pitstop Scripts
The Spot 4 SAP Bitshop Web Hosting