XML

XML Questions and Answers

 

Question What is XML ?

Answer :-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

Question Why XML is used?

Answer :- XML was designed to transport and store data.

Question : XML is Not a Replacement for HTML

Answer : XML is used to transport data, while HTML is used to format and display the data.

Question :XML is Used to Create New Internet Languages

Answer XML can be used with multiple languages

a.       XHTML

b.      WSDL for describing available web services

c.       WAP and WML as markup languages for handheld devices

d.      RSS languages for news feeds

e.      RDF and OWL for describing resources and ontology

f.        SMIL for describing multimedia for the web

 

Question: XML Documents Must Have a Root Element

Answer XML documents must contain one element that is the parent of all other elements. This element is called the root element.

Question: What is an XML Element?

An XML element is everything from (including) the element's start tag to (including) the element's end tag.

An element can contain:

  • other elements
  • text
  • attributes

Question XML Naming Rules

XML elements must follow these naming rules:

  • Names can contain letters, numbers, and other characters
  • Names cannot start with a number or punctuation character
  • Names cannot start with the letters xml
  • Names cannot contain spaces

Question: XML documents type

  • XML documents must have a root element
  • XML elements must have a closing tag
  • XML tags are case sensitive
  • XML elements must be properly nested
  • XML attribute values must be quoted

Question: XML Validator

To help you check the syntax of your XML files, we have created an XML validator to syntax-check your XML.

Question: Valid XML Documents

The first rule, for a valid XML document, is that it must be well formed.

The second rule is that a valid XML document must conform to a document type.

Question: When to Use a Document Definition?

A document definition is the easiest way to provide a reference to the legal elements and attributes of a document.

Question: Document Definitions

There are different types of document definitions that can be used with XML:

  • The original Document Type Definition (DTD)
  • The newer, and XML based, XML Schema

Question : Why to use DTD?

  Your XML files can carry a description of its own format.

  Independent groups of people can agree on a standard for interchanging data.

  You can verify that the data you receive from the outside world is valid.

Question : What is XMLHttpRequest object.

The XMLHttpRequest object is used to exchange data with a server behind the scenes.

The XMLHttpRequest object is a developer's dream, because you can:

  • Update a web page 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

 Question : how to create Create an XMLHttpRequest Object

xmlhttp=new XMLHttpRequest();

 

Question : What is the function of The XML DOM

The XML DOM defines a standard way for accessing and manipulating XML documents.

The XML DOM views an XML document as a tree-structure.

All elements can be accessed through the DOM tree. Their content can be modified or deleted, and new elements can be created. The elements, their text, and their attributes are all known as nodes

Question: What is the function of The HTML DOM

The HTML DOM defines a standard way for accessing and manipulating HTML documents.

All HTML elements can be accessed through the HTML DOM.

Question : What is XPath?

XPath is a language for finding information in an XML document.

  • XPath is a syntax for defining parts of an XML document
  • XPath uses path expressions to navigate in XML documents
  • XPath contains a library of standard functions
  • XPath is a major element in XSLT
  • XPath is also used in XQuery, XPointer and XLink
  • XPath is a W3C recommendation

 

Question: Why XPath is Used in XSLT

XPath is a major element in the XSLT standard. Without XPath knowledge you will not be able to create XSLT documents.

 


 






em-vs-i    Missing-slash    noscript    strong-vs-bold    target-top    XML   

Advertisement

Topics