Click to See Complete Forum and Search --> : some XML questions


v[E]r5e
01-26-2005, 04:19 AM
i am pretty new to XML but would like to try it out anyway. i have a few questions here...

Is there a way to manipulate the data between the tags in XML files through PHP dynamically? I don't mean all the tags in the xml file. I am just saying one of the tags in a xml file. is this possible?

Does XML largely used as data purposes? If yes, what are the advantages of using XML versus mySQL as database?

When the XML file is fed on your site, is there a way to disallow other website to feed your rss file? Or it must be public since it is something similar to html?

russell
01-27-2005, 12:47 AM
Is there a way to manipulate the data between the tags in XML files through PHP dynamically?check out PHP.Net (Is there a way to manipulate the data between the tags in XML files through PHP dynamically?) Does XML largely used as data purposes? If yes, what are the advantages of using XML versus mySQL as database?XML is used to transport data. It is a mistake to use it as a data store. Use a database.

v[E]r5e
01-27-2005, 08:15 AM
thanks...

Just checked out the manual by searching around and found that I could do that with the new simpleXML functions PHP had bundled with PHP 5 and above versions. Is this the only set of functions I can do that? This is because some of the hosts may not have upgraded their PHP to version 5 yet.
I could only try that maybe on my system which I had installed with PHP 5.

However, in the manual, it doesn't state to have functions to like add element tags into an existing XML document. Is there a way to do that?

You mentioned that XML is used to transport data. Do you mean, for instance, like you have a set of records in your database. You get PHP to write from the database to a file. Is that something like this?
If this is the case, what is the purpose of doing this?
If this is not what 'transport' means, can you elaborate a little on this please? Thanks.

Also, what is XML usually used for? Can I have some example of cases which will show XML's usefulness?

Thanks a million... :)

russell
01-27-2005, 10:07 PM
by transporting the data, i mean from two disparate systems. let's say YOUR server needs to send MY server some data. We don't need to be worried about the platforms or programming languages we use. Maybe you use Java on a Solaris server, and I use VB on a Windows server. Makes no difference. We agree that the data will be sent via XML. I tell you the format I want it in, and you format it as such. There are several well-defined formats we could use (SOAP (http://www.w3.org/TR/soap/)is probably the most common), or we could define our own. You send the XML via a HTTP Post, and I receive it, parse it and do whatever it is i do with the data.

XML is also "self-describing" -- for example

<customer id="10001">
<name>Russell</name>
<city>San Francisco</city>
<state>CA</state>
</customer>
you know exactly what the data represents.

There are other excellent transport medium besides XML, but it's primary value is in it's flexibility.