Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Ben-Kiki O.YAML ain't markup language.V1.1.pdf
Скачиваний:
8
Добавлен:
23.08.2013
Размер:
1.06 Mб
Скачать

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

XSLFO

RenderX

Соседние файлы в предмете Электротехника