Welcome to WebmasterWorld Guest from

Forum Moderators: httpwebwitch

Message Too Old, No Replies

Xml in a .php file



3:22 pm on Oct 25, 2005 (gmt 0)

10+ Year Member

I just started learning XML, XSL (mostly because i've started playing with ajax) I was wondering what the best way to integrate xml with PHP? Any help would be great


5:34 am on Oct 26, 2005 (gmt 0)

10+ Year Member

People have not answered my last post :¦

However, I try answering you:
You say, you already know XML syntax, PHP actually pulls latest information (records) from db and dumps that in XML structure (It's really easy; if you know what's XML structure/syntax is..); this file often named 'rss.php' can be syndicated remotely and obviously with latest information. I know just this.


12:28 pm on Oct 26, 2005 (gmt 0)

10+ Year Member

I guess the issue i'm really having is getting xsl and php to work together. Should I be using one or the other and not both?


5:34 am on Oct 27, 2005 (gmt 0)

10+ Year Member

XSL is for presentation (its for transforming) XML file into a presentable form to a user.
(Like CSS for HTML; but XSL is much more complex.)

PHP is for making XML document dynamic..

XML is for easy data sharing and data transport over the Web..

May be, let's wait some seniors to comment :)

Conscientious Reject

7:16 am on Nov 13, 2005 (gmt 0)

10+ Year Member

I think what superman is trying to ask is what extension should be used. I am also wanting to know this. Just as XSLT integrates XML into HTML after processed, PHP is also viewed as HTML on client-side after being processed. Can PHP further integrate the XSLT file to still be processed as HTML? Can you declare the document as XSLT, but save it with the PHP extension (.php), so that it can be interpreted on the client-side? Argh! I really wish I knew how to ask the good questions ... is anyone else having trouble with this?


10:35 pm on Dec 16, 2005 (gmt 0)

10+ Year Member

You can use PHP to call an xml file, apply the xsl to it and output the result as html, text etc.

I don't believe you can just call it as include, you have to use php xsl functions to produce an output.


1:49 pm on Dec 23, 2005 (gmt 0)

5+ Year Member

Php 5 comes with XML/XSL built in. There is no integration involved.

Featured Threads

Hot Threads This Week

Hot Threads This Month