| 1 |
|
| 2 |
type Table = <table>[Row*] ;;
|
| 3 |
type Row = <row> [
|
| 4 |
<id>[PCDATA]
|
| 5 |
<firstname>[PCDATA]
|
| 6 |
<lastname>[PCDATA]
|
| 7 |
<street>[PCDATA]
|
| 8 |
<city>[PCDATA]
|
| 9 |
<state>[PCDATA]
|
| 10 |
<zip>[PCDATA]
|
| 11 |
] ;;
|
| 12 |
|
| 13 |
include "../../web/xhtml-strict.cd" ;;
|
| 14 |
|
| 15 |
|
| 16 |
let fun dbonerow (<table> x : Table) : Xhtml =
|
| 17 |
<html>[
|
| 18 |
<head>[<title>"Dbonerow test"]
|
| 19 |
<body>
|
| 20 |
(transform x with
|
| 21 |
<row>[<_>("0432"&id) <_>fn <_>ln <_>st <_>city <_>state <_>zip ] ->
|
| 22 |
[<table border="0";style="background-color:#888888">[
|
| 23 |
<tr>[
|
| 24 |
<td colspan="2";style="background-color:#000000; color:white">
|
| 25 |
(*<font color="#ffffff"> deprecated in Xhtml strict*)
|
| 26 |
("personel record #" @ (id))
|
| 27 |
]
|
| 28 |
<tr>[
|
| 29 |
<td style="background-color:#888888"> "First Name:"
|
| 30 |
<td style="background-color:#dddddd"> fn
|
| 31 |
]
|
| 32 |
<tr>[
|
| 33 |
<td style="background-color:#888888"> "Last Name: "
|
| 34 |
<td style="background-color:#dddddd"> ln
|
| 35 |
]
|
| 36 |
<tr>[
|
| 37 |
<td style="background-color:#888888"> "Street: "
|
| 38 |
<td style="background-color:#dddddd"> st
|
| 39 |
]
|
| 40 |
<tr>[
|
| 41 |
<td style="background-color:#888888"> "City: "
|
| 42 |
<td style="background-color:#dddddd"> city
|
| 43 |
]
|
| 44 |
<tr>[
|
| 45 |
<td style="background-color:#888888"> "State: "
|
| 46 |
<td style="background-color:#dddddd"> state
|
| 47 |
]
|
| 48 |
<tr>[
|
| 49 |
<td style="background-color:#888888"> "Zip: "
|
| 50 |
<td style="background-color:#dddddd"> zip
|
| 51 |
]
|
| 52 |
]
|
| 53 |
]
|
| 54 |
)
|
| 55 |
]
|
| 56 |
;;
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
match load_xml "testcases/db10000.xml" with
|
| 62 |
| x & Table -> print_xml(dbonerow x)
|
| 63 |
| _ -> raise "Ma che c%$#^# di file mi hai passato?";;
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|