473,394 Members | 1,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

PHP & XML

I am trying to prepare for my third year project which basically
consists of a dynamic web site where people can log in and create
profiles, also being able to administer the site so that statistics
can be obtained, the details of which are irelavent.

I have been learning php & mysql do implement the project and I
"thought" the end product would be in HTML however I have since
learned it must be in XML.
So now I am trying to learn as much XML as I can and am slowly coming
to grips with it. However the link I see between PHP and XML seems
quite fuzzy. As the end result must be in XML it is just a straight
swap between inserting PHP code into my XML document as it is with
HTML or is it more complicated than that?
Cheers!
Jul 16 '05 #1
2 2749
> I am trying to prepare for my third year project which basically
consists of a dynamic web site where people can log in and create
profiles, also being able to administer the site so that statistics
can be obtained, the details of which are irelavent.

I have been learning php & mysql do implement the project and I
"thought" the end product would be in HTML however I have since
learned it must be in XML.
So now I am trying to learn as much XML as I can and am slowly coming
to grips with it. However the link I see between PHP and XML seems
quite fuzzy. As the end result must be in XML it is just a straight
swap between inserting PHP code into my XML document as it is with
HTML or is it more complicated than that?
Cheers!

You can't have a website "in XML" as such - it can use XML, but you need
something to convert that to html or to format the XML, which would be XSL.
I assume therefore that the idea is to store the website contents in XML,
and just format that using either XSL or using PHP to make it into a normal
HTML / XHTML page.
Anyway, generating XML with PHP is just a case of writing it as a file
called .xml instead of .htm (if you are generating static pages using PHP).
You just need to be aware of the tags and make sure the format of the XML is
right otherwise you'll run into all sorts of problems. I find it best to
write a page of what I need just as normal html / xhtml / xml or whatever
and then put in the code to make up that page with PHP dynamically.
If you have the XML on the server, and want to read it into PHP which will
use the values to output to a standard HTML page then you'll need to use the
xml functions of PHP. I assume thats the bit you've been reading up on. It
takes a while to get the hang of it, but I actually went through the same
thing last night, going from having never even really looked at an XML
document to writing them, and using them in a PHP page in a little under 5
hours. The reason for using it in PHP and outputting a standard page means
that it will have less possible problems - not sure if that would count as
using XML in your case. Basically, this uses it for storing the data, but
your project may require you to use it to actually serve the data too, in
which case you'd have to generate the XML, and then use an XSL page to
format it clientside.
Hope this is some help - if you can provide an example of what you need to
store, where you need to use XML, and what is in your database and what is
regenerated each page, then I might be able to offer more specific advice.

David

Jul 16 '05 #2
bi****@hotmail.com (David) wrote in message news:<3e**************************@posting.google. com>...
I am trying to prepare for my third year project which basically
consists of a dynamic web site where people can log in and create
profiles, also being able to administer the site so that statistics
can be obtained, the details of which are irelavent.

I have been learning php & mysql do implement the project and I
"thought" the end product would be in HTML however I have since
learned it must be in XML.
So now I am trying to learn as much XML as I can and am slowly coming
to grips with it. However the link I see between PHP and XML seems
quite fuzzy. As the end result must be in XML it is just a straight
swap between inserting PHP code into my XML document as it is with
HTML or is it more complicated than that?
Cheers!


Although PHP is used mostly to generate HTML directly it is also
possible (with the current version) to output XML and have this
converted into HTML using an XSL transformation. See the following
articles for details:

http://www.tonymarston.net/php-mysql/domxml.html - Using PHP's DOM XML
functions to create XML files from SQL data.

http://www.tonymarston.net/php-mysql/sablotron.html - Using PHP's
Sablotron extension to perform XSL Transformations.

Tony Marston

http://www.tonymarston.net/
Jul 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Collin VanDyck | last post by:
I have a basic understanding of this, so forgive me if I am overly simplistic in my explanation of my problem.. I am trying to get a Java/Xalan transform to pass through a numeric character...
1
by: DrTebi | last post by:
Hello, I have the following problem: I used to "encode" my email address within links, in order to avoid (most) email spiders. So I had a link like this: <a...
0
by: Thomas Scheffler | last post by:
Hi, I runned in trouble using XALAN for XSL-Transformation. The following snipplet show what I mean: <a href="http://blah.com/?test=test&amp;test2=test2">Test1&amp;</a> <a...
4
by: Luklrc | last post by:
Hi, I'm having to create a querysting with javascript. My problem is that javscript turns the "&" characher into "&amp;" when it gets used as a querystring in the url EG: ...
4
by: johkar | last post by:
When the output method is set to xml, even though I have CDATA around my JavaScript, the operaters of && and < are converted to XML character entities which causes errors in my JavaScript. I know...
8
by: Nathan Sokalski | last post by:
I add a JavaScript event handler to some of my Webcontrols using the Attributes.Add() method as follows: Dim jscode as String = "return (event.keyCode>=65&&event.keyCode<=90);"...
11
by: Jeremy | last post by:
How can one stop a browser from converting &amp; to & ? We have a textarea in our system wehre a user can type in some html code and have it saved to the database. When the data is retireved...
14
by: Arne | last post by:
A lot of Firefox users I know, says they have problems with validation where the ampersand sign has to be written as &amp; to be valid. I don't have Firefox my self and don't wont to install it only...
12
by: InvalidLastName | last post by:
We have been used XslTransform. .NET 1.1, for transform XML document, Dataset with xsl to HTML. Some of these html contents contain javascript and links. For example: // javascript if (a &gt; b)...
7
by: John Nagle | last post by:
I've been parsing existing HTML with BeautifulSoup, and occasionally hit content which has something like "Design & Advertising", that is, an "&" instead of an "&amp;". Is there some way I can get...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.