-
-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathBrickStoreXML.rnc
executable file
·132 lines (110 loc) · 5.7 KB
/
BrickStoreXML.rnc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# This is a Relax-NG compact XML schema for BrickStoreXML (*.bsx) files
#
# You can validate any bsx file with the open-source tool jing:
# Debian/Ubuntu package 'jing' or https://github.com/relaxng/jing-trang
#
# $ jing -c path/to/BrickStoreXML.rnc file.bsx
# Please note: There shouldn't be a <!DOCTYPE ...> definition, as Relax-NG does not support
# this mechanism. See also: https://relaxng.org/jclark/design.html#section:17
# If, for whatever reason, you still need to write a DTD, use <!DOCTYPE BrickStoreXML>
start = BrickStoreXML
# the rename of the root element to BrickStockXML didn't make any sense,
# but now we have to deal with it:
BrickStoreXML = element BrickStoreXML | BrickStockXML {
Inventory, GuiState?
}
# Currency is optional. The default currency is USD.
#
# BrickLinkChangelogId is optional, but quite helpful when automatically applying item and color
# renames and merges (see also https://www.bricklink.com/btchglog.asp?viewHelp=Y)
Inventory = element Inventory {
attribute Currency { xsd:string { length="3" } }?,
attribute BrickLinkChangelogId { xsd:integer } }?,
Item*
}
Item = element Item {
# Required elements
element ItemID { xsd:string { minLength="1" } } &
element ItemTypeID { xsd:string { length="1" } } &
element ColorID { xsd:integer } &
element Qty { xsd:integer }? & # default: 0
element Price { xsd:double }? & # default: 0
element Status { string "I" | string "X" | string "E" }? &
# I = include, X = exclude, E = extra
element Condition { string "N" | string "U" }? &
# N = new, U = used
# Optional: the actual item data. Do not write these tags at all, if value equals default value
element Bulk { xsd:integer { minInclusive="1" } }? & # default: 1
element Sale { xsd:integer }? & # default: 0
element Comments { xsd:string }? & # default: no comment
element Remarks { xsd:string }? & # default: no remark
element Retain { empty }? & # default: no retain
element Reserved { xsd:string }? & # default: no reserve
element LotID { xsd:integer }? & # default: 0
element TQ1 { xsd:integer }? & # default: 0
element TP1 { xsd:double }? & # default: 0
element TQ2 { xsd:integer }? & # default: 0
element TP2 { xsd:double }? & # default: 0
element TQ3 { xsd:integer }? & # default: 0
element TP3 { xsd:double }? & # default: 0
element TotalWeight { xsd:double }? & # default: 0 (catalog weight * quantity)
element Cost { xsd:double }? & # default: 0
element SubCondition { string "C" | string "I" | string "M" }? & # default: no sub-condition
# C = complete, I = incomplete, M = sealed/MISB
element Stockroom { string "A" | string "B" | string "C" }? & # default: no stockroom
# Optional: useful to track an item across catalog updates
element ItemName { xsd:string }? &
element ItemTypeName { xsd:string }? &
element ColorName { xsd:string }? &
element CategoryID { xsd:integer }? &
element CategoryName { xsd:string }? &
# Optional: deprecated - replaced by the more versatile DifferenceBaseValues
element OrigQty { xsd:integer }? & # default: 0
element OrigPrice { xsd:double }? & # default: 0
# Optional: new elements added in BrickStore 2021.3.3
element MarkerText { xsd:string }? & # default: no marker text
element MarkerColor { xsd:string }? & # default: no marker color, format: #RRGGBB
# Difference mode base values:
# All attributes are optional and have a corresponding element defined above
element DifferenceBaseValues {
attribute ItemID { xsd:string { minLength="1" } }?,
attribute ItemTypeID { xsd:string { length="1" } } &
attribute ColorID { xsd:integer } &
attribute Qty { xsd:integer }?,
attribute Price { xsd:double }?,
attribute Status { string "I" | string "X" | string "E" }?,
attribute Condition { string "N" | string "U" }?,
attribute Bulk { xsd:integer { minInclusive="1" } }?,
attribute Sale { xsd:integer }?,
attribute Comments { xsd:string }?,
attribute Remarks { xsd:string }?,
attribute Retain { empty }?,
attribute Reserved { xsd:string }?,
attribute LotID { xsd:integer }?,
attribute TQ1 { xsd:integer }?,
attribute TP1 { xsd:double }?,
attribute TQ2 { xsd:integer }?,
attribute TP2 { xsd:double }?,
attribute TQ3 { xsd:integer }?,
attribute TP3 { xsd:double }?,
attribute TotalWeight { xsd:double }?,
attribute Cost { xsd:double }?,
attribute SubCondition { string "C" | string "I" | string "M" }?,
attribute Stockroom { string "A" | string "B" | string "C" }?,
attribute ItemName { xsd:string }?,
attribute ItemTypeName { xsd:string }?,
attribute ColorName { xsd:string }?,
attribute CategoryID { xsd:integer }?,
attribute CategoryName { xsd:string }?
}?
}
# GuiState is free for any UI editor to use for non-essential data. Make sure to write a
# matching Application/Version attribute pair, so other editors can safely ignore your data.
GuiState = element GuiState {
attribute Application { xsd:string },
attribute Version { xsd:string },
AnyXML*
}
AnyXML = element * {
(attribute * { text } | text | AnyXML)*
}