Showing posts with label XML. Show all posts
Showing posts with label XML. Show all posts

Wednesday, September 9, 2009

Using Stylesheets in XML- CSS & XSLT

XML is a means of exchanging data between applications. It allows the developers to describe and structure their data in their own formats. As the XML gave more emphasis on data rather than formatting, the data in the XML document can be formatted in two ways:

  • USING CSS
  • USING XSL

Cascade Style Sheet( CSS):


Initially, Cascading Style sheets (CSS) were used for formatting the data in the XML documents. It allows the Web Developers to define a formatting for the elements in XML and the same can be applied to as many documents you like. The advantages are:

  • It has a Precise control over presentation
  • It is Resolution Independent
  • It downloads Faster
  • It is easy to maintain

Though it has a lot of advantages it also has following disadvantages.

  • The order of elements for display cannot be changed
  • An element cannot be processed more than once
  • Generated text cannot be added to the presentation

Extensible Stylesheet Language (XSL):


The difficulties that were encountered with CSS were removed by making use of XSL. XSL is an application of XML It allows you to create high performance XML based systems by integrating Server side XML processing’s. The need for transforming data from one format to the other results in splitting XSL into two groups:

  1. XSLT – It describes how to transform XML. Document into other formats.
  2. XSL-FO- It describes formatting details of each element in the XML document.

XSLT:


The XML Style sheet Language Transformation (XSLT) is a mechanism of transforming one form of XML documents to the other form. It is a set of templates based on Xpath expressions that tells how to fetch a particular node from the XML documents. It is a part of XSL, which is a style sheet language for XML. XSLT is widely used in Websites Content Management to convert XML into HTML pages. It uses Xpath to define parts that match one or more templates. Xpath is an query language that allows you to identify the nodes. It can select nodes in any direction. An XSLT processor is used to perform transformations of XML document in to other formats based on the given XSLT document.



XSL_FO:


XSL-FO means Extensible Formatting Objects. There are two different ways in which the XML document can be formatted. They are:

  • Layout Based formatting
  • Content Based formatting

In a layout based formatting, the limitations of the target may constrain the content or appearance on the page, whereas in a Content Based Formatting, the target medium is generated to accommodate the information being formatted. The XSL FO allows you to make formatting and styling options to your document.

Read more...

Sunday, September 6, 2009

Is XML a Database?

XML document is a collection of data. In other words it doesn’t make much difference between the other files that store data. A XML in a database format is a self describing, portable, and can describe data in tree or graph structure. XML is a sort of Database Management System (DBMS).



XML provides storage, schemas, query languages, programming interfaces and so on .It lacks in triggers, queries, multi-user access that a real database constitutes. The main advantage of XML is that the data is portable and it allows you to have nested entries.



XML allows you to preserve physical document structure, supports document level transactions and execute queries in an XML query language.



Mapping the XML document schema to the database schema does the transfer of data between XML documents and a database. Mappings between document schemas and database schemas are performed on attributes and text. There are 2 mappings that are generally used to map on XML document schema to the database schema:

  1. TABLE BASED MAPPING
  2. OBJECT RELATIONAL MAPPING

Native XML databases are designed especially to store XML documents .It is always possible to store data in XML documents in a native XML database. This is done so, when your data is semi-structured. Although, this kind of data can be stored in object oriented and hierarchical databases, it is always better to store it in a native XML database. It enables us to retrieve data much faster than a relational database. One more reason is to store data in a native XML database is to exploit XML specification capabilities, such as executing XML queries.

Read more...

Monday, August 31, 2009

What is XML and What Good is XML?

What is XML?
XML stands for eXtensible Markup Language and is a descendant of Standard Generalized Markup Language (SGML), just as HTML is. The most noticeable difference between XML and HTML is the fact that you can define your own tags in XML. That is why XML is considered an extensible language. Because of the freedom of the tags, however, the way in which XML must be written is very strict. Every tag must have a closing tag and all nodes must be ordered properly. If any of these rules are broken, an XML document will simply fail to function. HTML, as many have found, will work even if the document only vaguely looks like an HTML document.

What good is XML?
XML is all about structure. The markup in XML defines what the data represents (i.e. The Catcher in the Rye). HTML, on the other hand, is made for publications. Hence, in HTML, it makes sense to order information by where and how it will appear on the screen. In XML, however, the structure of the information is what's most important. The order of the information is unimportant - it can be displayed in whatever order you want. The important thing is that each piece of data is contained in markup that describes what that data really represents. The structure can be maintained much more easily in XML because of the fact that you can create your own tags.

Think of a book you've read recently. The chapter titles were most likely in bold print. We come to rely on these sorts of conventions to give us a sense of the structure of the document. When you're dealing with a web page, you have to make the structure evident to the reader to help them deal with the information. By using XML, you can easily keep track of information like chapter titles because they will all be contained in markup designating what they are (i.e. Ch. 1 - The Beginning). You can then choose to display that information in whatever way will make it easiest for your reader.

That's what XML is all about: structure.

Read more...

Popular Posts

  © Blogger templates The Professional Template by Ourblogtemplates.com 2008

Back to TOP