The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Thanks for the link but I did not find any answer if it is base on the computer of the user or the server? I mean, like javascripts which depends on the user's computer and like PHP which depends on the host of the site.

Re: What is XML?

Originally posted by friend_al_23 Does a server need to have it to have XML? Is it installed in the computer of the user or the server? When did XML evolved? How do you do XML? I heard it can work with PHP.

It works both on server-side and client-side. In order to process XML on the client side you need a browser which supports XML. At this point at least IE6 and Netscape 6.x are supporting it (don't ask me how good the support is). In order to make XML data available for other browsers you should transform the XML data to HTML on the server side. This is done by using XSLT and some other language, like Java, PHP, ASP ... In general this is better option since browsers XML support is still pretty weak. If you want to learn XML, follow the link Winged Spider gave you.

----------------
XML can only be used in the latest version of IE and Netscape browsers since they are the only one that supports it. You make the code and then try to convert it in the server using the said application into PHP, ASP, JSP, etc.
---------------

friend_al_23 says:
XML can only be used in the latest version of IE and Netscape browsers since they are the only one that supports it. You make the code and then try to convert it in the server using the said application into PHP, ASP, JSP, etc.

XML is a format for schematically representing data. It can be used for multiple purposes in any number of applications. In most cases the user does not view XML directly -- instead, a front-end is created to display the information represented by the XML object in a manner compatible with a specific medium. NASA, for instance, is using a subset of XML to control satellites in space. On the Internet you might use XML to distribute news feeds. The client's server would retrieve the XML object from the news feed server and parse it into HTML code that matches their Website layout.

It's pure data, along with tags that describe what kind of data it is. I.e. the <name> tag defines "John Doe" as name data.

XML is mostly useful for transferring data between different systems, since it's totally platform independent.

It can also be used to format web pages, using XSL. XSL is kind of like a very advanced style sheet. You write an XML file with the content, and a XSL file which contains the design, and then, you smack them together, and viola! A web page!

The latest browsers can put XML and XSL together, but it's much better to let the server do it before it is sent to the user (as XHTML).

Devshed has a great tutorial on how to create a XHTML page from an XML file and a XSL file:

Originally posted by friend_al_23 How long exactly did it take you to learn XML? Did you learn it on your own? If yes, how?

Like I said, XML is just a plain text file with custom tags. There is really nothing to learn about it, except what it is. What you can learn is to interpret it and parse it, which is different in every application.

Slashdot provides XML feeds of it's news, for instance. Apaches config files are in XML format. Socket connections in Flash are done by sending the data in XML format. There are many different applications of XML, and LOTS of ways to parse and use it.

Like I said, XML is just a plain text file with custom tags. There is really nothing to learn about it, except what it is. What you can learn is to interpret it and parse it, which is different in every application.

I would say there is actually lot's to learn before you can say you master XML. Doing a well formed XML document is pretty straightforward, but what about adding some DTD/Schemas ? What about XPath, DOM, XSL ...

friend_al_23 : You asked how long it's gonna take to learn it. This ofcourse depends. I would say I'm still learning it and the learning curve has been quite long but only because my studying has been quite occasional. You should first check out tutorials about XML like the one Winged Spider told you. Others might be Zvon.org, WDVL or XMLDir. Then you might just want to buy a book about XML if you get more interested about it.

I would say there is actually lot's to learn before you can say you master XML. Doing a well formed XML document is pretty straightforward, but what about adding some DTD/Schemas ? What about XPath, DOM, XSL ...

Oh, yes, of course. XML in itself is very easy, but as I said, there are lots of ways to treat XML, such as Xpath, DOM and XSL, indeed. However, there is nood need to know any of those to use XML, really. It has lots and lots of applications.

XML is a data markup format, not a language, and it is mostly theory, not implementation.

XML can come in many forms, from AIML to VoiceML, where each format is a set of tags that control a certain type of data. You can write your own XML formats as well.

Do not confuse the use of XSL and DTDs with XML itself, as they are assistance providers to XML formats. A DTD is most often used for validation of an XML format, making it possible for many systems to understand a single XML format, like RSS, for example. A DTD is not required for any XML format, particuarly if you only use the XML yourself, but if you plan on letting other people read your XML schema, make a DTD, it is handy.

As Marshall said, XML is rarely seen by users. It was created to be completely machine readable, and not user dependent.

The most prevalant forms of XML seems to be RSS & RDF - 2 flavors of headline syndication schemas, which enable sites to easily share headlines with other sites. VoiceML is going to be a big XML format in the near future, as more sites comply with accessibility standards, etc.

If you do HTML (by HAND), then you pretty much know XML theory. Then it is a matter of learning how each XML schema is used. If you are writing a validator, then you would want to learn about DTDs and well-formedness, etc. Learning XSL and things like that is another matter entirely, and really don't have anything to do with learning XML per se.

The language you choose to use with XML is purely a matter of just that, a choice. Just like you choose what HTML editor you like to use, you can select with language you deal with XML in. You can write XML by hand, just like HTML, you can use scripts to read and write XML, or you can write programs to do it. It is a matter of preference and implementation. Just about every language can deal with XML, in one way or another, from ASP to Python.

Would XML be the solution? It looks like nesting subsections within sections seems to fit right it, but would using XML actually achieve anything (i.e. easier maintenance)? And how easy would it be for PHP to parse it into HTML?

I'd love to see you write an article giving examples of how to use XML, including not only a sample of an XML markup page but HOW one would go about using XSL (or similar) interpreter. Is this a script? Can anyone use it? Does a host have to install it or can Joe Scmoe use it? Etc.

I am fascinated by XML and want to use it. I don't know that I have the ability to install XSL on my server as I cannot install APPS (I don't think). I can install scripts and code and if it's a matter of copying something to a server, I can do that. Running an executable on a server I don't think I have permission to do. Clarifications of details like this would make for an awesome article for the Crier!

I'd love to see you write an article giving examples of how to use XML, including not only a sample of an XML markup page but HOW one would go about using XSL (or similar) interpreter. Is this a script? Can anyone use it? Does a host have to install it or can Joe Scmoe use it? Etc.

I am fascinated by XML and want to use it. I don't know that I have the ability to install XSL on my server as I cannot install APPS (I don't think). I can install scripts and code and if it's a matter of copying something to a server, I can do that. Running an executable on a server I don't think I have permission to do. Clarifications of details like this would make for an awesome article for the Crier!

Whoa - thank you for you confidence in me. I'm in no way a XML lord, but I could probably write an article on how to "merge" an XML file and a XSL slylesheet into HTML using PHP. It's not very hard, really.

The best/most simple way yo do this is using Sablotron engine for PHP. You just install sablotron on the server, and then do this:

And viola - you have an HTML page! I find this to be the best way to process XML and XSLT.

If you can't install software on your host (or make them to), and you wish to use XML, you should switch to another host. If that is not a possibility,
you could parse the XML using something called expat functions. However, this is not efficient, and hard as hell, and I have not personally figured out how to do it myself.