The following rules should be applied when mapping an existing UN/EDIFACT Message Implementation Guide (MIG) to an XML Document Type Defintion (DTD).
UN-EDIFACT
namespace.
xmlns
namespace declaration.
xmlns:UN-EDIFACT
attribute.
UN-EDIFACT:Id
.
Example:
<!ELEMENT FirmBooking (MessageID, Date*, Requirements*, FreeText*, TermsGroup*, RefersTo*, GovernmentReqsGroup*, ChargeRatesGroup*, TransportDetailsGroup*, NameAndAddressGroup*, GoodsIdentityGroup*, EquipmentDetailsGroup*) > <!ATTLIST FirmBooking xmlns CDATA #FIXED "http://www.tieke.fi/transport/IFTMBF" xmlns:UN-EDIFACT CDATA #FIXED "http://www.un.org/edifact/D96B/" xmlns:ISIS CDATA #FIXED "http://www.tieke.fi/isis-xmledi" UN-EDIFACT:Id CDATA #FIXED "IFTMBF:D:96B:UN:FI0076" UN-EDIFACT:Attributes CDATA #FIXED "0062 ReferenceNumber 0068 AccessReference" ReferenceNumber CDATA #REQUIRED AccessReference CDATA #IMPLIED >
Note: The ISIS namespace is used to define the constraints that apply to elements. As there are no standards for defining such constraints at present this technique is currently project specific.
To be determined: Whether the S010 status identifiers need to be recorded in the message, or are part of the message transport protocol's handshake information.
ReferenceNumber
and AccessReference
attributes in example above.
Group
to the name.
<!ELEMENT TransportDetailsGroup (TransportDetails, Date*, Locations*)* > <!ELEMENT DangerousGoodsGroup (DangerousGoods, FreeText*, MeasurementsGroup*, SplitGoodsGroup*)* >
UN-EDIFACT:Segment
.
Segment
qualifier allows the query to be directed to the
part of the UN directory that lists segment details.
Example: When CustomStatus is chosen as the subject qualifier of a free text segment then, and only then, a text reference must be used.
<!ELEMENT GovernmetnReqsGroup (GovernmentRequirements, (CustomsStatus?, FreeText*)?) > <!ELEMENT CustomsStatus (TextID) > <!ATTLIST CustomsStatus UN-EDIFACT:Segment CDATA #FIXED "FTX" UN-EDIFACT:Attributes CDATA #FIXED "4451 SubjectQualifier 4453 FunctionCode 3453 LanguageCode 4447 FormatType" SubjectQualifier CDATA #FIXED "CustomsStatus" FunctionCode CDATA #IMPLIED LanguageCode CDATA #FIXED "ISO 639" FormatType CDATA #IMPLIED ISIS:Constraints ENTITY #FIXED "CustomsStatus.constraints" > <!ELEMENT FreeText (Line, (Line, (Line, (Line,Line?)?)?)?) > <!ATTLIST FreeText UN-EDIFACT:Segment CDATA #FIXED "FTX" UN-EDIFACT:Attributes CDATA #FIXED "4451 SubjectQualifier 4453 FunctionCode 3453 LanguageCode 4447 FormatType" SubjectQualifier (Order|Delivery| Transportation| CustomsDeclaration| SpecialInstructions| GoodsDescription| DGS-AdditionalInformation| DGS-TechnicalName) #REQUIRED FunctionCode CDATA #IMPLIED LanguageCode CDATA #FIXED "ISO 639" FormatType CDATA #IMPLIED ISIS:Constraints ENTITY #FIXED "FreeText.constraints" >
UN-EDIFACT:Segment
.
(The Segment
qualifier allows the query to be directed to the
part of the UN directory that lists segment details.)
Example:
<!ELEMENT NumberOfUnits (#PCDATA) > <!ATTLIST NumberOfUnits UN-EDIFACT:Segment CDATA #FIXED "EQN" UnitsQualifier CDATA #IMPLIED ISIS:Constraints ENTITY #FIXED "NumberOfUnits.constraints" >
?
optional element indicator.
EMPTY
.
Example:
<!ELEMENT ProductIDs (ItemID, (ItemID, (ItemID, (ItemID, ItemID?)?)?)?) > <!ATTLIST ProductIDs UN-EDIFACT:Segment CDATA #FIXED "PIA" ISIS:Constraints ENTITY #FIXED "ProductIDs.constraints" >
UN-EDIFACT:Composite
.
(The Composite
qualifier allows the query to be directed to the
part of the UN directory that lists composite details.)
Example:
<!ELEMENT Requirements (ContractType?, (Service, Service?)?, Priority?, NatureOfCargo?) > <!ATTLIST Requirements UN-EDIFACT:Segment CDATA #FIXED "TSR" ISIS:Constraints ENTITY #FIXED "Requirements.constraints" > <!ELEMENT ContractType (#PCDATA) > <!ATTLIST ContractType UN-EDIFACT:Composite CDATA #FIXED "C536" Qualifier CDATA #IMPLIED Agency (AssignedByOriginator| AssignedByCarrier) #IMPLIED ISIS:Constraints ENTITY #FIXED "ContractType.constraints" >
UN-EDIFACT:Element
.
(The Element
qualifier allows the query to be directed to the
part of the UN directory that lists data element details.)
Example:
<!ELEMENT Service (#PCDATA) > <!ATTLIST Service UN-EDIFACT:Element CDATA #FIXED "7273" Qualifier CDATA #IMPLIED Agency (AssignedByOriginator| AssignedByCarrier) #IMPLIED ISIS:Constraints ENTITY #FIXED "Service.constraints" >
UN-EDIFACT:Attributes
whose value consists of pairs of tokens in which the first member is the
UN-assigned number of the data element and the second is the name of the attribute
used (within this element) to record the value assigned to that data element.
Example:
<!ELEMENT MessageID (#PCDATA) > <!ATTLIST MessageID UN-EDIFACT:Segment CDATA #FIXED "BGM" UN-EDIFACT:Attributes CDATA #FIXED "1001 MessageTypeCode 1131 Qualifier 3055 Agency 1000 MessageTypeName 1225 MessageFunction 1056 Version 1060 RevisionNo 4343 ResponseType" MessageTypeCode CDATA #IMPLIED Qualifier CDATA #IMPLIED Agency CDATA #IMPLIED MessageTypeName CDATA #IMPLIED MessageFunction CDATA #IMPLIED Version CDATA #IMPLIED RevisionNo CDATA #IMPLIED ResponseType CDATA #IMPLIED ISIS:Constraints ENTITY #FIXED "MessageID.constraints" >
Example:
<!ELEMENT Temperature (#PCDATA) > <!ATTLIST Temperature UN-EDIFACT:Segment CDATA #FIXED "TMP" UN-EDIFACT:Attributes CDATA #FIXED "6245 TemperatureQualifier 6411 MeasurementUnit" TemperatureQualifier CDATA #FIXED "TransportTemperature" MeasurementUnit (Celsius|Kelvin| Fahrenheit) #IMPLIED ISIS:Constraints ENTITY #FIXED "Temperature.constraints" >
"CDATA"
or "NMTOKEN"
, or it can be a reference to
the system identifier of an external entity that contains the definition of
the permitted values for the code list.
Example:
<!ENTITY % Stages "(PreCarriage|MainCarriage|FirstCarrier| SecondCarrier|ThirdCarrier|OnCarriage)" > <!ENTITY % Directions SYSTEM "direction.txt" > <!ENTITY % Owners "CDATA" > <!ELEMENT TransportDetails (ConveyanceNumber?, Mode?, Means?, Carrier?, Excess?, Identification?) > <!ATTLIST TransportDetails UN-EDIFACT:Segment CDATA #FIXED "TDT" UN-EDIFACT:Attributes CDATA #FIXED "8051 StageQualifier 8101 DirectionCode 8281 OwnershipCode" StageQualifier %Stages; #REQUIRED DirectionCode %Directions; #IMPLIED OwnershipCode %Owners; #IMPLIED ISIS:Constraints ENTITY #FIXED "TransportDetails.constraints" >
Example: See TemperatureQualifier
in Temperature
example above.
Example:
<!ELEMENT Date (#PCDATA) > <!ATTLIST Date UN-EDIFACT:Segment CDATA #FIXED "DTM" UN-EDIFACT:Attributes CDATA #FIXED "2005 Of 2379 Format" Of (Document|Departure| Arrival) "Document" Format (Date|Period) "Date" ISIS:Constraints ENTITY #FIXED "Date.constraints" >
ISIS:Constraints
that references
an entity declared in the DTD that identifies an XML file containing details
of the constraints to be applied
ISIS
name space
to indicate that the structure of this XML file has been defined by the
ISIS XML/EDI Pilot Project consortium rather than a recognized standards body.
It is anticipated that more detailed constraints will be needed at a later stage,
and that these will probably be provided by referencing XML Schemas containing relevant
datatype specifications.
Example:
<!ENTITY ConveyanceNumber.constraints SYSTEM "../Constraints/ConveyanceNumber.xml" NOTATION "ISIS-Constraints" > <!ELEMENT ConveyanceNumber (#PCDATA) > <!ATTLIST ConveyanceNumber UN-EDIFACT:Element CDATA #FIXED "8028" ISIS:Constraints ENTITY #FIXED "ConveyanceNumber.constraints" >
xlink:href='messages/message1234//id("item2345")'
.
Alternatively the reference can be to an element with specific contents,
e.g. xlink:href='[ReferenceNumber="Message1234"]'
Example:
<!ELEMENT RefersTo EMPTY > <!ATTLIST RefersTo UN-EDIFACT:Segment CDATA #FIXED "RFF" DocType CDATA #REQUIRED DocID CDATA #IMPLIED Line CDATA #IMPLIED Version CDATA #IMPLIED RevisionNo CDATA #IMPLIED xlink:href CDATA #REQUIRED xmlns:xlink CDATA #FIXED "http://www.w3.org/XML/XLink/0.9" xlink:type CDATA #FIXED "simple" xlink:role CDATA #FIXED "reference" xlink:show CDATA #FIXED "new" xlink:actuate CDATA #FIXED "user" ISIS:Constraints ENTITY #FIXED "RefersTo.constraints" >