Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

seeing xml in web page

Status
Not open for further replies.

tag141

Technical User
Oct 4, 2003
119
AU
I am creating an xml file from an ASP page which is then viewed in a HTML page inside a table. It all works really well, in fact too well. Everytime I add data from the ASP page it adds another record in the table and shows all entries in the xml file. However I would only like to show the most recent record.

Is this possible? and if it is can you point me to a possible solution/tutorial

TIA.
 
previous post assumes you are using xsl - in which case you could use

xml:

Code:
<root>
<myelement>one</myelement>
<myelement>two</myelement>
</root>

Code:
<xsl:value-of select="/root/myelement[position()=last()]"/>

or, depending on how you are creating the xml

Code:
<xsl:value-of select="/root/myelement[position()=1]"/>

if, however you are using dom - then use the same xpath to get to the element

hth

simon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top