1. What is XML?
answer:-
XML is short form of Extensible Markup Language.
It is used to store and exchange the data.
It is text based markup language derived from Standard Generalized Markup Language (SGML).
HTML documents are made up of two things:the content and the tags that formats it for proper display on pages.
2. What are the benefits of XML?
answer:- These are the main benefits of using XML.
Simplicity:- Very easy to read and understand the information coded in XML.
Openness:- It is a W3C standard, endorsed by software industry market leaders.
Extensibility:- It is extensible because it has no fixed set of tags. You can define them as you need.
Self-descriptive:- XML documents do not need special schema set-up like traditional databases to store data. XML documents can be stored without such definitions, because they contain metadata in the form of tags and attributes.
Scalable:- XML is not in binary format so you can create and edit files with anything and it is also easy to debug.
Fast access:- XML documents are arranged in hierarchical form so it is comparatively faster.
3. How can name conflicts be avoided in XML?
answer:-
By using XML Namespaces user can avoid conflicts in XML.
4. What is XML DOM Document?
answer:-
XML Document object represents the whole XML document, and it is the root of a document tree.It gives access to entire XML document Nodes and Elements, and it has its own properties.
5.How do you insert a comment in XML?
answer:-
Comments in XML begins with`<!--`nd ends with `-->`.
6.What is an attribute? answer:-
An attribute provides more or additional information about an element.
7 . Can we have empty XML tags?
answer:-
Yes, we can have empty tags in XML.
Empty tags are used to indicate elements that have no textual content.
8.What are the basic rules while writing XML?
answer:-
These are the basic rules while writing XML:
-> All XML should have a root element ->
All tags should be closed->
XML tags are case sensitive->
All tags should be nested properly->
Tag names cannot contain spaces->
Attribute value should appear within quotes->
White space is preserved
9 . What is DTD?
answer:-
DTD stands for Document Type Definition.
It defines a leading building block of an XML document.
It defines:
-> Names of elements\n->
How and where they can be used->
Element attributes->
Proper nesting
10,
What is the difference between simple element and complex element?,
answer:In XML, simple elements are text-based elements. It contains less attributes, child elements, and cannot be left empty.\nBut, complex elements can hold multiple attributes and elements. It can contain additional sub elements and empty element also.
,
11 . What is SGML?
answer:- SGML is a vast and powerful generalized markup language that is used to define descriptions for the structure of several electronic documents.
12 . Can we use graphics in XML?
answer:- Yes, graphics can be stored in XML file by using XLink and XPointer. It supports graphics like GIF, JPG, TIFF, PNG, CGM, EPS, SVG.
13 . Is XML case sensitive?
answer:-Yes, XML is a case sensitive language.
14 . What is XML Parser?
answer:-
XML Parser is used to convert from XML document into an XML DOM object which can be written in Javascript.
15 . The XML preserves white spaces. Is it true?
answer:- Yes, it is true.
16.Explain the XML elements?
answer:-
The elements are the central units of an XML document that explain and identify data.
The elements are represented by the tags.
You can also make your own tags, which make XML a user-friendly language.
By creating custom meaningful elements,
you can improve readability of the document.
XML elements can be nested and the nested elements are known as child elements.
17 . Which classes are supported to make an XML DOM?
answer:- The following are the different classes in the System.Xml namespace that make up the XML DOM: The XmlNode class The XmlDocument Class The XmlElement Class The XmlAttribute Class The XmlText class The XmlComment class The XmlNodeList Class
18 . Which class is used to encode and decode XML names and contains different methods to convert between CLR types and XSD types?
answer:-
The XmlConvert Class.
19.What is XSLT?
answer:- XSLT is Extensible Stylesheet Language Transformations that is a part of XML, which is a mechanism to transform an XML document into another XML or HTML document.
20 . The XML elements cannot be empty. Is it true?
answer:- No, it is not true.
21 . Give an example of a DOM-enabled XML parser?
answer:-
The XML parser is MSXML, which is fully DOM-enabled.
22 . What is an XML schema?
answer:-
An XML schema provides the definition of an XML document.
This implies that an XML schema defines the following in an XML document:
The elements that can appear in an XML document.
The attributes that can appear in an XML document.
The elements that are child elements.
The order of child elements.
The number of child elements.
Whether an element is empty or it includes some text.
The data types for elements and attributes.
23.Which namespaces in .NET are used for XML?
answer:- The System.xml.dll is the real physical file, which contains the XML implementation.
Some of the other namespaces that allow .NET to use XML are as follows:
System.Xml
System.Xml.Schema
System.Xml.XPath
System.Xml.Xsl
24.Explain different types of XML Application Programming Interface (API)?
answer:-
The following are two main types of XML parsers:-
Tree-based API :-
Compiles an XML document into a tree structure and loads it into memory.
You can traverse and change the tree structure.
The DOM is an example of a tree-based API.
Event-based API - Provides the report to an application about the parsing events by a set of built-in callback functions.
An example of the event-based API is SAX.
25.Explain the XmlReader class?
answer:- The XmlReader class is used to read XML data in a fast, forward-only, and non-cached manner. To work with XmlReader class in .NET, you need to import the following namespace: In C#:\nusing System.Xml; In VB:\nImports System.Xml
26 . What is XPath?
answer:-
XPath stands for XML Path.
It is a language used to access different parts of an XML document, such as elements and attributes.
27 .What is an XML attribute?
answer:- An XML attribute contains additional information regarding that particular element.
The XML attributes use the name-value pair.
For example, the element student has an attribute called id and the value of this attribute is set to s01,as shown in the following code
snippet:\n<Student ID=\s01\>\n...\n</Student>
28.What is the version information in XML?
answer:- \Version\ tag shows which version of XML is used.
29 . If XML does not have closing tag will it work?
answer:- No, every tag in XML, which is opened, should have a closing tag.
30.Is XML case sensitive?
answer:Yes, XML is case sensitive.
31.What is a well-formed XML document?
answer:- f a document is syntactically correct it can be called as well-formed XML documents. Every open tag must be closed. The open tag must exactly match the closing tag: XML is case-sensitive. All elements must be embedded within a single root element. Child tags must be closed before parent tags. A well-formed document has correct XML tag syntax, but the elements might be invalid for the specified document type
32.How to add CSS in XML File?
answer:-<!--xml-stylesheet type=\text/css\ href=\/css/mystyle.css\?-->
33.What is XSL?
answer:-
XSL is a language used for expressing style sheets.
An XSL style sheet is a file that describes the way to display an XML document.
34 . When can we use xml control?
answer:
Whenever we want to display the data from XML document to the user then we can use XML control.
NOTE:-
To fetch the data from XML document, XML control will depend on XSLT(Extensible Style sheet Language Transformation) file.
XSLT file will be acting as a mediator between XML control and XML document.
35.What is XMLA ?
answer:-
It is protocol of Microsoft for XML-messaging used for exchanging data between client and servers.
36.What is XQuery?
answer:- Xquery is a query language that is used to retrieve data from XML documents.
You can add, update, delete and list the XML with use of XQuery.
37.What is a CDATA section in XML?
answer:-
The CDATA is used when you don't want some text data be parsed by the XML parser.
<![CDATA[ HERE IS NON-PARSED DATA]]>
Now, above data will not parse.
38.What is file extension of XML?
answer:-.xml
39 .What classes are supported to make an XML DOM?
answer:- XMLNode XMLDocument XMLElement XMLAttribute XMLText XMLComment XMLNodeList
40.Describe XML Writer Class?
answer:-XMLWriter class is used to write XML to stream, a file or a TextWriter object. This class works in a forward only , non cached manner.
41.Describe XMLReader class?
answer:-
XMLReader class is used to read XML data in a fast, forward only and non cached manner.
You can use XMLReader Class by importing System.XML.
42. What all are the special characters that can’t be included in XML document?
answer:-
You can’t include ‘<‘ , ‘>’, ‘&’, ‘”‘ and ”’ in XML.