Answer
XML, Extensible Markup Language, is an open, text based markup language that provides structural and semantic information to data. XML is a metalanguage that can be used to create other language. It is used to structure and describe data that can be understood by other applications. Using XML, we can separate the user interface from data.
Features of XML
XML is a generalized markup language that means one can define his/her own tag sets.
A valid XML document contains rules and is self-describing.
The rules that are found in DTD allow the documents to be validated.
Describe the logical structure of XML.
Answer
XML documents comprise of declaration, elements and comments
XML Declaration
It identifies the version to which XML conforms
Document Type Declaration
It consists of markup code that indicates grammar rules or Document Type Definition (DTD) for the particular class of document.
This statement tells the XML processor that the document is of the class Car that conforms the rules specified in the DTD "cr.dtd".
Document element
The document element contains data of an XML document.
Why is XML so popular?
Answer
Due to the following advantages of using XML, it has become popular:
- It supports Unicode. Therefore documents written in any human language can be communicated.
- Data structures: records, lists and trees can be represented using XML.
- Its format describes structure, field names and their specific values too. Its therefore called self-documenting.
- Its syntax and parsing requirements make the necessary parsing algorithms very simple, efficient, and consistent.
- It can be used as a document storage and processing format.
- It is platform-independent.
Why is XML referred as self-describing data?
Answer
Text labels inside of XML's syntactic delimiters that cause most people to think that XML is self-describing. But these tags aren't part of XML.
Choosing the terms used for tags or naming anything is often a difficult and contentious activity. Everyone naturally creates names that make sense to them.
However, XML is not self describing.
Why is XML extensible?
Answer
Extensibility is another attribute of XML. XML is short of "eXtensible Markup Language. This is so because a developer may easily create his own XML syntax for any applications he wishes to use it for. Any other developer, once having learned how to use his own language's XML parsing routines, can use any XML-based format currently available.
XML is a secured language for information exchange over the network. Explain
Answer
Applications require a secure exchange of structured data. XML encryption can ensure this by providing end-to-end security as it is iitself a widely used data structuring technology.
XML encryption addresses the issues not covered in by the TLS which are encrypting part of the data that is being exchanged and secure sessions between multiple parties.
XML Encryption can handle XML as well as binary data.
List the rules to be followed by an XML document.
Answer
Following rules need to be followed by an XML document:
They must have a root tag, the document should be well formed : the tags should be properly closed, since XML is case sensitive, one should take care that the documents are written with proper care and the attribute values should be inside “”
Explain about XML Canonicalization.
Answer
Canonicalization refers to finding the simplified form of an XML document.
XML files may not contain the same sequence of characters (bytes or octets) even if they are logically equivalent. This is where we need to canonicalize them and check their canonical forms.
Steps to canonicalize an XML document
- Encoding schemes should represent characters by octets.XML documents should be encoded in UTF-8 encoding.
- The canonical form needs all line breaks to be #xA.
- All attributes need to be normalized in canonical form.
Define DTD (Document Type definition).
Answer
DTD - Document Type Definition defines the legal building blocks of an XML document.
It defines the document structure with a list of legal elements and attributes.
XML DTD is a rule book that an XML document follows. Once DTD is ready, you can create number of XML documents following the same rules specified in the DTD. DTD can be internal or external DTD. The internal DTD is included in the XML document, while external DTD exists outside the content of the documents.
Explain DTD and schema.
Answer
A DTD provides a list of the elements, attributes, comments, notes, and entities contained in an XML or HTML document and indicates their relationship with each other.
The 'DOCTYPE' tells the browser that it is a Document Type Declaration
Some commonly used attribute types are
- CDATA The value is character data
- ID The value is a unique id
- IDREF The value is the id of another element
- IDREFS The value is a list of other ids
Schema means the organization and the structure of a database.
E.g.: An XML schema is a description of XML document. It is expressed in terms of constraints on the structure and content of documents.
XML XML DTD
Define XML DTD.
XML DTD is a rule book that an XML document follows. Once DTD is ready, you can create number of XML documents following the same rules specified in the DTD. DTD can be internal or external DTD. The internal DTD is included in the XML document, while external DTD exists outside the content of the documents.
What is a CDATA section in XML?
Answer
CDATA - (Unparsed) Character Data
The term CDATA is used when you dont want some text data to be parsed by the XML parser.
A CDATA section starts with "":
XML - CDATA section in XML
What is a CDATA section in XML?
The CDATA section of XML is used to describe the text that should not be parsed by the XML parser.
The characters like "<" ">" are not supported in XML
"<" will cause an error by the parser. Because the parser identifies <>
Any text that is included in CDATA section is ignored by the parser.
Example :
are used to enclose an element in XML "]]>
What is XSL?
Answer
XSL is a language for expressing style sheets. An XSL style sheet is a file that describes the way to display an XML document.
Using XSL stylesheets, we can separate the XML document content and its styling.
An XSL style sheet begins with the XML declaration:
The
Define CSS and XSL.
Answer
XSL is a language for expressing style sheets. An XSL style sheet is a file that describes the way to display an XML document.
Cascading Style Sheets is an answer to the limitations of HTML, where the structure of documents was defined and not the display. CSS formats documents for display in browsers that support it.
How do you display XML with XSLT?
Answer
First you need to declare the XSL style sheet:
Then,
you create an XSL Style Sheet with a transformation template.
Add the XSL style sheet reference to your XML document to link them.
What is XQuery?
Answer
Xquery is a query language that is used to retrieve data from XML documents.
XQuery is a way to query the XML data, It is built on XPath expressions and is supported by quite a few database engines.
It can find and extract elements and attributes from XML documents.
XQuery is written in FLWOR fashion which stands for: For, Let, Where, Order by, Return
An example of XQuery is:
for $x in doc("abc.xml")/abc_name
where $x/a>30
order by $x/b
return $x/c
What is XPATH?
Answer
XPath is a language that describes how to locate specific elements (and attributes, processing instructions, etc.) in a document.
An XSL sublanguage designed to uniquely identify or address parts of a source XML document, for use with XSLT.
It is based on a tree representation of XML document. It provides the ability to navigate around the tree and to select the nodes by a variety of criteria.
The simplest XPath is /A/B/C where C is the child of B, B child of A
What is XMLA ?
XML for Analysis,
It is a Microsoft specified XML-messaging-based protocol for exchanging analytical data between client applications and servers using HTTP and SOAP as a service on the Web.
What is DOM?
Answer
DOM is an interface-oriented Application Programming Interface. It allows for navigation of the entire document. A DOM document can be created by a parser, or can be generated manually by users. Data types in DOM Nodes are abstract. DOM implementations generally require the entire document to be loaded into memory and constructed as a tree of objects before access is allowed. DOM is supported in Java. Its specification is regulated by the World Wide Web Consortium.
No comments:
Post a Comment