Thursday, October 16, 2008

XML Interview Questions

What is XML?
XML means extensible markup language and it provides scalability for anything from small configuration files a company wide data repositary.

What is the use of parser?

If we want to read the XML data,update,delete or insert the XML data then we just required to give instrutions to parser.

Diferrence b/w DOM and SAX Parser?

DOM is tree based(object based)i.e to insert element.DOM Parser reads the XML document and loads the entire XML doc into the active memory.It can used more memory and slow of operation.

SAX is an event basedi.e to search operation.SAX Parser reading the XML doc parser element gives reaised.It can take less memory and speed operation.

How to insert element into the XML document using DOM?

parser p= new parser("my errors");

TXDocument td=p.readstream(new FileInputStream(s[0]));

Give me one example on SAX Parser?

Class SAX

{

parser p=parserfactory.makeparser("org.apache.parser.SAXParser");

p.setDocumentHandler(new mydocument handler());

p.parser(s[0]);

}

}

No comments: