RE: Re: XML->HTML using PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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:news@sea.gmane.org] On Behalf Of hubo
Sent: September 30, 2003 6:52 AM
To: php-windows@lists.php.net
Subject:  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" <soundboy@tiscali.nl> schrieb im Newsbeitrag
3F4D79AC00013935@ocpmta8.freegates.net">news:3F4D79AC00013935@ocpmta8.freegates.net...
> 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


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux