Your American History Reference Guide!
- Simple Outline XML

HistoryMania Information Site on Simple Outline XML American History American History Search        American History Browse welcome to our free resource site for all enthusiasts!

Simple Outline XML

Simple Outline XML (SOX) is an alternative syntax used to simplify the textual representation of Extensible Markup Language (XML) documents. It is designed to be simpler, easier to read, and less verbose than standard XML while still being as machine-readable. Since it is easily parsed, a valid SOX document can easily be transformed into a valid XML document.

Standard XML syntax consists of textual data which is marked-up using markup instructions, referred to as tags. All text affected by one of these instructions is encapsulated between a start and end tag. The start tag consists of a less-than (<) symbol, the instruction name, any appropriate attributes as name-value pairs, and a greater-than (>) symbol. An end tag appears at the end of the affected text, consisting of a less-than symbol, a slash (/), the instruction name, and a greater-than symbol. The following is an example of an XML document:

       <?xml version="1.0" encoding="UTF-8"?>
       <Recipe name="bread" prep_time="5 mins" cook_time="3 hours" >
          <title>Basic bread</title>
          <ingredient amount="3" unit="cups" >Flour</ingredient>
          <ingredient amount="0.25" unit="ounce" >Yeast</ingredient>
          <ingredient amount="1.5" unit="cups" >Warm Water</ingredient>
          <ingredient amount="1" unit="teaspoon" >Salt</ingredient>
          <Instructions>
             <step>Mix all ingredients together, and knead thoroughly.</step>
             <step>Cover with a cloth, and leave for one hour in warm room.</step>
             <step>Knead again, place in a tin, and then bake in the oven.</step>
          </Instructions>
       </Recipe>

Simple Outline XML uses whitespace indentation to encode some of the information ordinarily encoded using XML tags. The level of indentation makes the structure of the document immediately apparent, which eliminates the need for closing tags. Each line represents a single element, attribute, or text node which also eliminates the need for attribute quoting. Elements are represented by names ending with a greater-than symbol, attributes contain an equals (=) sign, and any other text entities are text nodes. Text may be quoted if it contains a greater-than symbol or an equals sign. The following is the SOX representation of the above XML document:

       Recipe>
       	name=bread
       	prep_time=5 mins
       	cook_time=3 hours
       	title>Basic bread
       	ingredient>
       		amount=3 
       		unit=cups
       		Flour
       	ingredient> 
       		amount=0.25
       		unit=ounce
       		Yeast
       	ingredient>
       		amount=1.5 
       		unit=cups
       		Warm Water
       	ingredient>
       		amount=1
       		unit=teaspoon
       		Salt
       	Instructions>
       		step>Mix all ingredients together, and knead thoroughly.
       		step>Cover with a cloth, and leave for one hour in warm room.
       		step>Knead again, place in a tin, and then bake in the oven.

External link

The contents of this article are licensed from Wikipedia.org under the
GNU Free Documentation License. How to see transparent copy
Search | Browse | Contact | Legal info