IT Community - Software Programming, Web Development and Technical Support

XML Tips

This is a discussion on XML Tips within the XML and SOAP forums, part of the Web Development category; We started new thread for XML related tips and also issue handling so guys post some new information related to ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > XML and SOAP

Register FAQ Members List Calendar Mark Forums Read
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 02-04-2008, 02:00 AM
vadivelanvaidyanathan vadivelanvaidyanathan is offline
D-Web Genius
 
Join Date: Feb 2007
Posts: 803
vadivelanvaidyanathan is on a distinguished road
Default XML Tips

We started new thread for XML related tips and also issue handling so guys post some new information related to XML
__________________
V.Vadivelan

There never a wrong time to do the right thing.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 02-11-2008, 02:21 AM
sundarraja sundarraja is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Posts: 174
sundarraja is on a distinguished road
Thumbs up Re: XML Tips

What is XML?

XML stands for EXtensible Markup Language
XML is a markup language much like HTML
XML was designed to carry data, not to display data
XML tags are not predefined. You must define your own tags
XML is designed to be self-descriptive
__________________
R.Sundar Raja
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-11-2008, 02:22 AM
sundarraja sundarraja is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Posts: 174
sundarraja is on a distinguished road
Thumbs up Re: XML Tips

What is the difference between XML and HTML?


XML is not a replacement for HTML.
XML and HTML were designed with different goals:

XML was designed to transport and store data, with focus on what data is.
HTML was designed to display data, with focus on how data looks.

HTML is about displaying information, while XML is about carrying information.
__________________
R.Sundar Raja
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-11-2008, 02:25 AM
sundarraja sundarraja is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Posts: 174
sundarraja is on a distinguished road
Thumbs up Re: XML Tips

XML is Used to Create New Internet Languages:


Here are some examples:

1. XHTML the latest version of HTML
2. WSDL for describing available web services
3. WAP and WML as markup languages for handheld devices
4. RSS languages for news feeds
5. RDF and OWL for describing resources and ontology
6. SMIL for describing multimedia for the web
__________________
R.Sundar Raja
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-11-2008, 03:15 AM
vigneshgets vigneshgets is offline
D-Web Genius
 
Join Date: Mar 2007
Posts: 904
vigneshgets is on a distinguished road
Thumbs up Re: XML Tips

Hui guys can anybody let me know What is XSNL?
__________________
Vignesh
$Live It The Way You Love It$
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-11-2008, 03:17 AM
vigneshgets vigneshgets is offline
D-Web Genius
 
Join Date: Mar 2007
Posts: 904
vigneshgets is on a distinguished road
Thumbs up Re: XML Tips

Difference between XML and HTML :

" XML

User definable tags

Content driven

End tags required for well formed documents

Quotes required around attributes values

Slash required in empty tags



HTML

Defined set of tags designed for web display

Format driven

End tags not required

Quotes not required

Slash not required
__________________
Vignesh
$Live It The Way You Love It$
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-11-2008, 03:19 AM
vigneshgets vigneshgets is offline
D-Web Genius
 
Join Date: Mar 2007
Posts: 904
vigneshgets is on a distinguished road
Thumbs up Re: XML Tips

Rules for making a tag name in XML :

" Rules for making a tag name are

1.It should start with a letter or underscore(_)
2.There are no reserved words , but however xml(in any case) should not be used as a tag name
3.It can include digits, hyphen,periods, ':' can be used but best avoided because it is used for the namespace.
__________________
Vignesh
$Live It The Way You Love It$
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 02-11-2008, 03:26 AM
vigneshgets vigneshgets is offline
D-Web Genius
 
Join Date: Mar 2007
Posts: 904
vigneshgets is on a distinguished road
Thumbs up Re: XML Tips

Differences between SAX and DOM parsers :

Both SAX and DOM are used to parse the XML document. Both has advantages and disadvantages and can be used in our programming depending on the situation

SAX:

1. Parses node by node

2. Doesnt store the XML in memory

3. We cant insert or delete a node

4. Top to bottom traversing

DOM :

1. Stores the entire XML document into memory before processing

2. Occupies more memory

3. We can insert or delete nodes

4. Traverse in any direction.

