1 XML Qa (3856)
1 XML Qa (3856)
1 XML Qa (3856)
XML is called Extensible Markup Language which is designed to carry or transport and store
data. XML tags are not as predefined as HTML, but we can define our own user tags for
simplicity. It mainly concentrates on storing of data, not on displaying of data.
5. Which tag is used to find the version of XML and the syntax?
Declaring the XML version is very important for each XML document and platform needs to be
specified in which it is running
<?xml version=”1.1” encoding=”|ISO-8859-1|”?>
xml-svg
6. What is XML DOM Document?
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.
7. What is XPath?
XPath is used to find information in an XML document and contains standard functions. XPath
is the major element in XSLT, and it is w3c recommendation.
8. What is an attribute?
An attribute provides more or additional information about an element than otherwise.
<person></person>
<person/>
• XML structure is traversable, and it can be randomly accessed by traversing the tree.
• XML structure is modifiable, and values can be added, changed and removed
• An Attribute
• text
Comment can be represented as <! – – comments – -> as like HTML. This comment symbol is
applicable for single or multiple lines.
15. What are XML Namespaces?
XML namespaces are used to avoid element name conflicts, and it can be avoided by using
prefix before the name.
XLink:
<description
xlink:type="simple"
xlink:href="http://show.com/Cinema.gif"
xlink:show="new">
</description>
XPointer:
<description
xlink:type="simple"
xlink:href="http://show.com/Cinema.gif#Shownumber"
xlink:show="new">
</description>
27. Can I replace HTML with XML?
No, XML is not a replacement of HTML. XML provides an alternative approach to define own
set of markup elements, and it is used for processing and storing data.
<foo if{DB}="A">bar</foo>
This can be done by using Document Type Definition(DTD).
<xsl:if test="@foo=’bar’">
<xsl:text>Hello, world!</xsl:text>
</xsl:if>
29. What are the benefits of XML?
Benefits of XML are
• Self – descriptive
• XML will be just a text file if elements and attributes are not defined properly.
<?xml version=”1.0”/>
44. If XML attribute name itself has double quotes, then how it can be represented?
Attribute name can be represented within single quotes if double quotes are present in the
attribute name.
Example –
46. Whether root element is required for XML? If so, how many root elements are
required?
Yes, root element is required, and it can have only one root element in each XML.