TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 03-31-2008, 02:57 AM   #1 (permalink)
The Frequenter
 
Join Date: Dec 2007
Location: In my basement
Posts: 386
Thanks: 47
Aaron is on a distinguished road
Default PHP and XML?

I was just thinking about it, and... How can you form a page while "separating data from presentation"? Marking up a piece of data just for presentational purposes (in XML) is the same as using a tag like <sup> in HTML, yet the latter is frowned upon.

Anyway my question is: Can you use PHP in an XML file, or XML in a php file? How exactly would that work out...
__________________
Signatures are nothing but incriminating.
Send a message via MSN to Aaron
Aaron is offline  
Reply With Quote
Old 03-31-2008, 08:39 AM   #2 (permalink)
The Contributor
 
abiko's Avatar
 
Join Date: Feb 2008
Location: Croatia
Posts: 90
Thanks: 4
abiko is on a distinguished road
Default

Well.
Simple usage of XML is - you read data from it, you can structure it how you like.

For using php in XML file - sure - but you must use eval() for that code to be executed.
XML in a PHP file - XML must be in a string
PHP Code:
<?php
 $xml 
"
<?xml version="
1.0" encoding="utf-8"?>
<books>
 <bookInfo>
    <id>12</id>
    <name>The Test Name Of A Book</name>
    <price>18,45</price>
  </bookInfo>
</books>
"
;
?>
Parsing in now real easy using the PHP5s DOM or XPath.

Can you provide more detailed question :) Hope this cleared some things.
__________________
Back from sysadmins to the programmers.
Send a message via ICQ to abiko Send a message via MSN to abiko
abiko is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 07:01 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design