Monday, 15 October 2012

XML Elements And Ways To Develop Them

Elements are also the key building blocks of XML and is also one of several benefits XML provides over other languages. In XML you may create your very own element tags to match your own requirements.

With other languages, like HTML or PHP, you can just use predetermined labels which are particular to that language. In HTML by way of example you are only have body elements within the <body> tag and header elements inside the <head> tag. This is certainly tough and even time intensive and means you need to comprehend the language and syntax as well as where it goes to create web pages.

This is where XML is special, you can make your own personal elements and title these to suit your own purposes, allowing it to be entirely possible for newbie’s to grasp and apply XML.

So what are XML elements? Pretty much elements are names that are assigned to areas of data or information. As an example, let’s say you want to develop a catalogue of all your household items for insurance applications.

You could potentially try to portion items by room after which further sub divide by value etc. In XML the parser will look at the construction compared to names of the elements, in HTML it will be the other way round, the labels will be more significant for the parsing to be successful.

While XML is a lot more focused on structure, versus naming conventions, you'll still have to comply with some fundamental guidelines when creating elements. The first element is considered as the root; the root element consists of all the other elements inside it, similar to a folder contains sub folders and files.

After the root, the following element is called the parent and inside the parent are child elements, not all parent elements have to have child element, it will be at your discretion and is determined by how and just what you want to design your XML for.

The key point to creating a XML file that can be easily parsed is with the organisation, you need to make your elements to make sure they appear sensible from a structural perspective.

For example if you're a constructing a stock list of your products, it might make more sense to have products as your root element and then the categories as the parent and then individual category products as the child elements.

Having a well laid and common sense structure is going to pay off in the long term when you need to handle updates or parsing as all the elements will naturally fit into place.

Along with element structure and naming, its also wise to keep the following easy tips in mind too.

Each and every element tag requires a opening and closing syntax ie <xml> and </xml>, if you forget you will receive an error message whenever you try and validate or parse your xml file.

Be sure you organize your element names intelligently and rationally. Name your tags in a means by which is smart to you.

Root element

Parent element

Child element

Two parent elements for the product stock list could have child tags named ‹product›. In fact, parent names may also be the same.

Product - root element

Item - parent element

Item - parent element

So that’s a rapid and straightforward look at xml and how to write an xml file, to study more advanced material, you can search Google or view this xml tutorial.









Wednesday, 3 October 2012

9 Very Important Terminology In XML

In contrast to the popular myth about XML, it's not actually a development language, it is a mark-up language, and as a result, essentially the most least complicated computer language around.

XML is really a non semantic language therefore, you can develop your own element tags and in contrast to other languages there isn't any real complex syntax structures to think about.

Given it isn’t a programming language, XML itself doesn’t really do anything, by design, it’s really a storage container for data and so it only comes up as very simple text on web pages or as a text file.

You can also utilize XML to properly exhibit pages around distinct internet browsers and version types, to do this you have to compose different formatting directions, known as DTD.s or Schemas.

