- World's Largest Collection of Interview Questions & Answers, FAQs, queries, sample papers, exam papers, dumps, what, why, how, where, when questions
Our Services
Get 9,000 Interview Questions & Answers in an eBook.

Get it now !!
Send your Resume to 6000 Companies
XML Parser Interview Questions & Answers - Learning Mode

XML Parser Interview Questions & Answers - Learning Mode

A Parser is a piece of program that takes a physical representation of some data and converts it into an in-memory form for the program as a whole to use. Parsers are used everywhere in software. An XML Parser is a parser that is designed to read XML and create a way for programs to use XML. Following are various types of parsers which are commonly used to parse XML documents. Dom Parser - Parses the document by loading the complete contents of the document and creating its complete hiearchical tree in memory. SAX Parser - Parses the document on event based triggers.

Try XML Parser Interview Questions & Answers - Exam Mode


Sort By : Latest First | Oldest First | By Rating

XML Parser Interview Questions & Answers - Learning Mode
Try XML Parser Interview Questions & Answers - Exam Mode
Question: What is the difference between TXmlParser and TXmlScanner?

Answer: TXmlParser is a Delphi CLASS for easy parsing of an XML file. You have to create an instance of this class and use its methods and properties to read your XML.

TXmlScanner is a VCL wrapper for TXmlParser. So you have a non-visual component which represents the parser and you have events like "OnStartTag" which are fired when there is a start tag found in the XML. To start parsing, you have to call the Execute method.

Advantage of TXmlScanner: Very easy to use: put component on your Source:
Question: What's the difference between Text Content and CDATA sections?

Answer: You as an application programmer who reads XML can treat them the same.

CDATA sections are there to help with text content that has a lot of characters which would have to be escaped otherwise. However, as there is the character sequence ]]> which is not allowed in CDATA sections (because it terminates them), you'll have to be careful, too. So, for me, there's no use for CDATA sections when you write XML. Source:
Question: How can I find out the line number of the current line?

Answer: There is nothing in the parser to find out the line number. So you'll have to code that on your own. Source:
Question: Does the parser work with C++Builder, Kylix, C#, Delphi for .NET ?

Answer: C++Builder: Yes
Kylix: Yes
C#/.NET: No Source:
Question: Why are the attribute functions case sensitive?

Answer: Everything in XML is case sensitive by definition. As XML is meant to be used for Unicode applications (which has been even expanded in XML 1.1), all XML element, entity and attribute names are case sensitive. In a lot of non-latin scripts there is no such thing as casing, so it would be hard to compare two strings in a non-case-sensitive way. Source:
Question: How can I retrieve the attribute values from my start tags/empty-element tags?

Answer: TXmlParser has a property named CurAttr and TXmlScanner passes an Attributes parameter, both of which are of type TAttrList. You can access the attributes by name or index from there:

Edit1.Text := CurAttr.Value ('name'); // To get the value of the 'name' attribute

Name := CurAttr.Name (0); // To get the name of the first attribute
Value := CurAttr.Value (0); // To get the value of the first attribute

The number of attributes ca Source:
Question: How can I write XML with the parser?

Answer: The parser is just that: a parser. There is nothing there to write XML.

As XML is so simple,preferred method for writing XML is Writeln. Source:
Question: How can I find out the depth of a node in the XML structure?

Answer: There's nothing there for this. You'll have to code this on your own. I don't think that this is really bad, because then you can code it in a way that suits your application best. Source:
Question: Can anyone use the parser for commercial projects?

Answer: Yes,there is no limitation and no royalty.You are not obliged to publish your source code or your work.
The XML parser is subject to own DSL Licence, which says that anyone can do practically everything with code. Source:
Question: I have Empty-Elements in my XML (like <br/>) -- how can I parse them?

Answer: They are handled as special parts:

TXmlParser will report them as a ptEmptyTag part type.

TXmlScanner will report them as an OnEmptyTag event. Source:


India News Network
Latest 20 Questions
Payment of time- barred debt is: (a) Valid (b) Void (c) Illegal (d) Voidable
Consideration is defined in the Indian Contract Act,1872 in: (a) Section 2(f) (b) Section 2(e) (c) Section 2(g) (d) Section 2(d)
Which of the following is not an exception to the rule, "No consideration, No contract": (a) Natural love and affection (b) Compensation for involuntary services (c) Completed gift (d) Agency
Consideration must move at the desire of: (a) The promisor (b) The promisee (c) The promisor or any other party (d) Both the promisor and the promisee
An offer which is open for acceptance over a period of time is: (a) Cross Offer (b) Counter Offer (c) Standing Offer (d) Implied Offer
Specific offer can be communicated to__________ (a) All the parties of contract (b) General public in universe (c) Specific person (d) None of the above
_________ amounts to rejection of the original offer. (a) Cross offer (b) Special offer (c) Standing offer (d) Counter offer
A advertises to sell his old car by advertising in a newspaper. This offer is caleed: (a) General Offer (b) Special Offer (c) Continuing Offer (d) None of the above
In case a counter offer is made, the original offer stands: (a) Rejected (b) Accepted automatically (c) Accepted subject to certain modifications and variations (d) None of the above
In case of unenforceable contract having some technical defect, parties (a) Can sue upon it (b) Cannot sue upon it (c) Should consider it to be illegal (d) None of the above
If entire specified goods is perished before entering into contract of sale, the contract is (a) Valid (b) Void (c) Voidable (d) Cancelled
______________ contracts are also caled contracts with executed consideration. (a) Unilateral (b) Completed (c) Bilateral (d) Executory
A offers B to supply books @ Rs 100 each but B accepts the same with condition of 10% discount. This is a case of (a) Counter Offer (b) Cross Offer (c) Specific Offer (d) General Offer
_____________ is a game of chance. (a) Conditional Contract (b) Contingent Contract (c) Wagering Contract (d) Quasi Contract
There is no binding contract in case of _______ as one's offer cannot be constructed as acceptance (a) Cross Offer (b) Standing Offer (c) Counter Offer (d) Special Offer
An offer is made with an intention to have negotiation from other party. This type of offer is: (a) Invitation to offer (b) Valid offer (c) Voidable (d) None of the above
When an offer is made to the world at large, it is ____________ offer. (a) Counter (b) Special (c) General (d) None of the above
Implied contract even if not in writing or express words is perfectly _______________ if all the conditions are satisfied:- (a) Void (b) Voidable (c) Valid (d) Illegal
A specific offer can be accepted by ___________. (a) Any person (b) Any friend to offeror (c) The person to whom it is made (d) Any friend of offeree
An agreement toput a fire on a person's car is a ______: (a) Legal (b) Voidable (c) Valid (d) Illegal
Cache = 0.328125 Seconds