Comments

printer-friendly version of this section  Print  e-mail this section  E-Mail  add a public, group or private note  Add Note  add a bookmark about this section  Add Bookmark    

Java APIs for XML Kick Start
By Aoyon Chowdhury, Parag Choudhary

Table of Contents
Appendix B.  XML: A Quick Tour


The next line in the CarParts.xml file is

<!-- XML file that describes car parts --> 

This is the XML comment line. The comment starts with the <!-- tag and ends with the --> tag. The XML processor ignores all text within the comment tag. However, it is important to remember that the comments' start and end tags for XML comments should be entered exactly as shown here. If there is a deviation, such as a space between < and !--, the XML parser might treat the comment as content markup, and you might have a rather unexpected outcome from the XML parsing. Another important point to remember is that you should not use the -- string in the comment. Other than these two limitations, you are pretty much free to use anything inside the comments.

Comments can be placed anywhere outside of a markup. So, you can do the following:

<wheel>Wheel Set 1 <!-- Hey, what am I doing here? --></wheel> 

However, doing this will land you in trouble:

<wheel <!-- Now, Now, be a good boy and get me outta here -->> wheel Set 1</wheel> 

printer-friendly version of this section  Print  e-mail this section  E-Mail  add a public, group or private note  Add Note  add a bookmark about this section  Add Bookmark    
Top

[0672324342/app02lev1sec4]

 
 


JavaT APIs for XML Kick Start
JAX: Java APIs for XML Kick Start
ISBN: 0672324342
EAN: 2147483647
Year: 2002
Pages: 133

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net