If we need to find a node and doesnt need to insert or delete we can go with SAX itself otherwise DOM provided we have more memory.
__________________
Vignesh
$Live It The Way You Love It$
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 02-11-2008, 03:36 AM
vigneshgets vigneshgets is offline
D-Web Genius
 
Join Date: Mar 2007
Posts: 904
vigneshgets is on a distinguished road
Thumbs up Re: XML Tips

Schema :

"SCHEMA is nothing but METADATA. The schema holds all the information of the xml file that is to be deployed in the project. Metatdata is nothing about data about data since we know that xml is used for data representation language we will be able to understand what metadata is. Metadata includes the tags that is going to be exchanged to and fro from another xml file. "
__________________
Vignesh
$Live It The Way You Love It$
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 02-11-2008, 03:37 AM
vigneshgets vigneshgets is offline
D-Web Genius
 
Join Date: Mar 2007
Posts: 904
vigneshgets is on a distinguished road
Thumbs up Re: XML Tips

Limitations of a DTD :

" DTD (DATA TYPE DEFINITION ) which supervises two conditions namely well formedness and closeness of the xml file. So the user should be aware of what tags he was put into use of this xml file 'A' should be intimated to another application's XML file 'B', by then our xml file will interact with the another xml file, this is the major limitation and mandatory issue that the developers should follow. "
__________________
Vignesh
$Live It The Way You Love It$
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #11 (permalink)  
Old 02-11-2008, 03:41 AM
vigneshgets vigneshgets is offline
D-Web Genius
 
Join Date: Mar 2007
Posts: 904
vigneshgets is on a distinguished road
Thumbs up Re: XML Tips

XML file :

" SAX, event based XML parser is probably what is needed to search huge file. DOM store the whole content on memory which is in huge file is not good since it uses a lot of memory. SAX is event based that handle XML elements when it find it."
__________________
Vignesh
$Live It The Way You Love It$
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 02-11-2008, 03:46 AM
vigneshgets vigneshgets is offline
D-Web Genius
 
Join Date: Mar 2007
Posts: 904
vigneshgets is on a distinguished road
Thumbs up Re: XML Tips

CDATA section in XML :

"CDATA in XML is the character data is is not parsed by the XML Processor. If there is a section in the document that you do not want the XML processor to parse, then it can be enclosed in
<![CDATA[ ......................]]> "
__________________
Vignesh
$Live It The Way You Love It$
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13 (permalink)  
Old 02-11-2008, 04:30 AM
vigneshgets vigneshgets is offline
D-Web Genius
 
Join Date: Mar 2007
Posts: 904
vigneshgets is on a distinguished road
Thumbs up Re: XML Tips

Entity Referencing :

" Referencing the entity by name causes it to be inserted into the document in place of the entity reference. To create an entity reference, the entity name is surrounded by an ampersand and a semicolon, like this:
&entityName; "
__________________
Vignesh
$Live It The Way You Love It$
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #14 (permalink)  
Old 02-11-2008, 08:19 PM
vadivelanvaidyanathan vadivelanvaidyanathan is offline
D-Web Genius
 
Join Date: Feb 2007
Posts: 803
vadivelanvaidyanathan is on a distinguished road
Default Re: XML Tips

The XML DOM

The XML DOM (XML Document Object Model) defines a standard way for accessing and manipulating XML documents.

The DOM views XML documents as a tree-structure. All elements can be accessed through the DOM tree. Their content (text and attributes) can be modified or deleted, and new elements can be created. The elements, their text, and their attributes are all known as nodes.

In the example below we use the following DOM reference to get the text from the <to> element:

xmlDoc.getElementsByTagName("to")[0].childNodes[0].nodeValue

* xmlDoc - the XML document created by the parser.
* getElementsByTagName("to")[0] - the first <to> element
* childNodes[0] - the first child of the <to> element (the text node)
* nodeValue - the value of the node (the text itself)
__________________
V.Vadivelan

There never a wrong time to do the right thing.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #15 (permalink)  
Old 02-11-2008, 08:19 PM
vadivelanvaidyanathan vadivelanvaidyanathan is offline
D-Web Genius
 
Join Date: Feb 2007
Posts: 803
vadivelanvaidyanathan is on a distinguished road
Default Re: XML Tips

