
- •Table of Contents
- •Chapter 1. Introduction
- •1.1. Goals
- •1.2. Prior Art
- •1.3. Relation to XML
- •1.4. Terminology
- •Chapter 2. Preview
- •2.1. Collections
- •2.2. Structures
- •2.3. Scalars
- •2.4. Tags
- •2.5. Full Length Example
- •Chapter 3. Processing YAML Information
- •3.1. Processes
- •3.1.1. Represent
- •3.1.2. Serialize
- •3.1.3. Present
- •3.1.4. Parse
- •3.1.5. Compose
- •3.1.6. Construct
- •3.2. Information Models
- •3.2.1. Representation Graph
- •3.2.1.1. Nodes
- •3.2.1.2. Tags
- •3.2.1.3. Nodes Comparison
- •3.2.2. Serialization Tree
- •3.2.2.1. Keys Order
- •3.2.2.2. Anchors and Aliases
- •3.2.3. Presentation Stream
- •3.2.3.1. Node Styles
- •3.2.3.2. Scalar Formats
- •3.2.3.3. Comments
- •3.2.3.4. Directives
- •3.3. Loading Failure Points
- •3.3.1. Well-Formed and Identified
- •3.3.2. Resolved
- •3.3.3. Recognized and Valid
- •3.3.4. Available
- •Chapter 4. Syntax
- •4.1. Characters
- •4.1.1. Character Set
- •4.1.2. Character Encoding
- •4.1.3. Indicator Characters
- •4.1.4. Line Break Characters
- •4.1.5. Miscellaneous Characters
- •4.1.6. Escape Sequences
- •4.2. Syntax Primitives
- •4.2.1. Production Parameters
- •4.2.2. Indentation Spaces
- •4.2.3. Comments
- •4.2.4. Separation Spaces
- •4.2.5. Ignored Line Prefix
- •4.2.6. Line Folding
- •4.3. YAML Character Stream
- •4.3.1. Directives
- •4.3.1.2.1. Tag Prefixes
- •4.3.1.2.2. Tag Handles
- •4.3.2. Document Boundary Markers
- •4.3.3. Documents
- •4.3.4. Complete Stream
- •4.4. Nodes
- •4.4.1. Node Anchors
- •4.4.2. Node Tags
- •4.4.3. Node Content
- •4.4.4. Alias Nodes
- •4.4.5. Complete Nodes
- •4.4.5.1. Flow Nodes
- •4.4.5.2. Block Nodes
- •4.5. Scalar Styles
- •4.5.1. Flow Scalar Styles
- •4.5.1.1. Double Quoted
- •4.5.1.2. Single Quoted
- •4.5.1.3. Plain
- •4.5.2. Block Scalar Header
- •4.5.2.1. Block Style Indicator
- •4.5.2.2. Block Indentation Indicator
- •4.5.2.3. Block Chomping Indicator
- •4.5.3. Block Scalar Styles
- •4.5.3.1. Literal
- •4.5.3.2. Folded
- •4.6. Collection Styles
- •4.6.1. Sequence Styles
- •4.6.1.1. Flow Sequences
- •4.6.1.2. Block Sequences
- •4.6.2. Mapping Styles
- •4.6.2.1. Flow Mappings
- •4.6.2.2. Block Mappings
- •Terms Index

Preview
2.5. Full Length Example
Below are two full-length examples of YAML. On the left is a sample invoice; on the right is a sample log file.
Example 2.27. Invoice |
Example 2.28. Log File |
|||
--- !<tag:clarkevans.com,2002:invoice> |
--- |
|||
invoice: 34843 |
|
|
Time: 2001-11-23 15:01:42 -5 |
|
date |
: 2001-01-23 |
User: ed |
||
bill-to: &id001 |
|
|
Warning: |
|
|
given : Chris |
|
This is an error message |
|
|
family : Dumars |
for the log file |
||
|
address: |
|
|
--- |
|
lines: | |
|
|
Time: 2001-11-23 15:02:31 -5 |
|
458 Walkman Dr. |
User: ed |
||
|
Suite |
#292 |
Warning: |
|
|
city |
: |
Royal Oak |
A slightly different error |
|
state |
: |
MI |
message. |
|
postal |
: |
48046 |
--- |
ship-to: *id001 |
|
|
Date: 2001-11-23 15:03:17 -5 |
|
product: |
|
|
User: ed |
|
|
- sku |
|
: BL394D |
Fatal: |
|
quantity |
|
: 4 |
Unknown variable "bar" |
|
description |
: Basketball |
Stack: |
|
|
price |
|
: 450.00 |
- file: TopClass.py |
|
- sku |
|
: BL4438H |
line: 23 |
|
quantity |
|
: 1 |
code: | |
|
description |
: Super Hoop |
x = MoreObject("345\n") |
|
|
price |
|
: 2392.00 |
- file: MoreClass.py |
tax |
: 251.42 |
|
|
line: 58 |
total: 4443.52 |
|
|
code: |- |
|
comments: |
|
|
foo = bar |
|
|
Late afternoon is best. |
|
||
|
Backup contact is Nancy |
|
||
|
Billsmer @ 338-4338. |
|
9
XSL• FO
RenderX