By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,409 Members | 1,604 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,409 IT Pros & Developers. It's quick & easy.

variable in xml

P: n/a
How can I use a php-variable in an xml file?

In this case I need $_SERVER['PHP_SELF'].

--
Thanks
Jul 17 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Quadrupel wrote:
How can I use a php-variable in an xml file?

In this case I need $_SERVER['PHP_SELF'].


echo $_SERVER['PHP_SELF'];

? What else do you need?

--
Oli

Jul 17 '05 #2

P: n/a
Oli Filth wrote:
Quadrupel wrote:
How can I use a php-variable in an xml file?

In this case I need $_SERVER['PHP_SELF'].

echo $_SERVER['PHP_SELF'];

? What else do you need?


There is no echo in xml.

--
Jul 17 '05 #3

P: n/a
Quadrupel wrote:
Oli Filth wrote:
Quadrupel wrote:
How can I use a php-variable in an xml file?

In this case I need $_SERVER['PHP_SELF'].

echo $_SERVER['PHP_SELF'];

? What else do you need?


There is no echo in xml.


Well yes, and there's no PHP in XML either. If you want dynamic
information in an XML file, you have to create the file dynamically
using PHP (or ASP, etc. etc.)
--
Oli

Jul 17 '05 #4

P: n/a
Quadrupel wrote:
How can I use a php-variable in an xml file?

In this case I need $_SERVER['PHP_SELF'].


When you mean during an XSLT transformation, you can pass external variables
to the stylesheet and catch them there through <xsl:param /> elements.

For PHP4, see:

http://www.php.net/xslt_process

For PHP5, see:

http://www.php.net/manual/en/functio...-parameter.php
JW

Jul 17 '05 #5

P: n/a
Janwillem Borleffs wrote:
Quadrupel wrote:
How can I use a php-variable in an xml file?

In this case I need $_SERVER['PHP_SELF'].

When you mean during an XSLT transformation, you can pass external variables
to the stylesheet and catch them there through <xsl:param /> elements.

For PHP4, see:

http://www.php.net/xslt_process

For PHP5, see:

http://www.php.net/manual/en/functio...-parameter.php
JW


Thank you for the links.
The problem is the output should be xml files.
Maybe I'll create them with fopen.

--
Regards
Jul 17 '05 #6

P: n/a
You can also try to write a "re-write" rule for htaccess so that the
output file extension is xml and the content that generates it is php
code!

http://www.DevPlug.com --Connecting Developers
Posted from: http://www.devplug.com/ftopic32057.htm
Jul 17 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.