Tuesday, February 2, 2010

What is XSL?

Answer
XSL is a language for expressing style sheets. An XSL style sheet is a file that describes the way to display an XML document.
Using XSL stylesheets, we can separate the XML document content and its styling.
An XSL style sheet begins with the XML declaration:

defines that the document is an XSLT style sheet document.
The element defines a template.

Define CSS and XSL.

Answer
XSL is a language for expressing style sheets. An XSL style sheet is a file that describes the way to display an XML document.
Cascading Style Sheets is an answer to the limitations of HTML, where the structure of documents was defined and not the display. CSS formats documents for display in browsers that support it.

How do you display XML with XSLT?

Answer
First you need to declare the XSL style sheet:

xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
Then,
you create an XSL Style Sheet with a transformation template.
Add the XSL style sheet reference to your XML document to link them.

What is XQuery?

Answer
Xquery is a query language that is used to retrieve data from XML documents.
XQuery is a way to query the XML data, It is built on XPath expressions and is supported by quite a few database engines.
It can find and extract elements and attributes from XML documents.
XQuery is written in FLWOR fashion which stands for: For, Let, Where, Order by, Return
An example of XQuery is:
for $x in doc("abc.xml")/abc_name
where $x/a>30
order by $x/b
return $x/c

0 Comments: