Forum Moderators: mack

Message Too Old, No Replies

XML data into HTML using XSL.?!?!?!

How do I do it?

         

plopsybunny

7:11 pm on Jul 4, 2007 (gmt 0)

10+ Year Member



Hi all,

Please please can you help me out? I've been looking all over and this seems as if it should be simple but all I seem to get are error messages...

I needs to display address and contact details on a web page which will then be searchable by site visitors.

I don't mind if I use PHP or simply the XSL and XML files to create the HTML pages. Can anyone give me a starting point?

Many, Many Thanks :)

eelixduppy

5:02 am on Jul 7, 2007 (gmt 0)



>> I don't mind if I use PHP

If you have PHP 5 you can use SimpleXML [php.net] which is very nice for handling XML files. :)

Marshall

5:10 am on Jul 7, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You could also use ASP. Place the code in the .asp page at the point you want the informaiton inserted, or it can be a page unto itself, say www.yourwebsite.com/file.asp:

<%
'Load XML
set xml = Server.CreateObject("Microsoft.XMLDOM")
xml.async = false
xml.load(Server.MapPath("file.xml"))

'Load XSL
set xsl = Server.CreateObject("Microsoft.XMLDOM")
xsl.async = false
xsl.load(Server.MapPath("file.xsl"))

'Transform file
Response.Write(xml.transformNode(xsl))
%>

Marshall