Forum Moderators: open

Message Too Old, No Replies

How to start tinkering with XSL

         

korkus2000

6:48 pm on Nov 22, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I am sure there are some people out there who are interested in breaking into the wonderful world of XML [w3.org], but they can’t play with it. On the surface XML is just a basic mark up language where you invent tags. If you know HTML then it is easy to create it. I looked at it and thought what is the use of this for me. If I was a backend programmer then I guess I can see the benefit, but for a front-end guy, XML is not helpful at all.

It wasn’t until I had to work with it in a real world environment that I could understand XML’s place and my place in the markup universe. As a designer, I was tasked with the job of doing something with this homebrew markup. I discovered XSL. XSL (eXtensible Stylesheet Language) [w3.org] allows you to use a XML parser to apply a stylesheet to convert the XML markup into a useable form. You can use CSS for this, but it does not have the power that XSL does.

To get started playing with XML and XSL you need a XML parser that will apply XSL to XML. There are a few out there. If you are on a windows box and are running IE 5.5 or higher I suggest MSXML parser [msdn.microsoft.com]. This is a great little add-on. You will perform translations in your browser like you view HTML. It is great for front-end people who don’t want to deal with server translation right from the start. In a deployment environment you will probably be using server translation, but to get started, that is confusing. It is a free download from Microsoft. There is also SAXON [users.iclway.co.uk] and Xalan [xml.apache.org] if you are not able to use MSXML.

Now XSL is quite different then HTML, JavaScript, CSS, and other web scripting and markup languages. It takes some time getting use to. It is a markup language so it feels like HTML, but it has programming power (It is scripting the XML parser). You really will be amazed at the complexity of the language.

Now you can use a text editor to write your XSL in, and starting out that maybe best. There are tools out there that help you. In one of my first posts [webmasterworld.com] at WebmasterWorld I got some great responses to what software was best for marking-up XSL. Personally I still use XMLSpy.

With XML and XSL you will have to start writing schemas or DTDs. These are the rules by which the processor interprets the XML. These maybe a little confusing, but if you do get XML or XSL software it helps a lot.

There are some excellent tutorials and resources out there to help you learn.
W3C XSL Site [w3.org]
w3schools [w3schools.com]
XML Files [xmlfiles.com]
Microsoft [msdn.microsoft.com]

Related WebmasterWorld Threads
Server-side XML Tutorial [webmasterworld.com]
XML optimisation [webmasterworld.com]
XML languages [webmasterworld.com]
Microsoft's XDoc [webmasterworld.com]
XSLT and the dreaded non-breaking space [webmasterworld.com]
New to XML [webmasterworld.com]
Using XML feeds [webmasterworld.com]
Xml [webmasterworld.com]
XML and SEO.. [webmasterworld.com]
XML Projects Underway [webmasterworld.com]
CSS + XHTML vs XML + XSLT [webmasterworld.com]
Xml/.net & www [webmasterworld.com]
A standardized set of elements for XML [webmasterworld.com]

So who is playing with it? Who's thinking about it? Are there any tips you would give for someone just starting the leap to XSL?

SuzyUK

7:08 pm on Nov 22, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've tried looking at it twice now, and have backed off both times :(

Korkus what are schemas, DTD's..I mean I know about the DTD that goes at the top of your HTML, but ..write your own?

I just don't see the use for XML so far (for me), I've been through one of the tutorials, and felt like I could use it as a small database, but then have given up again.

Can others say what they use it for, why it has benefits..etc..

I don't like to read lots off the Web, so I think I'll have to ask Santa for a book on this, any recommendations?

Suzy

korkus2000

7:15 pm on Nov 22, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



XML is quickly becoming the backend mark-up of choice for data. Databases, content collections, and application calls are all becoming XML based. In the future. XML is going to be thrown out of the server level application and it will be up to XSL to scrub it for all of its end uses.

DTDs or DOCTYPE declaration [w3.org] explains what all your made up tags mean and what is allowed by the xml and what is not. There is a good tutorial at w3schools [w3schools.com].

The schema [w3.org] language is meant to replace DTDs. I think it is better than DTDs. A good tutorial on schemas at w3schools [w3schools.com].

moonbiter

7:49 pm on Nov 22, 2002 (gmt 0)

10+ Year Member



I don't have much to add to this except some ancedotal experience:

The company I work for did an entire web application using XML / XSLT for the data and interface design. It rocked. I loved it, and the programmers loved it. Once we got the basic data structure down, they worked on the code, I worked on the interface, and never the twain did meet.

It was so much incredibly better than working on spaghetti code asp / php apps, because we almost never had to pass files back and forth between us to get things working.