Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Spring Framework | Web Services | BioInformatics | Java Server Faces | Jboss 3.0 tutorial | Hibernate 3.0 | XML
 
 
Hot Web Programming Job

 

Tutorial Categories: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML

Features

Technology
  Tech. Home
  GPS
  OSI
  WiMAX
  VoIP
  WiFi
  HSDPA
  LBS
  Vehicle Tracking
  SCADA
  Tech. What is?
Jobs At RoseIndia.net!
 
Join For Newsletter

Powered by groups.yahoo.com
Visit Group! Post Questions!

XML Elements

                         

XML Elements are extensible. They have relationships. They have simple naming rules.

XML Elements are Extensible

XML documents can be extended to carry more information.

 

 

 

 

 

 

Look at the following XML example:

<?xml version="1.0" encoding="ISO-8859-1"?>
<E-mail>
<To>Rohan</To>
<From>Amit</From>
<Body>Be ready for a cruise...i will catch u  tonight</Body>
</E-mail>

Let's suppose that we create an application to fetch data from the above  XML document and produce this output:

E-mail

To: Rohan
From: Amit

Be ready for a cruise...i will catch u  tonight

Now, the author wants to add a new feature (let it be a subject line). He can easily achieve it by adding one more tag ie..<Subject>in the xml document. So the new modified xml document will look like this :

<?xml version="1.0" encoding="ISO-8859-1"?>
<E-mail>
<To>
Rohan</To>
<From>Amit</From>
<Subject>Surprise....</Subject>
<Body>Be ready for a cruise...i will catch u  tonight</Body>
</E-mail>

Now the new generated output will look like this

E-mail

To: Rohan
From: Amit

Subject : Surprise....

Be ready for a cruise...i will catch u  tonight

XML Elements have Relationships

Elements in a xml document are related as parents and children.

Imagine that this xml document is a description of a e-mail:

<?xml version="1.0" encoding="ISO-8859-1"?>
<E-mail>
<To>
Rohan</To>
<From>Amit</From>
<Subject>Surprise....</Subject>
<Body>Be ready for a cruise...i will catch u  tonight</Body>
</E-mail>

Here, E-mail is the root element while To, From, Subject and Body are the child elements of the E-mail. Here, E-mail is  the parent element of  To, From, Subject and Body. To, From, Subject and Body are siblings (or sister elements) because they have the same parentage. Hence , all the XML Elements have Relationships.

XML Element Naming : Know-hows

XML elements must follow these naming conventions:

Names must not start with a number or punctuation character but it can contain letters, numbers, and other characters without spaces. Names must not start with the letters xml (or XML, or Xml, etc)

                         

Facing Programming Problem?
Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

0 comments so far (post your own) View All Comments Latest 10 Comments:

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification

Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2007. All rights reserved.