After I hit send I thought of something I should have added. The beauty
of doing it with PHP is that it becomes browser independent, which is
likely a drawback of doing it in straight javascript like I described.

Ken

-----Original Message-----
From: Ken Sanderson [mailto:[EMAIL PROTECTED] 
Sent: September 30, 2003 10:33 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-WIN] Re: XML->HTML using PHP

In order to use xslt_process your PHP must also support sablotron which
is the xslt extension that does the work.

Looking at your bit of code you don't actually need to that in PHP or
ASP, works fine in javascript. Here is a bit of code from one of my
scripts that's in an html page, all javascript. The params part is that
I am pulling the XML file to load from the URL, so you can ignore that
treat xmlfile as your xXml.

Ken

 var objXML = new ActiveXObject("Microsoft.XMLDOM");
 var domstyle = new ActiveXObject("Microsoft.XMLDOM");
 var params = location.search;  
 function loadxml(){
  var xmlfile = params.substr(params.indexOf("=")+1);
  objXML.async = "false";
  objXML.load(xmlfile);  
  
  domstyle.async = "false";
  domstyle.load("FGDC Classic.xsl");
  
  document.write(objXML.transformNode(domstyle)); 
 }




-----Original Message-----
From: news [mailto:[EMAIL PROTECTED] On Behalf Of hubo
Sent: September 30, 2003 6:52 AM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Re: XML->HTML using PHP

Hi,

you might want to have a look at the function

xslt_process

in your PHP Manual. There ist very easy sample.

Ciao

Hu Bo


"Thijs Koerselman" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> Hi,
>
> I'm new to this list and php so probably this is going to be a
"newbie"
question.
> I consider myself an intermediate C/C++ programmer and I know quite
some
> things about HTML and XML.
> A while ago I decided to make myself a flexible website using XML, and
I
> bumped into a cool tutorial in the MSDN about DXML. It is about
generating
> a dynamic menu bar, reading a TOC from an XML-file and combining
CSS/XSL/Jscript
> to generate HTML using server-side scripting.
> My problem is: It uses ASP to generate HTML from the XML/XSL files,
but
(ofcourse)
> I want to use PHP instead. I searched the in DOMXML for the same
functions
> but I just can't figure it out. Can someone please explain to me how
to
convert
> this simple code into PHP? Actually I'm only interested in the last
line.
>
> // sXml and sXsl are variables containing the filenames
>
> var oXmlDoc = Server.CreateObject("MICROSOFT.XMLDOM");
> var oXslDoc = Server.CreateObject("MICROSOFT.XMLDOM");
> oXmlDoc.async = false;
> oXslDoc.async = false;
> oXmlDoc.load(Server.MapPath(sXml));
> oXslDoc.load(Server.MapPath(sXsl));
> Response.Write(oXmlDoc.transformNode(oXslDoc));
>
> Thanx a lot,
> Cheers T
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to