The HTML DOM

The HTML DOM (HTML Document Object Model) defines a standard way for accessing and manipulating HTML documents.

All HTML elements can be accessed through the HTML DOM.

In the example below we use the following DOM reference to change the text of the HTML element where id="to":

document.getElementById("to").innerHTML=

* document - the HTML document
* getElementById("to") - the HTML element where id="to"
* innerHTML - the inner text of the HTML element
__________________
V.Vadivelan

There never a wrong time to do the right thing.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #16 (permalink)  
Old 02-11-2008, 08:22 PM
vadivelanvaidyanathan vadivelanvaidyanathan is offline
D-Web Genius
 
Join Date: Feb 2007
Posts: 803
vadivelanvaidyanathan is on a distinguished road
Default Re: XML Tips

The XMLHttpRequest object is the developers dream, because you can:

* Update a web page with new data without reloading the page
* Request data from a server after the page has loaded
* Receive data from a server after the page has loaded
* Send data to a server in the background

The XMLHttpRequest object is supported in all modern browsers.
__________________
V.Vadivelan

There never a wrong time to do the right thing.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #17 (permalink)  
Old 02-11-2008, 08:44 PM
vadivelanvaidyanathan vadivelanvaidyanathan is offline
D-Web Genius
 
Join Date: Feb 2007
Posts: 803
vadivelanvaidyanathan is on a distinguished road
Default Re: XML Tips

XML Namespaces provide a method to avoid element name conflicts.
__________________
V.Vadivelan

There never a wrong time to do the right thing.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #18 (permalink)  
Old 02-11-2008, 08:45 PM
vadivelanvaidyanathan vadivelanvaidyanathan is offline
D-Web Genius
 
Join Date: Feb 2007
Posts: 803
vadivelanvaidyanathan is on a distinguished road
Default Re: XML Tips

CDATA - (Unparsed) Character Data

The term CDATA is used about text data that should not be parsed by the XML parser.

Characters like "<" and "&" are illegal in XML elements.

"<" will generate an error because the parser interprets it as the start of a new element.

"&" will generate an error because the parser interprets it as the start of an character entity.

Some text, like JavaScript code, contains a lot of "<" or "&" characters. To avoid errors script code can be defined as CDATA.

Everything inside a CDATA section is ignored by the parser.

A CDATA section starts with "<![CDATA[" and ends with "]]>":
__________________
V.Vadivelan

There never a wrong time to do the right thing.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #19 (permalink)  
Old 02-11-2008, 08:46 PM
vadivelanvaidyanathan vadivelanvaidyanathan is offline
D-Web Genius
 
Join Date: Feb 2007
Posts: 803
vadivelanvaidyanathan is on a distinguished road
Default Re: XML Tips

Why an XML Editor?

Today XML is an important technology, and development projects use XML-based technologies like:

* XML Schema to define XML structures and data types
* XSLT to transform XML data
* SOAP to exchange XML data between applications
* WSDL to describe web services
* RDF to describe web resources
* XPath and XQuery to access XML data
* SMIL to define graphics

To be able to write error-free XML documents, you will need an intelligent XML editor!
__________________
V.Vadivelan

There never a wrong time to do the right thing.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #20 (permalink)  
Old 02-11-2008, 08:47 PM
vadivelanvaidyanathan vadivelanvaidyanathan is offline
D-Web Genius
 
Join Date: Feb 2007
Posts: 803
vadivelanvaidyanathan is on a distinguished road
Default Re: XML Tips

XML Editors

Professional XML editors will help you to write error-free XML documents, validate your XML against a DTD or a schema, and force you to stick to a valid XML structure.

An XML editor should be able to:

* Add closing tags to your opening tags automatically
* Force you to write valid XML
* Verify your XML against a DTD
* Verify your XML against a Schema
* Color code your XML syntax
__________________
V.Vadivelan

There never a wrong time to do the right thing.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

LinkBacks (?)
LinkBack to this Thread: http://www.discussweb.com/xml-soap/5166-xml-tips.html
Posted By For Type Date
DiscussWeb IT Community - Technical Support and Technology Discussions This thread Refback 02-11-2008 03:12 AM


All times are GMT -7. The time now is 02:08 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0