Thursday, October 25, 2007

XML Interview Question Part3


18. How to use JavaScript to display XML document?

To illustrate it, we use a simple XML document hello.xml as follows:







Hello guys!





In an HTML file called getxml.html:













Get data from XML document



Here comes:








Here is the display in your browser. Click the button to see what happens? Press the "F5" button on your keyboard to refresh the display. If you cannot see the result from your browser, check if your browser blocks active contents or not.

________________________________________

Get data from XML document

Here comes:

________________________________________

19. What is DTD tag?

A DTD tag is a tag used in DTD definition file. It starts with . It tells parser how to handle xml file.

20. What is CDATA?

A CDATA is a section mark which works like
...
in HTML, only more so--all whitespace in a CDATA section is significant, and characters in it are not interpreted as XML. A CDATA section starts with . If you have a section which contains many & or <, you can mark it, so the XML processor will not parse it.

21. What is the basic syntax for the document type declaration?

The basic syntax:



where the is part of a document's prolog; the root-name is the name of root tag; the DTD is a document type definition. It can be internal or external.

The document type declaration may have the following forms:











22. How the internal DTD looks like?








]>





....



23. What is the syntax of element declaration?



where name is the name of the element; CONTENT_MODEL can be set to EMPTY or ANY, or it can hold mixed content or child elements.

24. What is the meaning of the following statement?



This is a DTD tag definition. The notation says that a slideshow element consists of one or more slide elements. If there is no plus sign after slide, it says that a slideshow has only one slide element. If the plus sign is replaced with question mark "?", it says there may be zero or one slide. If the plus sign is replaced with asterisk "*", it say that there may be zero or more slide elements.

0 comments:

Advertisement

 

Copyright 2008 All Rights Reserved Revolution Two Church theme by Brian Gardner Converted into Blogger Template by Bloganol dot com