[an error occurred while processing this directive]
[an error occurred while processing this directive]
Welcome to rokni.com  

XML and XSL, why and how?

Why? well, I am not going to tell why XML is cool, instead, what I can do is linking you to this article "Why XML?" from xml.com.

But how? that's a good question. I am going to post some pages that I've created and you may find useful as an example of XML, XSL, XSLT and CSS.

Keep in mind that to learn XML and XSL, you need to know html (of course if you want to transform data to html format) and css very well and what I mean by very well is that you have to be very precise in your html coding/programming, because first of all, XML doesn't tolerate any mistake on spelling and inconsistency and as you may know XML page has to be well-formed and valid, and second, XSL combines XML elements with html elements and can use css to create a style for it (it's lot easier to maintain whole site using css).

The result would be an html page which any browser can read. Needless to say that in this way you separate data from formatting, so you make it easy to transfer data in a fashionable way without any modification to the data. Wow!!! What a lecture.

For example, an XML/XSL/HTML version of my resume is one of those pages. It uses Apache Cocoon which is an XML publishing framework that raises the usage of XML and XSLT technologies for server applications. So, as a result of transforming, you will see an HTML output.

Another example of another application is the same version of my resume which uses Apache AxKit. It is an XML Application Server for transforming XML documents by XSLT to HTML or other forms. So, as a result of transforming, you will see an HTML output.

Please visit (Again, Hello World) page to see the source code for XML and XSLT as well as XSLT in action.
There is another page (resume as you may expect but dated) which uses XML codes, DTD and CSS (it's a valid css) working on Opera, Mozilla -latest version- and Internet Explorer. Check it out.

Recently, I have done a short project to use some functions of XSLT with XML data collection capabilities. The object was/is to enter some data using xml, then using some xslt math functions to get total sum of those numeric data and transform to different format (minutes to hour) while it finally generates an html page to create a processed form,(wow, another long boaring lecture. Wait, read the rest of it, I will post yet another interesting note about how this works or suppose to work).

To do the job locally I have used Saxon and used Cocoon online, therfore I have changed some codes. For example, I used with Saxon xsl:text with disable-output-escaping equals to "yes" CDATA   as non brake space which didn't work with Cocoon, so I have changed it to shim.gif.

I will do more stuff (add some other cool functions to see how they work) later as I am digging more deeply, also, I want to create a valid xhtml page using xslt and css to use more of margin and padding instead of shim gif or   so it would accessible better. Also, the source code is availble at this place to look.

There are very good sources for getting more information about these topics, you can check W3C's Extensible Markup Language (XML) , W3C's Extensible Stylesheet Language (XSL) , W3C's Cascading Style Sheets.

I have installed AxKit on my server at my system to transform XML documents by XSLT to HTML or other forms. So, as a result of transforming, you will see (when ever the server is running -not much recently-) my resume as an HTML output. Although, it should transform those files in the run time but seems it needs more time to do this job, as a result some times you see "500 Internal Server Error"(Note).

Finally, I am getting ready to install (on my server) Xalan-Java which is an XSLT processor for transforming XML documents into HTML, text, or other XML document types. It implements the W3C Recommendations for XSL Transformations (XSLT) and the XML Path Language (XPath). It can be used from the command line, in an applet or a servlet, or as a module in other program.

Note: If you encounter a "500 Internal Server Error", when you are visiting the XML/XSL running on my server reload (hit the browser's refresh button) the page and of course be patient.

By the way, most of the time my server is off the net.