Showing posts with label XSLT. Show all posts
Showing posts with label XSLT. Show all posts

Tuesday, January 4, 2011

XSLT - Transformation example

In my previous I have briefed about XSLT. Now let’s walk through how XSLT transformation is being done.
Let’s consider the following XML document. Here I have created a Company.XML as follows



Now we need to create an XSL style sheet as follows Company.xsl



Now we need to link the XSL style sheet with the XML document as follows.



If we have an XSL compliant browser, we can nicely transform XML document into XHTML. So here we have the output as follows

XSLT

XSL stands for EXtensible Stylesheet Language which is a style sheet language for XML documents. XSLT stands for XSL transformations. When we talk about XSLT, we come across the key words XML and XPath. Basically XSLT is a language for transforming XML documents into XHTML documents or other XML documents. XSLT uses XPath to find information in XML documents.

XSLT transforms a source XML document into another type of document type recognized by browsers like HTML or XHTML. With XSLT you can add/remove elements and attributes to or from the output file. You can also rearrange and sort elements, perform tests and make decisions about which elements to hide and display, and a lot more.

XSLT uses XPath to navigate through the documents to find the information. During transformation process, XSLT uses XPath to define parts of source document to match one or more predefined templates. Once a match is found it transforms the selected section onto a result document. All major browsers supports XML and XSLT.

Installing ASP.NET MVC

Installing ASP.NET MVC Before we dive deep into the ASP.NET MVC, let’s install it our development machine. This is very straight forwa...