Basic XML question

This is a discussion on "Basic XML question" within the Other Programming Languages section. This forum, and the thread "Basic XML question are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > Other Programming Languages

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Nov 22nd, 2005, 10:49
Junior Member
Join Date: Nov 2005
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Basic XML question

Hello folks,
I have an xml feed which is formated in an .xsl document and then it is displayed with a asp page.
I'm trying to display the top 10 results from the feed but I'm unsure how to do this. I tried putting a loop in the asp file but it didn't work for me. So I'm guessing the loop was to be placed in the xsl document? Anyone know what the code would be or where I find further information about it? here is my .xsl code :
Code: Select all
<?xml version="1.0" encoding="windows-1252" standalone="yes" ?>
<xsl:stylesheet xmlns sl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" indent="yes" omit-xml-declaration="no"/> 
<xsl:template match="InfoStreamResults">
<xsl:apply-templates select="Article"/>
</xsl:template>
<xsl:template match="Article">
<A>
<xsl:attribute name="HREF">ItemPage.asp?ItemID=<xsl:value-of select="@ID"/></xsl:attribute>
<B><xsl:value-of select="Heading"/></B></A>
<br/> 
</xsl:template>
</xsl:stylesheet>
Apologies for the basic question, I'm fairly new to XML.
Thanks
Fogo

Last edited by benbacardi; Nov 22nd, 2005 at 16:21. Reason: Changing quote tags to code tags
Reply With Quote

  #2 (permalink)  
Old Nov 23rd, 2005, 08:01
Highly Reputable Member
Join Date: Jul 2003
Location: Ipswich, UK
Posts: 690
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Basic XML question

Could you post your asp code, i imagine it would be easiest to do it in asp.
Reply With Quote
  #3 (permalink)  
Old Nov 23rd, 2005, 08:58
Junior Member
Join Date: Nov 2005
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Basic XML question

Hi smokie,

Heres my asp code:

Quote:
<%@Language="VBScript"%>
<HTML>
<HEAD>
<TITLE>Project3 - Sector News</TITLE>
</HEAD>
<BODY>
<%
'-- Simple decalration of variables and initial HTML Output
Dim XMLDom
Dim XSLDom
'-- Instantiate two XML Parser Objects
Set XMLDom = Server.CreateObject("MSXML2.DomDocument.4.0")
Set XSLDom = Server.CreateObject("MSXML2.DomDocument.4.0")
XMLDom.async = False
XSLDom.async = False
XMLDom.setProperty "ServerHTTPRequest", true
'-- Load the XML data from your live URL
XMLDom.Load("http://feeds.directnews.org.uk/?ad96...2-ad546b2ed850")
'-- Load the XSL Stylesheet from the local directory
XSLDom.Load(server.mappath("StyleSheet1.xsl"))
Response.write XMLDom.TransformNode(XSLDom)
%>
</BODY>
</HTML>
Thanks

J
Reply With Quote
Reply

Tags
basic, xml, question

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
A couple of basic question- please. dhall Starting Out 7 Aug 17th, 2007 18:41
Basic JS question klonopin JavaScript Forum 1 Mar 15th, 2007 00:31
Very basic Links question rubyfruit Web Page Design 4 Sep 5th, 2006 23:17
basic form question antonyx Classic ASP 1 Aug 30th, 2006 14:18
Probably very basic CSS question JonRouston Web Page Design 3 May 18th, 2006 12:08


All times are GMT. The time now is 16:34.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43