Dynamic Import sample Map file
This Dynamic Import map file, Play.map can be used with the sample XML file.
- Global Data
-
The section beginning
# Start of fileand endingEND GLOBALcontains information that Dynamic Import uses to connect and login to the server, and to find necessary supporting SDL Contenta files. - Mappings
-
The sections beginning ELEMENT and ending END ELEMENT are the mappings. The sections contain the keywords ELEMENT and PCMOBJECT. These keywords map the XML tag (ELEMENT) to a Contenta object type. (PCMOBJECT).
For example, the first rule maps the XML element PLAY to the Contenta CompoundDoc object (both are highlighted in bold type in the example). Dynamic Import looks for the start and end PLAY element tags, creates a CompoundDoc object, and stores the data between the PLAY element tags in the object—unless the data belongs to an element that is also object-mapped (such as FM; see below).
For the next rule, DI looks for the FM start and end tags within the start and end PLAY element tags (note that the IN keyword is defined as PLAY), creates a DataModule and stores the data between the FM element tags in the DataModule object. Since the data in the FM element tags is a subset of PLAY, the Contenta object is stored as a child of the PLAY CompoundDoc object in the SDL Contenta database.
The PLAY CompoundDoc object contains the data in the XML elements that are not mapped. When the PLAY CompoundDoc object is opened in an XML editor, the data in the CompoundDoc object plus all Contenta objects stored as a child of PLAY are concatenated and opened in the editor.
Refer to: For complete information about Dynamic Import (DI), the map file and keywords, and the DI processes, refer to the SDL Contenta Dynamic Import User section of the Contenta documentation.
- Play.map
-
The following is a sample Dynamic Import map file. This map file can be used with the sample XML file provided in this document.
# Start of file COMMENT: Generic Import Tool Specification File PCMLOADLOC: /Global/sysadmin/XyBooks, Inc./Stable Data/Plays OMNIIN: c:/contenta/encaps/di/sgmlfi~1/dream.xml WORKDIR: c:/contenta/encaps/di OMNILIB: c:/contenta/encaps/di/entities/omnilib OMNIOUT: c:/contenta/encaps/di/Tmp/omni.out OMNICTRL: c:/contenta/encaps/di/Tmp/omni.ctrl IMPORTDTD: c:/contenta/encaps/di/entities/imp.dtd USER: sysadmin PASSWORD: SERVER: bellarosa DATABASE: apidoc SOCKET: 6050 DOCTYPE: play SECURITY: secure SGMLDECL: c:/contenta/encaps/di/entities/Sgml.dec END GLOBAL ELEMENT: play RULENOTE: PCMOBJECT: CompoundDoc IN: ANY OBJNAME: ELEMENT=title ATTRS: YES HIER: CONTAINER PROPSHEET: YES APPDATA: YES CONTAINS: CHILDREN SLICEDATA: YES END ELEMENT ELEMENT: fm RULENOTE: PCMOBJECT: DataModule IN: play OBJNAME: FM ATTRS: YES HIER: CHILD PROPSHEET: YES APPDATA: YES CONTAINS: DATA SLICEDATA: YES END ELEMENT ELEMENT: scndescr RULENOTE: PCMOBJECT: DataModule IN: play OBJNAME: SceneDescription ATTRS: YES HIER: CHILD PROPSHEET: YES APPDATA: YES CONTAINS: DATA SLICEDATA: YES END ELEMENT ELEMENT: playsubt RULENOTE: PCMOBJECT: DataModule IN: play OBJNAME: PlaySubt ATTRS: YES HIER: CHILD PROPSHEET: YES APPDATA: YES CONTAINS: DATA SLICEDATA: YES END ELEMENT ELEMENT: personae RULENOTE: PCMOBJECT: CompoundDoc IN: play OBJNAME: ELEMENT=title ATTRS: YES HIER: CONTAINER PROPSHEET: YES APPDATA: YES CONTAINS: CHILDREN SLICEDATA: YES END ELEMENT ELEMENT: pgroup RULENOTE: PCMOBJECT: DataModule IN: play/personae OBJNAME: ELEMENT=grpdescr ATTRS: YES HIER: CHILD PROPSHEET: YES APPDATA: YES CONTAINS: DATA SLICEDATA: YES END ELEMENT ELEMENT: act RULENOTE: PCMOBJECT: CompoundDoc IN: play OBJNAME: ELEMENT=title ATTRS: YES HIER: CONTAINER PROPSHEET: YES APPDATA: YES CONTAINS: CHILDREN SLICEDATA: YES END ELEMENT ELEMENT: scene RULENOTE: PCMOBJECT: CompoundDoc IN: play/act OBJNAME: ELEMENT=title ATTRS: YES HIER: CONTAINER PROPSHEET: YES APPDATA: YES CONTAINS: CHILDREN SLICEDATA: YES END ELEMENT ELEMENT: speech RULENOTE: PCMOBJECT: DataModule IN: play/act/scene OBJNAME: ELEMENT=line ATTRS: YES HIER: CHILD PROPSHEET: YES APPDATA: YES CONTAINS: DATA SLICEDATA: YES END ELEMENT # End of file - Sample di.map file exported into a document directory by a GetDoc adapter
-
# Start of file ELEMENT: FM PCMOBJECT: Module IN: PLAY OBJNAME: ELEMENTNAME=INCR END ELEMENT ELEMENT: TITLE PCMOBJECT: Module IN: PLAY OBJNAME: ELEMENTNAME=INCR END ELEMENT ELEMENT: SCNDESCR PCMOBJECT: Module IN: PLAY OBJNAME: SceneDescription END ELEMENT ELEMENT: PLAYSUBT PCMOBJECT: Module IN: PLAY OBJNAME: PlaySubt END ELEMENT ELEMENT: PERSONAE PCMOBJECT: Module IN: ANY OBJNAME: ELEMENTNAME=INCR END ELEMENT ELEMENT: ACT PCMOBJECT: Module IN: PLAY OBJNAME: ELEMENT=title END ELEMENT # End of file