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

Tuesday, November 23, 2010

SOAP

Simple Object Access Protocol (SOAP) uses XML to define the protocol fro the exchange of information in distributed computing.
SOAP consists of three components:
  1. Envelpe
  2. A set of encoding rules
  3. A convention for reresenting remote procedure calls

Tuesday, November 16, 2010

Open an XML File using Internet Explorer

  • Open the Notepad and type in the following
<name>
<first>John</first>
<last>smith</last>
</name>
  • Save the document to your hard drive as name.xml. If you are using Windows XP, be sure to save as Type drop-down to All Files.
  • You can open the file in Internet Explorer.

Thursday, November 4, 2010

SGML

SGML is Standard Generalised Markup Language. It is the international standard for defining descriptions of the structure of different types of electronic document.

XML is a lightweight cut-down version of SGML which keeps enough of its functionality to make it useful but removes all the operational features which made SGML too complex to program for in a Web environment.

XML is an abbreviated version of SGML, to make it easier to use over the Web, easier for you to define your own document types, and easier for programmers to write programs to handle them.

Wednesday, November 3, 2010

XML Tags

The information in XML document is contained within various tags that constitute the markup of the document.

XML Tags begin with <> sign, that is not inside a comment or a CDATA session.

The tags are paired, so that any opening tag must have a closing tag. The end-tags are same as start-tags except that they have a / right after the opening < character.

All of the information from the beginning of the start-tag to the end-tag, and including every thing in between is called an element.

The text between start-tag and end-tag is called the element content.

XML Tag Rules

  • All well-formed XML document must have at least one element.
  • Maintain case within a tag set.
  • XML elements may contain other elements but the nesting of elements must be correct.
  • Tags Naming
  1. Tags should begin with either a letter, an underscore(_) or a colon (:) followed by some combination of letters, numbers, periods (.), colons, underscores, or hyphens (-) but no white space. It is also a good idea to not use colons as the first character in a tag name even if it is legal.
  2. Names cannot contain spaces.
  3. Names can't start with the letters xml, in uppercase, lowercase, or mixed. you can't start a name with xml, XML, XmL or any other combination.
  • Define Valid Attributes
Tags may specify any number of supporting attributes. Attributes, must not duplicate in any one tag, specify name/value pair delimited by equal (=) sign in which the value is delimited by quotation marks.

XML Document Structure

XML Documents are composed of set of "entities", that are identified by unique names. All documents begin with a "root" or document entity. All other entities are optional.

XML Documents have a logical structure. Logically, documents are composed of declarations, elements, comments, character references, and processing instructions, all of which are indicated in the document by explicit markup.

XML Declaration is included as the first line in the document. It defines the XML Version of the document. In this case the document is of 1.0 version.

XML groups information in hierarchies. The items in the document relate to each other in parent/child and sibling/ sibling relationship.

Root element: First element of the document is called Root element. This element is the "the parent" of all other elements.

XML Tree starts at the root and branches to the lowest level of the test.

<root>
<child>
<subchild>...</subchild>
</child>
</root>

The terms parent, child and sibling are used to describe the relationship between elements. Parent elements have children. Children on the same level are called siblings (brothers or sisters).


All XML documents must have a root tag.

XML structure is called tree, and any parts of the tree that contain children are called branches, while parts that have no children are called leaves.

XML Element

Elements are the basic unit of XML content. Syntactically, an element consists of a start tag, and an end tag, and every thing in between.

The start tag consists of a name surrounded by angle brackets. The end tag consissts of the same name surrounded by angle brackets, but with a slash preceding the name.

XML defines the text between the start and end tag to be "character data"

Tuesday, November 2, 2010

XML Attributes

XML Attributes

XML attributes provide additional information about elements. Attributes are always contained within the start tag of an element.

Atttributes are name-value pairs that are separated by an equals sign(=). They may occur inside start-tags or empty tags, but never inside end-tags.

Attributes must have vales - even if that value is just an empty string (such as "") - and those values must be in quotes.

Either single quotes or double quotes are fine, but they have to match.
Example:
<input checked='true'>
or
<input checked="true">
but you can't use
<input checked="true'>

XML Comments

If you want the processor to ignore and if you want to put character data in your document, then we use XML Comment tag.

Syntax XML Comments

<!-- This is a comments -->

Rules that needs to be remembered for writing the comments

1. You should never have "-" or "--" within the text of your comment, as it might be confusing the XML processor.
2. Never place a comment within a tag.
3. Never place a comment before the XML Declaration

XML Introduction

XML stands for Extensible Markup Language. XML is designed to describe data. XML tags are not predefined, you can define your own tags.

XML is actually a meta languague - a language for describing other languages - which lets you design your own markup languages.

XML is sometimes referred to as 'self-describing data' because the names of the markup elements should represent the type of content they hold.

XML Document example

<?xml version="1.0">
<employee>
<name>akhila</name>
<rollno>501</rollno>
</employee>

Common Uses of XML

1. Information Identification

Since you can define your own markup, you can define meaningful names for all your information.

2. Information storage

XML can be used to store textual information across any platform.

3. Information structure

XML can be used to store and identify any kind of (hierarchical) information structure especially for long, deep, or complex document sets or data sources, making it ideal for information management back-end to serving the Web.

4. Publishing

XML has the benefits of robut document management and control (with XML) and publish to the Wen (as HTML) as well as to paper (as PDF) and to other formats (eg., Braille, Audio, etc) from a single source document by using hte appropriate stylesheets.

5. Messaging and Data Transfer

XML is very heavily used for enclosing or encapsulating information in order to pass it between different computing system.

6. Web Services
Because of its use in browsers, machine processable data can be exchanged between consenting system. Weather services, e-commerce sites, AJaX sites and thousands of other data-exchange services use XML for data management and transmission.

7. e-Commerce
Companies are discovering that by communicating via the Internet, instead of by more traditional methods (such as faxing, human-to-human communication, and so on) they can streamline their processes, decreasing costs and increasing response times. Whenever one company needs to send data to another, XML is the perfect format for exchange.

8. Distributed Computing
XML can be used as a means for sending data for distributed computing, where objects on one computer call objects on another computer to do work. There have been numerous standards for distributed computing such as DCOM, CORBA, and RMI/IIOP, but as using XML and HTML through web services and/or SOAP enables this to occur even through a firewall.