Dealing with XML and building basic files is really rather simple if you can learn the basic principles, below is a glance at 9 of the most well-known XML words that you may run into.



 
1.    XML (Extensible Mark-up Language

As already stated, xml is a markup language that works as a container for the holding of data and allows data and information to be transported and displayed on the online as webpages. Within XML their can also be subsets of languages including XSL which supports in validation and formatting.


2.    Element Tags

You may make as well as name your element tags as you desire as well as suit your own specific requirements. Element tags enable you to build a hierarchical syntax and order to your code.

By way of example, let’s say you wished to have a stock list of your stock items for your ecommerce bike shop website, you can use key tag names like product, and also within the product tag element, you can have child elements like men’s bikes, women’s, child bikes etc.

The beauty and simpleness of XML is in its ability to build your own element tags, just be sure you close them.

<product> - element tag

</product> - closing tag



 

3.    Declaration Statement

The declaration statement ought to be at the beginning of your xml file, the aim of the declaration statement is to specify the language, version as well as designate encoding and declare the standalone status of the file, without it the Internet processor will not be able to determine the code.

<xml version="1.0" encoding="UTF-8" standalone="yes">


4.    Root Element

The root element, like the title indicates is the very first named tag of every XML file and it's a container for all other elements, consequently it is in the root.

<products> - root element


5.    Parent Element

The parent tag retains elements linked to the root, and so within our example of products, the parent would be the associated categories or products.

<products> - parent element

<mens bike> - element tag


6.    Child Element

The child element is so called, given it belongs to the parent element and thus, is situated inside it.

<products> - root/parent element

<mens bike> - parent element

<cube bike> - child element

 
7.    Attributes
An attribute is a name or value that sits within the element tag, in our example an attribute could be frame size of the bike or the colour style.

<cube bike size="20"> - cube bike is the element and size is the attribute


8.    Comments
Comments will be only viewable in the source and are generally mostly for editors and authors who want to update or customize the xml file, comments are not exposed on a webpage

<!--this is a comment -->


 
9.    Data Strings

A data string will be the complete opposite of a comment in that it is viewable on the webpage, a data string in this context is the equivalent of the description field.

<description> - element tag

Extensive range of cube bikes available. - data string viewable on a webpage

</description> - closing tag

So that’s an easy and easy look at xml and the best way to create an xml file, to study more advanced material, you can search Google or check out this xml tutorial.

















Friday, 21 September 2012

Going Ahead Of HTML TO XML

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.



















































































































































































































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.



















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.























Monday, 13 August 2012

The Experts & Cons Of Making use of XML With DOM, ASP & XSL

XML is a mark-up language that had been devised originally as method for carry and also display data separately of any software or platform, its underpinning objective was to enable richly structured documents to be viewed over the internet in a absolutely consistent fashion, regardless of the internet browser utilized or even the browser version. Nevertheless right now developers continue to dispute the value of XML over HTML and whether or not we need XML at all.

Yet concerns to one side, XML is considerably stronger than HTML for the reason that its significantly more adaptable, HTML offers, and indeed predefines, rigid tags for your data, as an example title should be contained inside the title tag, body elements ought to be contained within the body tag and so forth.

XML nevertheless helps you construct your own tags as it only specifies the standards with which you can define your tags, which means you utilize any description you wish to label your tags or containers and you could specify an endless selection of languages founded on the standards that happen to be defined by XML, and for that reason XML is a lot more like a meta-mark-up language.

 

Strengths Of XML
XML has a range of major advantages, the most noteworthy and also obvious of which include;

•    You are totally free to employ your own mark-up elements or tags and will be able to even mark-up tags on the fly that formerly did not exist.

•    XML provides far superior and significantly richer facilities for browser presentation and performance.

•    XML provides incredible compression abilities that are considerably larger than HTML or standard text which provides XML a overall performance advantage in data streaming.

•    XML data is a great deal more vibrant and rich simply because of the better hypertext linking functionality of XML versus HTML.


Weaknesses of XML

As well as its advantages, XML also has a amount of disadvantages, the most prominent and apparent of which include things like;

•    XML can be astonishingly large and burdensome, which unfortunately is why in some areas such as web services, JSON has grown to be the chosen choice.

•    XML is not yet wholly developed to provide total flexibility in engaging in any programming task, in terms of full standards compliance. XSL and XSLT are a step in the correct track nevertheless they also are far from being in a suitable state.

•    XML Hypertext Transfer Protocol (XML-HTTP) complications continue to exist.

Over-all XML is a significantly more advanced way of working with data, even so if you are going to be developing XML based web applications it is important to comprehend the disadvantages and demands that might possibly impact the functioning of any XML server.

For example the kind of data, the ratio of tags to text, attributes to elements not to mention even the quantity of waste white space can all influence on the capabilities of any kind of XML server.

One more excellent factor with XML is the the introduction of DOM, thanks to Microsoft, DOM stands for for Document Object Model and is invaluable tool for loading and parsing XML files. DOM is a superb way to browse through your files, to gather information and to manipulate those files.

It’s in addition a fantastic way to work with your XML files and in particular is best for generating and displaying XML documents using code such as ASP and Visual Basic, you may furthermore utilize XML VB tools such as MSMXL and Liquid XML Visual Basic to aid in parse, edit and create your VB code from your XML.

Tuesday, 7 August 2012

An Uncomplicated Account of XML And Visual Basic

Visual Basic is an exceedingly important programming language and thus it is worthy of further deliberation and also explanation. Nonetheless to be more exact, Visual Basic by far the most regularly used programming language in the world.

The most obvious reason for this success is due in great part due to the simplicity, you can create simple effects like “Hello Word” in just a few lines of code rather than several thousand, its simple and easy does the job with minimum fuss and complexity.

The latest variation of Visual Basic is Visual Basic 6, a bye product of Microsoft’s Visual Studio. Surprisingly Visual Basic features no native support for XML, a common and popular markup language but nonetheless, Visual Basic is now being regarded by a good number of coders as a good way to work with XML.

Despite the fact VB features absolutely no component or apparatus to read, write or make xml, or even a data engine to assist or even operate with xml, you will find parsers (MSXML parser or Liquid XML Studio) that you can use to work with VB and XML as it exposes the same interfaces in VB as with XML.

XML Parsers just like the Microsoft MSXML parser and Liquid XML Studio, do the job by using the DOM or Document Object Model. The DOM is constructed of 5 various essential pieces, attributes,documents, elements, nodes and nodelists.

Every one of these has got their own unique programmatic interfaces (specifically, DOMDocument, IXMLDOMNode, IXMLDOMNodeList, IXMLDOMElement, and IXMLDOMattribute), each of which reveal a number of methods and properties.

For instance, the DOMDocument interface is made for coping with loading and saving of XML files (through .load, .loadXML--which changes an XML structured string into an internal DOMDocument--and .save), and the IXMLDOMElement interface handles referencing attributes, content text, and element children, and offers a beginning point for generating XPath queries.

Xpath is regarded as the favored choice for XSLT users when trying to pick out nodes with an xmltree. This capability to pull nodes out of an XML DOM is the main reason that parsers are extremely popular, the MSXML parser can carry out Xpath queries which enables it to reference any nodes within an xmltree using rather complex queries.

XML is hierarchical by nature and so whilst it would appear easy enough to populate and represent XML as a tree, this isn't always the case in reality you may not need to accomplish this, by way of example you will prefer to bypass some braches or nodes.

In reality, you might simply want to develop a treeview structure that displays only the most relevant nodes, you might furthermore wish to be able to choose the nodes, causing more in depth information to appear in the right hand pane of your application. This is typical of most Explorer-type applications.

One way where you can achieve this is to code the desired functionality that will expose your XML, directly into your program. Even so this isn’t ideal and may actually cost time and effort because you must recompile your application every time you want to change the display, worst still it means fooling with heaps of unpleasant DOM code. The best option will be to move the layout instructions to an XSLT stylesheet which will subsequently style the xml data into a format well suited for processing.

Conversely you should use any of the preferred xml vb parsers or if you need to generate code from your XML, try Liquid XML Visual Basic to generate your VB code automatically.