HTML is certainly a well-known coding language used by site designers to generate internet pages and not to mention full web sites can be done applying html code alone. HTML is short for Hypertext Markup Language and has been made use of basically since the start of the net, but as the web has evolved, several common html practices also have evolved.
To illustrate, applying tables to design a web page was initially quite normal in the early days of the world-wide-web but as web browsers changed and technology improved, brand new approaches like CSS progressed to allow site designers to build web sites that could be shown in the same way across numerous internet browsers (browser compatibility) and also exactly the same internet browsers but different variants (version compatibility).
A further enlargement came with the development XHTML, an acronym for Extensibe Hypertext Markup Language, a more recent, more versatile version of HTML.
XHTML is part of the family of XML languages even though it is furthermore an extension of HTML, if not more closely relevant to html version 5.0, it is actually developed to perform far more robustly with xml dependent user agents and also properties.
XHTML will also be referred to as an application of XML as it is actually a more prohibitive subset of SGML, which means that unlike html, it is possible to parse xhtml documents by using a common xml tool, similar to an xml parser.
The only requirement is that the xhtml document should be well formed because there are specified xml rules to go by, whereas with html, you simply can't parse it unless you happen to be running a more lenient, html specific parser.
The main variation regarding xml and html is that xml is a markup language, there are no semantics involved and simply no rules as to what exactly could and can't be included, xml merely describes the data. Html conversely has semantic meaning and states how data and text is intended to be viewed.
For example, in html, you can only make use of the head tag to describe the header elements, where as all body components must be contained inside of the body tag, to incorporate a paragraph you have to include it within a paragraph tag, this is precisely what is meant by the term semantics. XML as, I have just mentioned, has absolutely no semantic tags or predetermined meanings, for instance inside an xml document your tags will be able to have any meaning as well as any data, you create your own tags.
Due to all these key differences, xml, unlike html, is not something that a person can look at with the naked eye on any website, instead it sits in the background, or the source code of the internet site, as internet websites grew to become more dynamic entities, not to mention the requirement to consume this data originated via completely different platforms, from tablets, to PCs to smart phones, XML turned out to be a lot more crucial to making certain that this information was ordered, stored and transferred in a dependable and universal approach.
Xhtml satisfied an important objective and was in fact made for a number of purposes. The principal good reason had been to fix the compatibility gap between a client computer and a webpage on a remote computer, a language was needed that could transport and express the meaning of data on a web page to a pc, xhtml filled this need.
The next reason was basically to satisfy the gap for a standard language format which might be properly viewed across various internet browsers and platforms as well as on different screen types, again xhtml satisfied this particular requirement beautifully.
With the huge selection of various gadgets, from smart phones, PCs, laptops, tablets, not to mention distinct internet browsers from Internet Explorer to Mozilla, and variants from IE7 to IE8, it is extremely critical for any would be web designer to migrate from html to xhtml development to permit your websites to display effectively across all platforms and browsers.
Friday, 21 September 2012
Thursday, 20 September 2012
Newbies Guide To Employing XSLT
XSLT is short for extensible stylesheet language transformations, and it is an highly flexible and handy technique that claims numerous benefits in particular when applied to tackle the proper troubles.
So that you can get you started, all you need to have is the appropriate overview to the basic principles of XSLT to assist you get started out, and once you do, you surely won’t look back, it will definitely turn into one of the most invaluable tools in your programming tool bet.
And so why might you use XSLT and what can it achieve? In really basic terms, XSLT is a transformation dependent formatter which makes it possible for you to change structured XML documents straight into different output formats, for example into HTML or CSV and so on.
For the purposes of this short article we are going to take a look at the capacity of XSLT to transform or alter XML records into HTML. We are going to employ an XML file to illustrate the attributes of a product (e.g. the Name, Short Description, Long Description, Downloads, Licensing Options, System Requirements, etc.) and also a series of XSLT files to display them.
Right, firstly let’s put together our own very straightforward XML document for a product, and you can develop it up from there. For the time being, all we will cover is the product title, version, and short description. You are able to create more later on should you feel brave enough.
<product code="Spt001">
<title>htmltrans</title>
<version>2.0</version>
<short_desc>
The product spt001 enables transformation of regular text to html and vice versa
</short_desc>
</product>
So that’s our basic XML document all set up, then were ready to operate with XSLT and carry out some basic functions
Now that we have got the basic XML document set up, let me look at what we could do using XSLT.
XSLT, like virtually all other XML-based formats, is pretty fastidious about its structure. Your simple XSLT document appears just like this:
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" />
<xsl:template match="/">
Rules go in here...
</xsl:template>
</xsl:stylesheet>
Well the above illustration is a pretty simple and common xslt file, anyone can see we have declared the XSLT stylesheet and version. In the fourth line we have also told the parser to output the result as HTML.
Observe we also have a xsl:template component declared in the 5th row.
Bear in mind that XSLT is a rules-based language, so in compliance with the principles, the parser will move through the xml file and implement the needed rules(template) to the appropriate elements (the match).
Good, that is it for this article, as said, we dealt with the essentials of XSLT, therefore now you are able to generate your own file and produce the contents of an HTML file.
I really should also point out that one of the main plus points of XSLT is the potential to produce multiple views on the same xml file. For example, a single product.xml file that stores the product information, downloads, screenshots, and more could be utilized for a product summary page, the downloads list, a screenshot gallery, and more.
The key advantage of this procedure is that adding or adjusting a product does definitely not mean any presentation changes--only data ones, which is a sizable gain and indeed time and cost saving for any company.
An XSLT processor (like Liquid XSLT Debugger), will unquestionably parse the input XML record, as well as the XSLT style sheet and also subsequently applying the elements from input XML document, process the rules or instructions which will be within the XSLT style sheet. All through the processing of the XSLT instructions, a structured XML output is produced.
So that you can get you started, all you need to have is the appropriate overview to the basic principles of XSLT to assist you get started out, and once you do, you surely won’t look back, it will definitely turn into one of the most invaluable tools in your programming tool bet.
And so why might you use XSLT and what can it achieve? In really basic terms, XSLT is a transformation dependent formatter which makes it possible for you to change structured XML documents straight into different output formats, for example into HTML or CSV and so on.
For the purposes of this short article we are going to take a look at the capacity of XSLT to transform or alter XML records into HTML. We are going to employ an XML file to illustrate the attributes of a product (e.g. the Name, Short Description, Long Description, Downloads, Licensing Options, System Requirements, etc.) and also a series of XSLT files to display them.
Right, firstly let’s put together our own very straightforward XML document for a product, and you can develop it up from there. For the time being, all we will cover is the product title, version, and short description. You are able to create more later on should you feel brave enough.
<product code="Spt001">
<title>htmltrans</title>
<version>2.0</version>
<short_desc>
The product spt001 enables transformation of regular text to html and vice versa
</short_desc>
</product>
So that’s our basic XML document all set up, then were ready to operate with XSLT and carry out some basic functions
Now that we have got the basic XML document set up, let me look at what we could do using XSLT.
XSLT, like virtually all other XML-based formats, is pretty fastidious about its structure. Your simple XSLT document appears just like this:
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" />
<xsl:template match="/">
Rules go in here...
</xsl:template>
</xsl:stylesheet>
Well the above illustration is a pretty simple and common xslt file, anyone can see we have declared the XSLT stylesheet and version. In the fourth line we have also told the parser to output the result as HTML.
Observe we also have a xsl:template component declared in the 5th row.
Bear in mind that XSLT is a rules-based language, so in compliance with the principles, the parser will move through the xml file and implement the needed rules(template) to the appropriate elements (the match).
Good, that is it for this article, as said, we dealt with the essentials of XSLT, therefore now you are able to generate your own file and produce the contents of an HTML file.
I really should also point out that one of the main plus points of XSLT is the potential to produce multiple views on the same xml file. For example, a single product.xml file that stores the product information, downloads, screenshots, and more could be utilized for a product summary page, the downloads list, a screenshot gallery, and more.
The key advantage of this procedure is that adding or adjusting a product does definitely not mean any presentation changes--only data ones, which is a sizable gain and indeed time and cost saving for any company.
An XSLT processor (like Liquid XSLT Debugger), will unquestionably parse the input XML record, as well as the XSLT style sheet and also subsequently applying the elements from input XML document, process the rules or instructions which will be within the XSLT style sheet. All through the processing of the XSLT instructions, a structured XML output is produced.
Friday, 7 September 2012
An Uncomplicated Explanation Of XSLT
XSLT is an acronym for XML Stylesheet Transformations, the XML element represents Extensible Markup Language.
XML signifies Extensible Markup Language which is, as the name implies, a markup language, XML operates as a general-purpose markup vocabulary that has been the industry-standard method of organizing data files to transport around the world wide web.
XSLT can be described as a programming vocabulary for changing your XML documents into several other document formats for example VB, C or even C#. This is achieved by making use of another programming language, identified as Xpath query language.
XPath is a query language helpful to navigate through elements and attributes within a XML document and also for picking nodes from an XML document. In addition, XPath may be used to estimate values (e.g., strings, numbers, or Boolean values) out of the content of the XML document. without having understanding of XPath, you simply will not be capable of create XSLT documents.
The process of transforming your XML making use of the XPath includes an XSLT processor reading the XML document along with the XSLT style sheet, and then based mostly on the layout directions the processor locates in the XSLT style sheet, it is going to make, or output, a new XML document. In reality, by means of special support for HTML, you can in fact output an HTML document.
The process functions due to the fact the XSLT detects each XML document as a tree structure and so turns one XML tree, into another XML tree. To work, XSLT assumes that there are three documents in use; the source XML document, the XSLT style sheet as well as the altered document.
The actual source document needs to be a well-formed XML document, that is to meaning, it needs to be correct XML, in order for the input to be accepted and the conversion to be successful.
The style sheet contains the transformational guidelines that the processor needs to work with in order to yield the new document out of the source XML document. The final result is a text document that is produced by passing the source document by means of the changes written in the XSLT style sheet.
To sum up, XSLT, the extensible style sheet language for transformations, is a language that offers the process to change and shape XML data. It is used to transform XML documents into another documents, for instance other XML document, HTML document or text document.
An XSLT processor (like Liquid XSLT Debugger), will parse the input XML document, as well as the XSLT style sheet and then utilizing the elements from input XML document, process the rules or guidance that are in the XSLT style sheet. In the course of the processing of the XSLT instructions, a structured XML output is created.
In case you are using .Net, you can in fact, execute this change using a set of techniques known as “Load” and “Transform”, originated from XslTransform class. At first an XslTransform object is instantiated (in development terms, it is any time you make an instance of a variable), in which is the engine to carry out XSLT conversions on XML documents in the .NET structure. The “Load” way of the XslTranform is utilised to load the XSL style sheet from disk.
XML signifies Extensible Markup Language which is, as the name implies, a markup language, XML operates as a general-purpose markup vocabulary that has been the industry-standard method of organizing data files to transport around the world wide web.
XSLT can be described as a programming vocabulary for changing your XML documents into several other document formats for example VB, C or even C#. This is achieved by making use of another programming language, identified as Xpath query language.
XPath is a query language helpful to navigate through elements and attributes within a XML document and also for picking nodes from an XML document. In addition, XPath may be used to estimate values (e.g., strings, numbers, or Boolean values) out of the content of the XML document. without having understanding of XPath, you simply will not be capable of create XSLT documents.
The process of transforming your XML making use of the XPath includes an XSLT processor reading the XML document along with the XSLT style sheet, and then based mostly on the layout directions the processor locates in the XSLT style sheet, it is going to make, or output, a new XML document. In reality, by means of special support for HTML, you can in fact output an HTML document.
The process functions due to the fact the XSLT detects each XML document as a tree structure and so turns one XML tree, into another XML tree. To work, XSLT assumes that there are three documents in use; the source XML document, the XSLT style sheet as well as the altered document.
The actual source document needs to be a well-formed XML document, that is to meaning, it needs to be correct XML, in order for the input to be accepted and the conversion to be successful.
The style sheet contains the transformational guidelines that the processor needs to work with in order to yield the new document out of the source XML document. The final result is a text document that is produced by passing the source document by means of the changes written in the XSLT style sheet.
To sum up, XSLT, the extensible style sheet language for transformations, is a language that offers the process to change and shape XML data. It is used to transform XML documents into another documents, for instance other XML document, HTML document or text document.
An XSLT processor (like Liquid XSLT Debugger), will parse the input XML document, as well as the XSLT style sheet and then utilizing the elements from input XML document, process the rules or guidance that are in the XSLT style sheet. In the course of the processing of the XSLT instructions, a structured XML output is created.
In case you are using .Net, you can in fact, execute this change using a set of techniques known as “Load” and “Transform”, originated from XslTransform class. At first an XslTransform object is instantiated (in development terms, it is any time you make an instance of a variable), in which is the engine to carry out XSLT conversions on XML documents in the .NET structure. The “Load” way of the XslTranform is utilised to load the XSL style sheet from disk.
Subscribe to:
Posts (Atom)