Thursday, October 25, 2007

XML Interview Question Part1


7. What is an empty tag?

Empty tag is a tag with ending "/>" and used to mark something in your well-formed tags. It doesn't contain any content, so it is called "empty tag". It has two forms:



Note: not


or



or



8. What comments should be used in XML?

Comments are ignored by XML parsers. A program will never see them in fact, unless you activate special settings in the parser. XML comments are very much like HTML comments.



It is worth noting that Comments must not come before an XML declaration or inside markups. You cannot use "--" between your comments. You can use comments to hide or remove parts of documents as long as the enclosed parts do not themselves contain any comments.

9. How to deal with special characters in XML like < or &, etc.?

Like HTML, you should use entity reference to replace them, even if in embeded JavaScript code.

10. What is XML Prolog?

Prologs come at the very beginning of XML documents. Like HTML's tag , XML prolog is a declaration that is used to indicate the start of XML file like the following:



or



or



It contains some or all of three attributes:

o version -- not optional

o encoding -- default UTF-8

o standalone -- "yes" or "no"

It is a good practice to include XML prolog whenever you create an XML file, though it is optional.

0 comments:

Advertisement

 

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