# MTP document scheme (version 0.1) 2005-07-27 # Relax NG Compact (mtp.rnc) form is base for all others (XMLScheme, DTD), which are generated by 'trang' # Klokan Petr Pridal # TODO: Beter handling of date types #Klokan comment: element salary { xsd:decimal { minInclusive="0" maxExclusive="10000000" fractionDigits="2" } }, #Klokan comment: attribute id { xsd:string { pattern = "[A-Z]{2,3} \d{2}-\d{2}" } } #Klokan comment: element country { xsd:string { minLength="2" maxLength="2" } } start = MTPDocument MTPDocument = element MTPDocument { attribute preparationDate { xsd:date }?, attribute preparationTime{ xsd:time }?, attribute preparationSystem { text }?, attribute preparationSystemVersion { text }?, Job, Supplier, element DocumentNoteFromSupplier { text }?, element DocumentSupplierReference { text }?, LineItem+, Attachment* } Job = element Job { attribute id {text}, element State { 'Requisition' | 'RequestForQuote' | 'Quote' | 'PurchaseOrder' | 'OrderConfirmation' | 'Invoice' }, element Type {text}, element NeedByDate {text}, element Priority {text}, element REQRaised {text}?, element REQReceived {text}?, element Budget {text, attribute code {text}}, element NoteToSupplier {text}?, element Justification {text}?, ShipOwner, Vessel, DeliveryPort, Equipment? } ShipOwner = element ShipOwner { attribute id { xsd:integer }, Name, Address, BillingAddress?, Country, Telephone, Email, Fax, Web } Name = element Name {text} Address = element Address {text} BillingAddress = element BillingAddress {text} Country = element Country {text, attribute code {text} } Telephone = element Telephone {text} Email = element Email {text} Fax = element Fax {text} Web = element Web {text} Vessel = element Vessel { Name, element IMO {text}, element Contact {text}?, element ContactTelephone {text}? } DeliveryPort = element DeliveryPort { DeliverTo?, element Pier {text}, element Port {text}, element City {text}, Country, element ETA {text}, element ETD {text} } Supplier = element Supplier { attribute id { xsd:integer }, Name, Address, BillingAddress, Country, Telephone, Email, Fax, Web } Equipment = element Equipment { Name, Manufacturer, Model, element SerialNumber { text } } LineItem = element LineItem { attribute id {text}, element Description{text}, element Quantity {text, attribute uom {text}}, element Price {text, attribute currency {text}}, Manufacturer, Model, element OnBoard {text}, element NoteToSupplier {text}?, element NoteFromSupplier {text}? } Manufacturer = element Manufacturer {text} Model = element Model {text} Attachment = element Attachment { text, attribute fileName { text }, attribute contentType { text }?, attribute encoding { "Base64"| "UU" | ""}?, attribute location { text }? } DeliverTo = element DeliverTo { attribute id { xsd:integer }, Name, Address, BillingAddress, Country, Telephone, Email, Fax, Web }