How To Add Comments In Xml
A annotate is a graphic symbol, a line or a paragraph that is non considered as part of the XML code that needs to be candy. A annotate allows you lot to insert notes or personal observations inside an XML file. For this reason, a commented section can be written whatever manner you similar. |
This ways that a comment can include patently text, formulas, expressions, or even XML lawmaking every bit long as you know that that XML code will not be validated: information technology volition ignored past the parser.
To create a comment, you employ the post-obit formula:
<!-- Blah Apathetic Blah ->
Between <!-- and -->, any text in that section is considered a comment and you can include anything you want. Both sections of the comment utilize two dashes, not more, not less. Here is an case:
<?xml version="i.0" encoding="utf-8"?> <!-- In this collection, we will keep each title "as is" --> <videos> <video> <championship>The Distinguished Admirer</championship> <director>Jonathan Lynn</manager> <length>112 Minutes</length> <format>DVD</format> <rating>R</rating> </video> <video> <title>Her Alibi</title> <director>Bruce Beresford</director> <length>94 Mins</length> <format>DVD</format> <rating>PG-thirteen</rating> </video> </videos>
This would produce:
Here is an example with various comments:
<?xml version="1.0" encoding="utf-8" ?> <!-- This is code for a existent estate business organisation.--> <Listing> <!-- A belongings is created with the Property element. For each property, a random number is created. This number is fabricated of two parts that each ranges from 100 to 999. Both parts are separated by a dash. --> <!-- The auction condition, named Condition, indicates whether the property is currently available or has already been sold. The possible values are Available and Sold. --> <Holding Code="889456" Status="Available"> <!-- An element named DateListed specifies when the property was added to the listing or when it entered in the marketplace. --> <!-- Equally its name suggests, the YearBuilt attribute indicates the year the property was built. --> <DateListed YearBuilt="2002">12/8/2008</DateListed> <!-- The property type must exist * Single Family: For a house that stands by itself * Townhouse: For a total house just that is attached to at least another house. * Condominium: For a blazon of flat that belongs to a building. --> <PropertyType Style="Contemporary" Status="Splendid">Townhouse</PropertyType> <!-- The style of a property indicates a type of architecture. The possible styles are Contemporary, Colonial, Victorian, or Farmhouse. --> <!-- The Status aspect specifies whether the property tin can currently exist presented to a customer, or at least how it appears at the moment. The possible conditions are: * Excellent: This suggests that the holding has little to no flaw * Skilful: This means that the property is generally acceptable and can be presented to a potential buyer. In this case, something such equally a refrigerator or a dishwasher may be missing; or something such as the garbage dispenser may need to be fixed, or a piece of carpet that needs to exist cleaned before the property is really ready for sale * Needs Repair: This means that the property is in a practiced selling condition. --> <!-- A property can be located by its address which in nigh cases is made of an address, a urban center, a state (The states, DE, AU, NG, etc) or province (CA, CM, etc), a ZIP Code (Us) or postal lawmaking (CA, GB, Be, etc). --> <!-- To make it easy to locally detect a property, the location may not be an actual city and unremarkably people out of town may accept a difficult fourth dimension finding it on a map. Withal, local people, the inhabitants, and those interested in existent estate backdrop would be familiar with the place. --> <Location Address="1044 Larson Drive" City="Silver Spring" State="Md" ZIPCode="20904">White Oak</Location> <!-- Stories is the number of levels (in other countries such every bit AU). This includes the basement (if any), the floor level, and the upper level(s), if whatever. Almost new constructions of unmarried families in Us, CA, DE, GB, and AU have three stories simply yous must check. Most condos have 1 story but information technology is not uncommon for a condo to have 2 stories. --> <Stories>2</Stories> <!-- A sleeping room is a conspicuously designated area made for sleeping. It is hands identifiable in any structure. Still, if the basement of a firm is finished, unless it is clearly made as a sleeping room, it should not be counted every bit such. --> <Bedrooms>4</Bedrooms> <!-- In our real manor listing, there are ii types of bathrooms, full and half: * A bathroom is counted equally full if it is equipped with either a shower area, a bathroom tub, or both. In addition, it should take toilet and a sink * A bathroom is considered one-half if it (typically) has neither a shower area nor a bath tub. In about single family and townhouses, a half bath is constructed on the floor level to conveniently serve the visitors who enter the business firm. A typical half bathroom has a toilet (to do the business) and a sink to launder the hands. --> <Bathrooms>2.50</Bathrooms> <!-- The value of the property, also referred to equally the market place value or the listing value, can be the asking price for the holding. --> <MarketValue>425860.00</MarketValue> <!-- The description of a property gives an overview of what the property offers. It is normally written with positive words that can entice, we mean invite :), a pontential buyer to feel comfortable with the idea of acquiring the belongings. --> <Description>N/A</Description> </Property> </Listing>
Adding Markup to a Annotate |
Since a commented section tin can contain anything, you can include HTML or XML markup in it. Here is an example:
<?xml version="i.0" encoding="utf-8"?> <!-- In this collection, nosotros will keep each title "as is" --> <!-- Each video is created using the post-obit formula <video> <title>This is the name that appears on the package</championship> <director>This is the name of the person(s) who directed the video</director> <length>This is provided as a natural number for the minutes</length> <format>The format can be VHS, DVD, BluRay, Television recording, etc</format> <rating>This is the MPAA rating</rating> </video> --> <videos> <video> <title>The Distinguished Gentleman</title> <manager>Jonathan Lynn</manager> <length>112</length> <format>DVD</format> <rating>R</rating> </video> <video> <championship>Her Alibi</championship> <manager>Bruce Beresford</director> <length>94</length> <format>DVD</format> <rating>PG-13</rating> </video> </videos>
How To Add Comments In Xml,
Source: http://www.functionx.com/xml/Lesson04.htm
Posted by: arringtonungazintonat.blogspot.com
0 Response to "How To Add Comments In Xml"
Post a Comment