Home
Altova MapForce User Manual
Contents
1. Saves the current file in the specified document control window function BtnSaverFitle ob jDocCtr if ob DocCtrl Path length gt 0 objDocCtrl SaveDocument else 1f strPath value length gt 0 ob 1 DecCtrl Path StrPacth value objDocCtrl SaveDocument alert Please set path for the document first strPath focus ob jDocCtrl setActive lt SCRIPT gt Create Event Handler to Update Button Status Availability of a command may vary with every mouseclick or keystroke The custom event OnUpdateCmduI of MapForceControl gives us an opportunity to update the enabled disabled state of buttons associated with MapForce commands The method MapForceControl QueryStatus IS used to query whether a command is enabled or not lt SCRIPT FOR objMapForceX event OnUpdateCmdUI LANGUAGE Jjavascript gt if document readyState complete complete update status of buttons GeneratexSLT disabled objDocl QueryStatus 13617 amp 0x02 not enabled GenerateJava disabled objDocl QueryStatus 13587 amp 0x02 not enabled GenerateCpp disabled l ob yDocl Ouerystatus 13509 amp Ux02 not enabled GenerateCSharp disabled not enabled objDocl QueryStatus 13588 amp 0x02 btnFuncUserDef disabled ob jDocl QueryStatus 13633 amp 0x02 btnFuncUserDefSel disabled objDocl QuerySta
2. gt fa equal tea fa filter Pnoderrow on truel on talsele r rezulti ho ho E Prototype kon La ho fa equal result ho hoa ho kog m a a a a a a a a a a E re T 7 f r La La F La 1 La 0 Li i i L j baat r ho _ _ a koa E Customers A mE 7 Customers E Customer Y Number Y FirstName 7 LastName E Address Street 7 kon in ho Sad how how Lt Lt Lt Lt Lt Lt Lt Lt od Only approximately one tenth of the database relations hierarchy is used in this instance the other 90 are redundant and cause a large overhead 2006 Altova GmbH Altova MapForce User Manual 160 MapForce and Databases Mapping large databases with MapForce 7 1 2 Partial database import Option 2 Import only those tables that are necessary to extract the necessary information i e e retrieve all defective units e retrieve all customers to whom these units were supplied Insert two database components from the same database importing different sets of tables Component 1 insert the following tables e ComponentType e Unit Components e Unit Component 2 insert e Unit e Customer Units e Customer Mapping process e filter out the Component Name Prototype AND the Manufacturer NoName component 1 e use the equal function compare the unit ID from component 1 with the unit ID f
3. eee 10 3 1 Complex input components defining 0 0 eeeeeeeeeeeees 10 4 Complex user defined function XML node as output ee 10 4 1 Complex output components defining 0 0 0 eeeeeeeeeeees 10 5 User defined function example cccccccccccccccceccccceeececceeeeeeeeeeeeeeeees 11 Adding custom libraries DLA Conngurine the AAT ETC gare ccicss tects tuendecaenteranabacncenaes tasers buepdodetntavanesaursouess 11 2 Defining the component user interface 0 0 0 ccccccccessssseeeeeeeseeeeeeeees 11 3 Function implementation details ccccccccccceccccececeeeessessesseeeeeeeeees 114 Write your IDrarieS sx cacccccarassgeacccenssceserapeamemacnaneeacoteseadenentanstegeameneseaeens 12 Adding custom XSLT 1 0 functions Altova MapForce User Manual 13 Adding custom XSLT 2 0 functions 240 14 Adding custom XQuery functions 242 15 Aggregate functions summing nodes in XSLT1 and 2 244 16 Type conversion checking 248 17 MapForce Exceptions 250 18 MapForce engine 254 19 FlexText 258 L OVW a eee er ee ere er eee en ee ee ere ee E ee 259 O PeT a TO a EE E A so aeeesaaeanacd te aacencboe send aieees 262 19 3 Creating split conditions cicicase cices dservonsiyanedensaedncanenennecadcarvanddueneVabsaadscasioedneeadoeseanteyeeds 265 19 4 Defining multiple conditions per container fragment eeeseeseeeeeeeeseeesesseseseseseseeseeee 267 19 5 Using FlexText templates in MapForce ss
4. lt SCRIPT gt Altova MapForce User Manual 2006 Altova GmbH MapForceControl Integration at the Application Level 527 Add Buttons for Code Generation Although code generation for the active document is available via menus we want to have buttons that will generate code without asking the user for the location of the output The method is similar to that used in the previous section First come the buttons lt input type button value Generate XSLT onclick BtnGenerate 0 gt lt input type button value Generate Java onclick BtnGenerate 1 gt lt input type button value Generate C onclick BtnGenerate 2 gt lt input type button value Generate C onclick BtnGenerate 3 gt Then we provide the script that will generate the code into sub folders of the currently defined default output folders lt SCRIPT ID Javahandlers LANGUAGE javascript gt generate code for active document into language specific sub folders of the current default output directory No user interaction necessary function BtnGenerate languageID get top level object of automation interface var objApp objMapForceControl Application get the active document var obyjDocument objApp ActiveDocument retrieve object to set the generation output path var objOptions objApp Options if objDocument null alert no active document found else if languageID 0 objOption
5. La F353 oe F7383 GOMER gary 44 C186 ae F6063 7 F6060 ad oe 5 F641 PCD BOAL DTH BOMOA E GE gt A Order gt l E Y Header om Number om Received E 4 Customer men 4 Humber 7 snes 7 ContactName i CompanyName 2c 4 Address ee Street Lae re es 1O L LI LI LI L r kog kog r r a State E 4 Lineltems 4 Lineltem k E Y Article ne Number _ SinglePrice en Y Amount i 2 oe Y Price LI Lt LI LI LI Lt Lt LI Lt LI kog kog kog r kog r kog r a mom M M Lr eu at a 10 10 10 1 1 10 on 0 10 10 or 10 10 1 4 r r r ie af r m r bead r 10 10 at mS 10 ao 10 r r r r s Drag a to datetime function from the edifact library into the Mapping area By applying the F2380 and F2379 components of the DTM C507 element we can create an appropriately formatted Received datetime We therefore map the following fields DTM C507 F2380 DTM C507 F2379 gt the F2380 input of the to datetime function gt the F2379 input of the to datetime function The result of the to datetime function gt Order Header Received 2006 Altova GmbH Altova MapForce User Manual 308 MapForce and EDI UN EDIFACT to XML Schema mapping il ORDERS t sw co02 fe C106 4 DTM AOC E Order a E 4 Order E Header wo Number
6. Title mE Department ka E 7 Person wow PrimaryKey 4 ForeignKey EMail Y First r kaa I kg ie ai _ e m m a I Li iea Ba i a T7 Lt Li 1 a M L kog I i Le Ll Li LF L n it Y PhoneE xt 4 Title Li kaa 3 Activate the Auto connect matching children icon 4 Click the Person item in the XML source file and drag the connector to the Person item of the database Make sure that you connect to the root table Person All matching child items are mapped automatically 2006 Altova GmbH Altova MapForce User Manual 122 MapForce and Databases Mapping XML data to databases Altova i Altova Hierarchical l j HE Address i J gt Phone Department fl Address E e Office E Department A Person oo PrimaryKey Primary key ForeignKey k i m Foreignkey Ta Toe Toe Toe T boa a i kon bs al bal io ol m ea bool bo a a 4 Person ow PrimarypKey 4 ForeignKey EMail 4 First koa bo al B i e e e L Li T7 Lt Li Lt L in ad 1 a ia ol o ai 4 PhoneE xt Y Title a ol ot J LAR LER ot wf J LER it 1 it LT 4 Right click the Person entry and select the menu item Database Table Actions Click the Table action combo box and select Update if Click the combo box in line with the
7. 2006 Altova GmbH Altova MapForce User Manual 578 MapForceControl Object Reference 27 5 6 Enumerations The following enumerations are defined TCActivexiIntegrationLevel MapForceControlPlaceholderWindow ICActiveXIntegrationLevel Possible values for the IntegrationLevel property of the MapForceControl TCActiveXIntegrationOnApplicationLevel TCActiveXIntegrationOnDocumentLevel 1 MapForceControlPlaceholderWindow This enumeration contains the list of the supported additional MapForce windows MapForceXNowindow l MapForceXLibraryWindow MapForcexXOverviewWindow MapForcexXValidationWindow MapForceXProjectWindow CONF Altova MapForce User Manual 2006 Altova GmbH Chapter 28 Appendices 580 Appendices 28 Appendices These appendices contain technical information about MapForce and important licensing information Each appendix contains sub sections as given below Technical Data OS and memory requirements Altova XML Parser Altova XSLT and XQuery Engines Unicode support Internet usage License metering License Information e Electronic software distribution e Copyrights e End User License Agreement Altova MapForce User Manual 2006 Altova GmbH Appendices Engine information 581 28 1 Engine information This section contains information about implementation specific features of the Altova XML Validator Altova XSLT 1 0 Engine Altova XSLT 2 0 Engine and Altova
8. Database Table Actions Altova PE All input data are compared to the DE table data using the operators i 3 defined here C IF all comparitons are true then the specific action i executed e Append Action Insert Action Acton on input data fm Primarykey m mins m ipo m xsi m schemaLocation m Name Delete data in child tables gnore input child data Office hal Delete Action Use Transactions A Altova MapForce User Manual 2006 Altova GmbH MapForce and Databases Mapping XML datato databases 117 The table action Insert All inserts all mapped fields of the current table into the database We now have to define the status of the new PrimaryKey field for this action 5 Click OK to confirm the current settings 6 Right click the PrimaryKey item then select the Database Key Settings entry Table Field PrimaryKey E E x Kep values generation handling f Default handling C Maimun number Database generated value 7 Select the Maximum number entry and click OK to confirm You will notice that the input icon for the PrimaryKey field is now unavailable Address Elz Altova ePrimaryKey 8 Click the Output tab at the bottom of the mapping window to see the pseudo SQL code that this mapping produces This SGiL statements are only for previews and may not be executed in another SiL Giuer To execute these statements use function G
9. Mame gt Callaby Mame lt Name Further Mame Name gt Matise hame gt lt Name Firstbread Mame Mame Redgreens Mame lt OTTice lt lrglhart 2006 Altova GmbH Altova MapForce User Manual 142 MapForce and Databases Database feature matrix 7 5 Database feature matrix The following tables supply information on the mapping capabilities of MapForce vis a vis the major database types The following information is supplied e General info relating to Database as service and authentication issues e Supported connection types e SQL support for schemas join statements etc e Transaction methods supported Altova MapForce User Manual 2006 Altova GmbH MapForce and Databases Database feature matrix 143 7 9 1 Database info MS Access supported implemented in OLEDB provider or ODBC driver authentication is possible own authentication Trusted authentication Connection y y OLE DB connection string none OLE DB ODBC ODBC connection string DB must be applied y a ODBC connection string DATABASE ee y y n n Cc 49 n must not be applied via ODBC JDBC URL issues MF used init Statements none none MF used final Statements none DB object name qualification or support for DB schemas n not supported by Access identity support E MF read back identity value sub select support y epenmy JOIN support limited support MF
10. MappingMainlObject registerTraceTarget ttc MappingMainlObject run C Projects Files XMLSpyExeFolder MapForceExamples ExpReport xml MarketingExpenses xml e Extra error handling code can be inserted under the Exception section catch Exception e or catch CAltovaException amp e Altova MapForce User Manual 2006 Altova GmbH Code Generator Code generation mapping example 431 The code snippets below are the mapping code generated for each specific programming language Java MappingConsole java public static void main String args try SYSCEM CUutT lt printiln Mapping Application TraceTargetConsole tte New TraceTargetConsole MappingMainl MappingMainlObject New MappingMainl MappingMainlObject registerTraceTarget ttc MappingMainlObject run C Projects Files XMLSpyExeFolder MapForceExamples ExpReport xml MarketingExpenses xml System out printin Finished catch Exception e System out print ERROR System out printin e getMessage e printStackTrace System exit 1 C MappingConsole cs public static void Main string args try Console Out WriteLine Mapping Application TraceTargetConsole ttc new TraceTargetConsole MappingMainl MappingMainlObject new MappingMainl MappingMainlObject RegisterTraceTarget ttc MappingMainlObject Run C Projects Files XMLSpyExeFolder MapForceExamples ExpReport xml
11. User and Reference Manual Copyright 21998 2005 Altova GmbH All rights reserved Use of this software is governed by and subject to an Altova software license agreement SMLSpy MapForce StyuleVision SemanticWorks Sche ma gent UModel Dif Dog Authentic Altova 8ML and ALOWA are trademarks andror registered trademarks of 4ltova GmbH Patent pending AML SSL xHTML and WSC are trademarks registered in numerous countries of the world wide web Consortium marks of the Wal are registered and held by its host institutions MIT INRIA and Keio UNICODE andthe Unicode Logo are trade marks of Unicode Inc This sofware contains mate rial that is 01334 1334 Dundas Software Lid all rights reserved The Sentry Spelling Checker Engine 2 2000 Winkertres Sofbware Inc STLport 21333 2000 Boris Fomitchey 1334 Hewlett Packard ALTOVA Company 1536 37 Silicon Graphics Computer Systems Inc F137 Moscow Center For _ SPARC Technology Scintilla Copyright 1355 2002 by Neil Hodgson lt neilh scintilla org ATLA Copyright 21453 2005 by Terence Parr twwew antlroong All other names or trade marks are the property of their respective owners Altova MapForce User Manual All rights reserved No parts of this work may be reproduced in any form or by any means graphic electronic or mechanical including photocopying recording taping or information storage and retrieval systems without the written permission of the
12. se m Lt 1 iaa kaa sha 3 Select the menu option Connection Auto Connect matching children 4 Click the Person item in the XML source file and drag the connector to the Person item of the database Make sure that you connect to the root table Person All matching child items are mapped automatically Right click the Person entry and select the menu item Database Table Actions Click the Table action combo box and select Delete if Click the Append Action button This automatically inserts a new Table action column with the table action Insert Rest PEON 2006 Altova GmbH Altova MapForce User Manual MapForce and Databases Mapping XML data to databases Database Table Actions Person All input data are compared to the DE table data using the operators defined here IF all comparisons are true then the specific action i executed Insert Rest ai Cancel Append Action Inzert Acton Delete if egual Acton on input data fm Primarykey fm Foreignkep E Mail m First m Last m PhoneE xt A Title a ae Delete Action Use Transactions A The source and target primary keys are compared using the equal operator If the two keys are identical then the mapped fields of the Person tables are deleted Once this has been achieved the next table action is started in this case Insert Rest Insert Rest inserts all those records fr
13. sssssssssssssssssssssssssssssssssssssessssssesseseseseeseeseeeeeeee 32 32 Mappe schema METIS jaceeesesacstorcancenacesassncuqucie EE 34 Bed Using functions to map data sicuscccchecensesns sed acGeenunserassneceicaceecoxannelaeeeeeunsaseseqsannceecanessaleees 37 34 Flerin AL eps A ESENES 4 393 Generating XSLT 1 0 and 2 0 COGS scivcccvsnccvsevnscoasvicnscisesinsduessivonesnseliesamassvacossaissdwosciooscyiss 45 3 6 Maltipletarset schemas COCUMECHIIS s c1 s0sssrsdeacseses cccannsdecsatseavassensinacsceracesabesdocssusaases 47 3 6 1 Viewing and generating multiple target schema output ceeeeeeeeees 50 3 7 Mapping multiple source items to single target items ccccccececceeeeeeeeeeeseeeeeeeees 32 SLE ATCA ihe Mapping S sorsoran o aeai i rana rr RENO 53 312 Duplicating input temis assis ecsmea tenet csussaseusrtencatnaddcanmaedecsisoruaeseestesestedbenazens 56 De Database to schema Mapping gc ncaa ee eng ea cee eee ees 61 3 8 1 Mapping database data 20 cccsssssssssssseeeccceceeeeeeeeeaaasasssseeseeeeeeeeeeeeeeeeeaaas 64 4 Source driven mixed content mapping 68 4 1 Default settings mapping mixed content ee eeeeeeeeeeeeeeeeteeeeneeesenteeeteeeeeeeeeeeeaeaaaaes 71 A MAKEC COMLENLE example ccccrccost2eraietusntssnuntanacesdamsadosstescsobiuntaieundanasevianpasesstaseiebiunlevesniaradss 75 4 3 Source driven mixed content vs standard mapping ce ceecccccccceeesssssseseeesseeeeeeeees 77 Altova Map
14. 21 3 Generating Java webservices with MapForce MapForce generates all necessary code and scripts needed create a webservice The only difference to the normal code generation process is that the generated code has to be deployed on the Axis Tomcat server Note that when the webserver is running on a remote computer e The user must have remote administration rights e The Axis framework has to be partially installed on the local computer e When deploying webservices to a local computer i e server is the local computer these issues are irrelevant Generating Java code Having created or opened the Query Person database mfp project file used in the previous section 1 Right click the project name in the project window and select Generate code in Java 2 Select the output directory java dev in this case and hit OK to generate The following folders and files are automatically generated in the target directory e mapping jpx Jbuilder project deploy wsdd undeploy wsdd build xml file ant built script a com directory with subdirectories altova and MapForce Compiling generated Java code ANT 1 Compile the generated code by calling ANT This automatically uses the generated build xml file to compile the webservice mapping A Build successful message appears when the compile process is OK Deployment Apache Tomcat amp Axis There are two things that need to be done when deploying or registering Java
15. E Meal E Lodging E Travel l Parking Lr i i cae es explo ce ee m i Heal E Lodging 2004 07 07 z E Travel To allow date calculations as shown in the example above the value of the Date element although defined as being of type xs date datatype must be explicitly converted to xs date using the xs date constructor before it can be used for a date calculation Similarly the string constant 2004 07 07 must also be explicitly converted to the xs date datatype before being used for a date calculation The subtract function when performed on two xs date values is actually the abstract op subtract dates function which returns an xdt dayTimeDuration value Altova MapForce User Manual 2006 Altova GmbH Chapter 14 Adding custom XQuery functions 242 Adding custom XQuery functions 14 Adding custom XQuery functions MapForce allows you to import XQuery library modules Please see the XQuery implementation specific document for more information Altova MapForce User Manual 2006 Altova GmbH Chapter 15 Aggregate functions summing nodes in XSLT1 and 2 244 Aggregate functions summing nodes in XSLT1 and 2 15 Aggregate functions summing nodes in XSLT1 and 2 This section describes the method you can use to process multiple nodes of an XML instance document and have the result mapped as a single value to a target item The files used in this example are available in th
16. Se qment gt Element gt Include href s lz Segment gt lt MHessage gt Hessagelype gt sS0 Messaqelype gt Description gt Purchase Order TDescription gt Previewing the new field in MapForce s l EDI Select the menu option Insert EDI or click the Insert EDI icon Click the X12 Nanonull tab and select the 850 Purchase Order transaction Click the Cancel button to skip the selection of the source EDI file for the moment The 850 component is now visible in the mapping window Navigate to Envelope Interchange Group Message LoopN1 N2 to see the new X1000 element 2006 Altova GmbH Altova MapForce User Manual 342 MapForce and EDI Customizing an ANSI X12 transaction ac gt TXI Tax Information j fd LoopLDT p 4 LoopAMT p i HE Y LoopH9 Ei LoopN1 l OP ECNI Party Identification HE N2 Additional Name Information FOS Name Pi be SAT O00 New Element Pp BEE Q IN2 Individual Name Structure Lana MNS Party Location r Please note The Elements Segments section should be inserted before the Include element due to the definition of the EDIConfig xsd file in the MapForceEDI folder which allows you to validate the result of EDI mappings in the Output window Altova MapForce User Manual 2006 Altova GmbH MapForce and EDI Customizing an ANSI X12 transaction 343 20 6 5 Inline customization e Chang
17. Tjtugq ea 2005 Lie Altova MapForce User Manual 2006 Altova GmbH FlexText FlexText Reference 285 7 Click the append icon to add a new condition to the Switch container 8 Double click in the Content starts with field enter Starting and hit Return You can add as many conditions as you need e g Pausing and Stopping Give each of the associated containers a name to make recognition in MapForce easier Initialize Re Type sting Content contains Initializ Trim No Content contains 2 Starting Content contains Starting Content contains Fausing Z Content contains Stopping Type string Output For all triggered con Trim Mo 1g ana D LJINFO Starting service aj4ugq 22 2005 1 22 17 PH Content contains Pausing Pausing rl TAL Tope sting Trim No Stopping Type sting Trim Na default The screenshot above shows all four conditions and the contents of the Starting container at block fragment no 4 The associated containers have all been renamed to make identification in the MapForce component easier Note that conditions can be el down in the condition list using the respective Move Up Down buttons or B 9 Save the template and insert it in MapForce 2006 Altova GmbH Altova MapForce User Manual 286 FlexText FlexText Reference OJ switch OJ Text file gt a F Root gt gt E 4 Rows _ E 7 Repeated split P
18. function IterateAllProjectItems objProject objMapForce ActiveProject if objProject null IterateProjectItemsRec new Enumerator objProject Events This object supports the following events OnProjectClosed OnProjectClosed Event OnProjectClosed i_objProject as Project Description This event is triggered when the project is closed The project object passed into the event handler should not be accessed The corresponding open event is Application OnProjectOpened AddActiveFile Method AddActiveFile as ProjectIten Description Adds the currently open document to the mapping folder of the project s root Errors 1500 The object is no longer valid Altova MapForce User Manual 2006 Altova GmbH The MapForce API Object Reference 501 1501 Invalid address for the return parameter was specified 1503 No active document is available 1504 Active documents needs to be given a path name before it can be added to the project 1705 Mapping could not be assigned to project Maybe it is already contained in the target folder AddFile Method AddFile i_strFileName as String as ProjectItem Description Adds the specified document to the mapping folder of the project s root Errors 1500 The object is no longer valid 1501 The file name is empty Invalid address for the return parameter was specified 1705 Mapping could not be assigned to project The file does not exist or
19. gd i il Lt Lt Lt T py i Lt L 5r how Lo default First_Mame detautt Last_Name how how ontru ool F Phone fl Address E 4 Department Y Primarykey ForeignkKey Pr a F Ta ha hoa Person2Details gt Details ho B LER re e The three input components input 1 to input 3 receive their data from the BranchOffices xml file e The EqualAnd component compares two values and provides an optional comparison value as well as a default value e Person2Details combines three person fields and passes on the result to the filter component 2006 Altova GmbH Altova MapForce User Manual 218 User defined functions User defined function example EqualAnd component i Equaltnd Pe result ee result adetauk Ottice Mame ka O EgualAn Double clicking this user defined component displays its constituent components shown below What this component does is e Compare two input parameters a and b and pass the result on to the logical and component Note that the b parameter has been defined as the priority context right click the icon to do so This ensures that the person data of the specific office supplied by the input parameter a is processed first e Logical and the result of the first comparison with an optional input parameter Input 3 e Pass on the boolean value of this comparison to the output parameter pdefault
20. oonneenseesssssssssssssseseeerressessssssssssses 111 7 3 2 Components and table relationships 0oseeeeeseessssssssssssssseeeereessssssssssssssse 114 ede Database action IMSEN reserorestieini soies anaE EE S 116 Tad Database action Update sca ccicictececsscessareoaicsateoncensccsierseeasacaaaasetasncescaunseonieeees 121 Update if combinations with delete child dtd ccccccccccccccccccsesccecessessees 126 7 3 5 Database action Delete sacicceserscicectinstacdonteeacaennshacdeatecacecnistac oetecaceasieniactaaracacas 131 lao Database key SEMNE Goose ca cess vsen couse EE eE EEEE REEE 134 7 3 7 Database Table Actions and transaction processing cccccccceeeeeeeeeeeeeeees 135 V3 8 Generatne O tpPuUt ValUES nc c2siiccccasedesadbsatesesanccencncbsloestancdainadebinsbearscedoniiosts 139 Database relationships and how to preserve or discard them ccccccccsecssssseeeeeees 140 Database feature NACI ccecetc eset scene sccentes se ccctaeascetecsatsaceossewencsabcesbnnsseetessebanensieresteasben 142 7 5 1 Database info MS ACCESS cssssssseneesccccccceeesessssssssssseccceessaccccceeeeeseees 143 7 5 2 Database info MS SQL Servet cece cc ceccccessccceecceeecsceecseenessueessseeees 145 Lao Danba SO OPAC eena 147 Tom Watabase into MySQLossisrseisiiee cienciata eneeier eiieeii 149 Tes ALAN AS S110 OAS aonne a iaa 151 Altova MapForce User Manual 7 5 6 Database info IBM DB2 0 00 00
21. 2006 Altova GmbH MapForce and Webservices Generating C webservices with MapForce 359 Compiling the webservice The visual basic script virtdir vbs must be run before you open the solution file in VS NET 2003 2005 The script creates a virtual directory on the server that points to the location where the code was generated If the server is not on the local computer then the code has to be copied to IIS and the virtual directory has to be created there i 2 3 4 Navigate to the Mapping subdirectory and run the virtdir vbs script file This creates a virtual directory for IIS which points to the generated code Open the Mapping solution file Mapping Mapping_webservice sin Select the menu option Build Build Solution to compile the webservice project Select the menu option Debug Run to start the application If the webservice is on a remote computer then the compiled code has to be copied to the appropriate location on the server Using the webservice ee LE Using a WSDL client e g XMLSpy create and send a SOAP request Select SOAP Create a new SOAP request Enter the WSDL file location on the IIS server and hit OK Select the SOAP operation name that you want to use getPerson string Query in this case and hit OK to create the SOAP Request document The line containing lt Query xsi type xsd string gt String lt Query gt is the query placeholder or string you want to search for in the databas
22. Wanonull _ Administration 662 afficefinanonull com Ca Wanonull Administration 471 afficenanonull com Ca Wanonull _ Administration 963 afficeinanonull com Ca Wanonull Harketing 621 afficenanonull con CA Wanonull Marketing 753 afficefinanonull com CaA Altova MapForce User Manual 2006 Altova GmbH Chapter 9 Generating XQuery 1 0 code 192 Generating XQuery 1 0 code 9 Generating XQuery 1 0 code MapForce generates XQuery 1 0 program code which can be executed using Altova s XQuery engine in the AltovaXML package or opened directly in XMLSpy and executed using the menu option XSL XQuery XQuery Execution Please note that execution speed of generated XQuery 1 0 code is significantly faster that of generated XSLT 1 0 2 0 code Generated program code such as Java C or C is of course even quicker because it is compiled before execution To download the AltovaXML package which contains the Altova XQuery engine e Point your Browser to http www altova com download_components html then select and install the AltovaXQuery engine This example uses the Tut ExpReport mfd file supplied in the MapForceExamples Tutorial folder Make sure that you have selected the XQuery icon before you preview the results To preview an XQuery result Before generating program code it is a good idea to preview the result of the XQuery using the MapForce Engine Having opened the Tut ExpReport mfd f
23. cece ccc ccc cccecceccecceceececceceececees 7 6 Using MapForce to create database relationships ccccccecccseseees 7 7 Mapping large databases with MapForce ssssseeeeeeeeeeeeceeeeeeeenees 7 7 1 Complete database import cccccceceececceeeeeeeeeeeeeaeeeeeeees 7 7 2 Partial database import ce eesessseseeeeeececceeeeeeeeseeaeeseeeeeees 7 8 Database filters and queries ccccccccccccccceceeeeeaeeeeseesseeeeeeeeeeeeeeeaaaas 7 9 Database null processing functions ce ceeeeeccccecccceceeceeeceeeeeeeeeeees 8 MapForce CSV and Text files 8 1 Mapping CSV files to XML eee ee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeees 8 2 Mapping XML to CSV or fixed length text files eee eeeeeeees 8 3 Creating hierarchies from CSV and fixed length text files BA CSV Te OPN ipsccvocazastacetpacsoedapioncsoatnsteansideseetsndsvacsersesdattngtvaaseisieasiens 8 5 Mapping Fixed Length Text files to a database eeeeeeeeeeeees 8 5 1 Fixed Length Text file Options cc csseeessssseeeeeeceeeeeeeeeeeees 8 6 Mapping Database to CSV Text files 200 0 eeeeeeeeeeeeeeeeeeeeeeeeeees 9 Generating XQuery 1 0 code 10 User defined functions 10 1 Inline vs Standard user defined functions 0 0 0 cesssssseeeseseeeeeeeeeees 10 2 Standard user defined function ccccccccccccccececcceceeeeeeeeeeceeeeeeeeeeeees 10 3 Complex user defined function XML node as input
24. please deliver ASAPRE itemxx2 qtyOOO1 priceooio ocoo itemDDD qtyOO10 priceooio so0 custidoooz ordidoooi EURES itemaBC qtyO100 priceoooi 100 custidooos ordidooozg usps itemDEF qtyOOOS price 200 000 e Creates multiple fragments defined by separator characters that you enter in the Separator field e The separator characters are included in the fragment e A fragment is defined as the entire line containing the separator up to the next line containing the same separator e Ifthe separator does not appear in the first line then the first fragment contains the line s up to the first line containing the separator Using the separator HDR as shown above produces 3 separate fragments fragment 1 contains all characters from the start of the file fragment including all lines up to the next line containing the same separator custidOO01 ordidoooi EVRY itemaBC qtyO100 priceoooi 100 Please deliver asaPrhh itemxx2 qtyOO01 priceooio ooo itemDDD qryOO010 priceooio 5s00 Note that this option allows you access to any number of lines between two separators E g Header Detail Text files where the DTL or TXT lines may be optional or not in sequence fragment 2 contains all characters lines from the second occurrence of HDR till the next occurrence of HDR WHDR custidoooz ordidoooi EURA Z2 DTL itemABC qtyO100 priceodoo1 100 4 fragment 3 contains all characters lines from the third occurrence of HDR t
25. 4 AltovaFunctions AlkovaxML 2 Double click the MappingConsole cs file a Solution Mapping 8 projects Ef Altova E AltovaDB s Ef Alboyvarunctions E AltovaxML feed ComplebePo feed Customers4and4rticles Mapping H 3 References E 4ssemblyInfa cs appingConsale cs E MappingMairt cs H EA ShortPO A snippet of the code is shown below Console Out WriteLine Mapping Application TraceTargetConsoale tte new TraceTargetConsole MappingMainl MappingMainlObject new MappingMainl 1 gt MappingMainiObject ReqisterTraceTarget itto MappingMainiObhject Runi ohortP xml Prorider Microsoft Jet 0LEDE 4 0 Data SourcesCustomersindirticles mdb CompletePO sml Console Out WriteLine Finished catch Exception amp Please note that the path names in the generated source code have been deleted for the sake of clarity Looking at MappingMain1 Object Run All parameters passed to the run method except for the last one CompletePO xml are source files Please ensure that the last parameter is the target file Altova MapForce User Manual 2006 Altova GmbH Code Generator Integrating MapForce code in your application 437 In this example the source files are e XML file Short PO xml e Database file CustomerAndArticles mdb including the connection string the target file is e CompletePO xml To define your own source o
26. 427 Build Mapping exe FF Rebuild All Batch Build Clean Start Debug d Debugger Remote Connection Execute Mapping exe Ctr F5 Set Active Configuration Configurations Profile You can select from four different Build configurations Debug Debug Unicode Debug NonUnicode Release Release Unicode Release Non Unicode X StdAf z Cpp Hl Conpiling ExpFkeport cpp Creating library Replacing UnicodeDebug stda tz obj Configuration Market ingEspenses Wins Unicode Compiling StdaAfs cpp Compiling Market ingEspenses cpp Creating library Replacing UnicodeDebug stda tz obj Configuration Mapping Wins Unicode Debug Compiling resources Compiling StdaAfs cpp Compiling Mapping cpp HMappingMainl cpp Generating Code Linking Mapping exe U error s OU warning Build Debug Find in Files 1 Find in Files 2 Results SaL Debugging 5 Once the code has been built execute the Mapping exe program to map your data 2006 Altova GmbH Altova MapForce User Manual 428 Code Generator Generating program code ex Cr projects testapps MapforceTest tmp OriginalExamples Mapping Application OK Press any key to continue Altova MapForce User Manual 2006 Altova GmbH Code Generator Code generation tips 429 25 3 Code generation tips Out of memory exceptions and how to resolve them lt peri
27. E ShortPO a E ShortPO e CustomerMr gt 5 Lineltems E Lineltem ArticleNr E CompletePa le E i CompletePO E Customer a Number yA t D O FindArticle gt ee Y FirstName moun z ei POATNT N ame gt 9 LastName bo Articles Artic m Address E E Article E i Lineltems E Articles Number a aL gt A K Articles gt a ice G Article a ium i 2 gt SinglePric Amount Price The left half contains the input parameters to which items from two schema xml files are mapped e ShortPO supplies the data for the input component POArtNr e Articles supplies the data for the complex input component The Articles xml instance file was assigned to the Articles schema file when the component was inserted e The complex input component Articles with its XML child nodes to which data has been mapped from the Articles component The right half contains e asimple output parameter called Name which passes on the filtered line items which have the same Article number to the Name item of Complete PO lt Ysml Yversion 1 0 encoding UITF 3 CompletePO xmas xsi http Waa es org 2001 SAMLSchema instance sLinetems i sLineltem i eArticles iOi eNumber 3eMumber i i lt Name gt Pants lt Mame PoP s mount Ssi4mount i f4rticles i sjLineltem lt Linettem fo svirticles PPP eMumber 1 lt Mumber fof of eMame g
28. Header oo F2380 os Number F299 RE a om Received result HC PAI Fagri HE Customer OAL l ew gt Number IMD oll See oo ie gt ContactName gt ORDERS aoc ale O Order i i wf TJ J i L k a fi fiter Laer kog at a PE m FTX L on falsel a Y CompanyName gt GIR l EO Address 4 5G1 Street noe 3 a C082 e E Lineltems The final step in this task is to calculate the pricing and tax costs 1 From the core library drag two multiply and one divide function into the Mapping area 2 Insert a Constant function Insert Constant make sure Number is selected and enter 100 0 into the text field 3 Map the following items kog kog e eal E SG28 QTY C186 F6060 gt valuel of the first multiply function SG28 SG32 PRI C509 F5118 gt value2 of the first multiply function The result of the first multiply function gt Order LineItems LineItem Article Price SG28 SG38 TAX C243 F5278 gt valuel of the divide function The Constant 100 0 gt value2 of the divide function The result of the first multiply function gt valuel of the second multiply function The result of divide function gt value2 of the second multiply function The result of the second multiply function gt Order LineItems LineItem Article Tax The mapping in your mapping should look like this 2006 Altova GmbH Altova MapForce User Manual 310 MapForce and EDI UN EDIFACT
29. Neviastor XI fz outing SN den OES An outline is not available 0 errors 0 warnings O infos In Folder MapForce MapForce properties 1 Select the menu option Window Preferences and click the MapForce entry 2 Activate the available check box to switch to the MapForce perspective when opening a file Altova MapForce User Manual 2006 Altova GmbH MapForce plug in for Eclipse Starting Eclipse and using MapForce plugin 373 Preferences Eo Ioj x type filter text MapForce Co H General E Ant MapForce Perspective I Help Automatically switch to MapForce perspective at File open H Install Update E Preferences shared with MapForce installation E Open MapForce Options Dialog E Run Debug H Team Restore Defaults Arp ccl Clicking the Open MapForce Options Dialog button opens the Options dialog which allows you to define the specific MapForce settings i e Libraries Code generation settings etc Double clicking a MapForce mapping file mfd initially opens a message box stating that a MapForce perspective is associated with this type of file and prompts if you want Eclipse to automatically switch to the MapForce perspective in the future These settings can be changed later through the Window Preferences MapForce MapForce Perspective option C eclipsed 1 workspace MyProject CompletePO mid N x The MapForce Perspective is associated
30. Precision of numeric types e The xs integer datatype is arbitrary precision i e it can represent any number of digits e The xs decimal datatype has a limit of 20 digits after the decimal point e The xs float and xs double datatypes have limited precision of 15 digits XQuery Instructions Support The Pragma instruction is not supported If encountered it is ignored and the fallback expression is evaluated XQuery Functions Support For information about implementation specific behavior of XQuery 1 0 functions see the section XPath 2 0 and XQuery 1 0 Functions 2006 Altova GmbH Altova MapForce User Manual 590 Appendices Engine information 28 1 4 XPath 2 0 and XQuery 1 0 Functions XPath 2 0 and XQuery 1 0 functions are evaluated by e the Altova XPath 2 0 Engine which i is a component of the Altova XSLT 2 0 Engine and il is used in the XPath Evaluator of Altova s XMLSpy product to evaluate XPath expressions with respect to the XML document that is active in the XMLSpy interface e the Altova XQuery 1 0 Engine This section describes how XPath 2 0 and XQuery 1 0 functions are handled by the Altova XPath 2 0 Engine and Altova XQuery 1 0 Engine Only those functions are listed for which the behavior is implementation specific or where the behavior of an individual function is different in any of the three environments in which these functions are used that is in XSLT 2 0 in XQuery 1 0 and in the XPath Evalua
31. Property Project as Project read only Dispatch Id 2 Description The Project property gives access to the Project object of the MapForce automation server API This interface provides additional functionalities which can be used with the project loaded into the control The property will return a valid project interface only if the placeholder window has PlaceholderWindowID with a value of MapForceXProjectWindow 3 The property is read only Methods The following method is defined OpenProjyect Altova MapForce User Manual 2006 Altova GmbH MapForceControl Object Reference 577 OpenProject Method openProject strFileName as string as boolean Dispatch Id 3 Description OpenProject loads the file st rFileName as the new project into the control The method will fail if the placeholder window has a PlaceholderWindow1D different to MapForcexXProjectWindow 3 Events The MapForceControlPlaceholder ActiveX control provides following connection point events OnModifiedFlagqChanged OnModifiedFlagChanged Event OnModifiedFlagChanged i_bIsModified as boolean Dispatch Id 1 Description This event gets triggered only for placeholder controls with a PlaceholderWindowID of MapForceXProjectWindow 3 Th event is fired whenever the project content changes between modified and unmodified state The parameter _b sModifed is true if the project contents differs from the original content and false otherwise
32. This is the same as clicking the No button in the dialog box A message box is opened showing all errors that were encountered while trying to open the mapping file The aim is to give you more information on why the mapping could not be loaded Mapping project could not be loaded because Barnabas iSeries ODBC Database Connection Error Reason Data source name not Found and no default driver specified datetest Database Connection Error Reason Could not connect to the database ui MindanliDpbonly madkaPRCe SystenicodelMapforcesourceldatetest mdb is not a valid path Make sure that the path name is spelled correctly and that you are connected bo the server on which the File resides The message box shows that two separate database connection errors occurred e The first database Barnabas could not be opened because the data source name was missing and a default driver was not specified e The second database datetest could not be opened because of an invalid path 2006 Altova GmbH Altova MapForce User Manual 100 MapForce How To Filter components Tips 6 10 Filter components Tips The filter component is very important when querying database data as it allows you to work on large amounts of data efficiently When working with database tables containing thousands of rows filters reduce table access and efficiently structure the way data is extracted The way filters are used directly affects the
33. a3 logical functions equal result a equal b equal or qre result a gt b equal or les result a lt b greater result a gt b ew AJ Email 2 i less result a lt b E expense item EEL logical and result logical ar H type l m logical not result logical no i expto oo logicalor result logical or iDate O O bea i not egual result logical na E Meal on mealtype Ea math functions E Bll wenn rh E filter add result value i ceiling result ceilingl w Mapping ALT Output divide result value floor result floor vali modulus result valued m multipl result value ji a tepid evel yal Add Libraries writable The individual MapForce tabs are now visible in the Eclipse Environment e Libraries tab at left allows you to select predefined or user defined functions e Messages tab displays validation messages errors and warnings e Overview tab displays an iconized view of the mapping file The editor pane is where you design your mappings and preview their output and consists of the following tabs Mapping which displays the graphical mapping design XSLT which displays the generated XSLT code The name of this tab reflects the programming language you have selected under Output XSLT 1 0 Java C etc Output which displays the Mapping output in this case the XML data Altova MapForce User Manual 2006 Altova GmbH MapForce plug in for E
34. ab ral fedefault bi Optional parameters Double clicking the input 3 parameter of the EqualAnd user defined function shown above allows you to make parameters optional by unchecking the Connection required check box Datatype boolean l Connection required gt m Heresult me input 1 Cancel default Office_Mame as O EqualAn ziana If Connection required is unchecked then e A mapping connector is not required for the input icon of this user defined function e g the and parameter of the first EqualAnd function does not have an input connector The input icon has a dashed outline to show this visually e A default value can be supplied by connecting a component within the user defined function e g using a constant component containing the value true Altova MapForce User Manual 2006 Altova GmbH User defined functions User defined function example 219 H i A mapping from another item mapped to the optional Input takes precedence over the default value E g the and parameter of second EqualAnd function receives input data from the result parameter of the first EqualAnd user defined function 2006 Altova GmbH Altova MapForce User Manual 220 User defined functions User defined function example Person2Details component O Person2Details gt Details Double clicking this user defined component displays its constituent components shown below
35. e Define actions for some application events The code for this example is available at the following location in your MapForce installation MapForceExamples ActiveX HTML MapForceActiveX_ApplicationLevel htm Instantiate the Control The HTML object tag is used to create an instance of the MapForceControl The Classid is that of MapForceControl Width and height specify the window size No additional parameters are necessary since application level is the default lt OBJECT id objMapForceControl Classid clsi1dad A3863789 5759 4456 Al6 FOULLE0CC2Z2C1 width 800 height 500 VIEWASTEXT gt lt OBJECT gt Add Button to Open Default Document As a simple example of how to automate some tasks we add a button to the page lt input type button value Open Marketing Expenses onclick BtnOpenMEFile gt When clicked a predefined document will be opened in the MapForceControl We use a method to locate the file relative to the MapForceControl so the example can run on different installations lt SCRIPT ID Javahandlers LANGUAGE javascript gt open a pre defined document function BtnOpenMEF ile var pos objMapForceControl BaseHref indexOf ActiveX if pos gt 7 path objMapForceControl BaseHref substr 7 pos 7 remove file protocol objMapForceControl Open path MarketingExpenses mfd else alert Unable to locate MarketingExpenses mfd at objMapForceControl BaseHref
36. i CompanyName 2 E Address on C Street 4 State E Lineltems 4 Lineltem 7 Article Number 4 SinglePrice 4 Amount 4 Price Validation ify date trom datetine alye result ih time from datetime alue rezult C EB Ca 12545 Ca US O Calculate TaxRateFrom EDI SS a E 4 Envelope gt gt gt 4 Interchange E HISA Interchange Control e 22 FIOT Authorization Info e E FIO2 Authorization Info senna FIOS Security Informati i e E FIO4 Security Informati 2 seee FI05 1 Interchange IL 7 cesses FIDE Interchange Sen sesen FI05_2 Interchange IL sarees FIO Interchange Rec amp FIOS Interchange Dat sassen FIO9 Interchange Tim FI65 Repetition Separ l cesses FIT Interchange Con l seeen FIT Interchange Con 7 sean FITS Acknowledgmen sereen F4 Interchange Usa FITS Component Elem E 4 Group E GS Functional Group i pe E F479 Functional Ide EL F142 Application Se 3 F124 Application Re F273 Date 2 e F337 Time F28 Group Control M sorter F455 Responsible A F480 Version Pele Validation is only available in the Output tab and not when generating code Select the menu item Output Validate output XML file to validate the EDI Output file lf we regard the elements of an EDI document as nodes we can differentiate between those having children and those without
37. in XPath 2 0 590 in XQuery document 587 COM API documentation 460 Comma CSV files 169 Command line parameters 93 2006 Altova GmbH Index 617 Command line parameters and input values 95 XQuery engine 192 Comments in SPL 444 Compatibility mode v2005R3 440 Compile C code 424 C code 426 Compiler settings 440 compl complement node set 41 Complex function inline 199 User defined complex input 206 User defined complex output 211 User defined function 205 210 Component change database 397 changing settings 397 database 61 defining UI 226 EDI settings 312 exception 250 schema 12 Concatenate filters don t 100 Configuration files transforming 322 Configure mff file 224 Connect reselect database 99 Connection properties 22 settings 401 Connections type driven 80 Connector annotate 71 mapping with 21 naming 401 properties 22 Constructor XSLT2 240 Context priority 16 priority context 91 Conversion functions boolean 90 type checking 248 Converter for customized EDI files 322 Copyright information 601 Count 488 count function in XPath 1 0 582 count function in XPath 2 0 see fn count 590 Create function 37 new mapping project in Eclipse 377 user defined function 196 CSV creating hierarchies keys 174 custom field 177 field datatypes 177 file options 177 input fil
38. lt 41 stylesheet vwersion 2 0 xumlnsixs xelioutput method xul version 2006 Altova GmbH Altova MapForce User Manual Chapter 16 Type conversion checking 248 Type conversion checking 16 Type conversion checking From MapForce 2006 SP2 on the generated applications and preview with the builtin execution engine check for type conversion errors in more detail inline with XSLT2 and XQUERY Converting values from one type to another may now result in a runtime error where in prior versions of MapForce would have produced some type of result Example conversion of a xs string Hello to xs decimal MapForce 2006 Versions up to and including SP1 Hello or NaN when passed to a function dealing with number XSLT2 error invalid lexical value Xquery error invalid lexical value Ot BUILTIN engine C app 0 error values not convertable error values not convertable MapForce 2006 SP2 Hello or NaN when passed to a function dealing with number XSLT2 error invalid lexical value Xquery error invalid lexical value Preview with error string value Hello could not be converted to BUILTIN engine decimal C app _ _Jerror values not convertable C app error values not convertable Java app error values not convertable If type conversion errors occur check that the types have been handled correctly E g use the lang nume
39. lt Person i First Vernon First l lt Last Callaby lt Last lt Title Otfice Manager lt Title gt ePhoneExt 582 lt PhoneExt lt Person Person lt First Frank First om oh E Wha lt Last Further lt Last Titke gt 4ccounts Receivable Title gt PhoneExt 474 lt PhoneExt lt Person Person i First Loby First gt sLast Matize Last Title Accounting Manager Ttle ePhoneExt 963 lt PhoneExt lt Person For more complex examples of database to schema mapping using e multiple source files e flat and hierarchical databases Please see the DB_ Altova SQLXML mfd and DB_Altova_Hierarchical mfd files in the MapForceExamples folder of MapForce 2006 Altova GmbH Altova MapForce User Manual Chapter 4 Source driven mixed content mapping 68 Source driven mixed content mapping Source driven mixed content mapping MapForce now supports source driven mixed content mapping Source driven mixed content mapping enables you to automatically map text and child nodes in the same sequence that they appear in the XML source file Source driven mapping can of course also be applied to XML schema complexType items if you wish Child nodes will then be mapped according to their sequence in the XML source file Source driven mixed content mapping supports e XML schema complexTypes as source components e XML schema complexTypes of type mixed content
40. which maps the filtered items of the same Article number to CompletePO lt Yxml version 1 0 encoding UITF 3 H ComgleteP A xmlins xsi http vay ws ora 00 AML Schema instance xsi noNamnmespacg gt sLineteme gt sLinetem i Articles iOi ehumber 3 lt Number i i lt Mame Pants lt Mame gt PoP P lt SinglePrice 34 SinglePrice PP lt Price 102 lt Price gt Po shrticles eJLinettem i eLinelttem fo Articles Pf GP ehumber 1 Mumber fof i sMame gt T Shirt Name PoP i lt SinglePrice 25 SinglePrice PoP lt Price 25 lt Price gt Po shrticles Altova MapForce User Manual 2006 Altova GmbH User defined functions User defined function example 215 10 5 User defined function example The PersonByListBranchOffice mfd file available in the MapForceExamples folder describes the following features in greater detail Nested User defined functions e g LookupPerson Look up functions that generate a string output e g LookupPerson Optional input parameters which can also supply a default value e g the EqualAnd component contained in the LookupPerson component Configurable input parameters which can also double as a command line parameter s when executing the generated mapping code He input 13 C Nanonull Inc h detautt OfficeName 9 PersonList E BranchoOttices 3 H PersonList gt EEL Hees prae BO Fenon p pA result O LookupPerson Office Name result
41. 2006 Altova GmbH The MapForce API Object Reference 493 Serialization Property Serialization as String read only Description Serialize error marker into a string Use this string in calls to Application HighlightSerializedMarker or Document HighlightSerializedMarker to highlight the marked item in the mapping The string can be persisted and used in other instantiations of MapForce or its Control Errors 1900 The object is no longer valid 1901 Invalid address for the return parameter was specified Text Property Text as String read only Description Retrieves the message text Errors 1900 The object is no longer valid 1901 Invalid address for the return parameter was specified Parent Property Parent aS Application read only Description Retrieves the application s top level object Errors 1900 The object is no longer valid 1901 Invalid address for the return parameter was specified 2006 Altova GmbH Altova MapForce User Manual 494 The MapForce API Object Reference 26 2 7 Options This object gives access to all MapForce options available in the Tools Options dialog Properties and Methods Properties to navigate the object model Apolication Parent General options ShowLogoOnPrint ShowLogoOnStartup UseGradientBackground Options for code generation CompatibilityMode DefaultOutputEncoding XSLIDefaultOutputDirectory CodeDefaultOutputDirectory CopSettings DOMType Co
42. 27 3 8 Output Menu Commands from the Output menu o MenuText CommandName ID 2434 D_SELECT_LANGUAGE_JAVA ID_SELECT_LANGUAGE_CSHARP ID_SELECT_LANGUAGE_CPP Run SQL script ID_ TRANSFORM_RUN_ SQL 32442 2006 Altova GmbH Altova MapForce User Manual 556 MapForceControl Command Table 27 3 9 View Menu Commands from the View menu Menu Text Show Annotations 3 Show Types 3 Show Library In Function Header 3 Show Tips 3 Show selected component D_VIEW_AUTOHIGHLIGHT COMPONENTCONNECTION 32443 S Show connectors from source to ID VIEW RECURSIVEAUTOHIGHLIGHT Zoom ID_VIEW_ZOOM 2451 Status Bar D_VIEW_STATUS_BAR 449 Library Window ID_VIEW_LIBRARY_WINDOW 2445 1 NO 1 D_VIEW_VALIDATION_OUTPUT ID_VIEW_OVERVIEW_WINDOW Project Window ID_VIEW_PROJECT_WINDOW g 2446 2302 connectors Validation Output 89 Altova MapForce User Manual 2006 Altova GmbH MapForceControl Command Table 557 27 3 10 Tools Menu Commands from the Tools menu Mentet CommandName ID ID_VIEW_CUSTOMIZE 32444 ID_TOOLS_OPTIONS 32441 2006 Altova GmbH Altova MapForce User Manual 558 MapForceControl Command Table 27 3 11 Window Menu Commands from the Window menu Menu Text Close Close All ID WINDOW_CLOSEALL 3 Cascade D WINDOW_CASCADE D_WINDOW_TILE_VERT Tile Horizontal ID_WINDOW_TILE_HORZ Tile Vertical Close Close All Altova MapForce Use
43. 4 1 A 4 1100 jeg i Ylbe255 LOX IMAO G a a991 300A MOX 1120 1213 O08 JOA Inserting the FlexText template into MapForce allows you to map the data to any of the supported target files In this example each of the CSV items are mapped to two separate XML files E TutheaderDetaill Preview gt a A Root gt a E Order E Split once E Header i L E HESY 3 T 7 RecordT ype gt I vst Field 7 a 7 OrderNo l vo Field 1 Y Total eight l l on Field 2 gt 4 TotalUnitCost l 7 r Field 3 gt gt ite Currency oo Field 4 l i i Shipping details i i 2m Field 5 r E Detail owe Field 6 en RecordType gt E Split once l l E OCSE E Tut headerDetail Preview Field gt a E Y Order gt oo Field 1 E Header l L oak Field 2 eae 7 RecordType l Field 3 OrderNo i L oo Field 4 gt Total eight l z l TotalUnitCost i IP Currency Note that not all of the items in the CSV sections are mapped to the target files 2006 Altova GmbH Altova MapForce User Manual 292 FlexText FlexText Reference The first XML file contains all 111 record types lt xml version 1 0 encading LITF a gt lt Order xmins xsi hith ww v3 org 2001 AML Schema instance sHeader RecordType 111 RecordType sOrderMos332s 0rderMo lt TotalVeigh
44. Customizing an ANSI X12 transaction 341 20 6 4 Local customization Changes only have to be made to the 850 config file at the specified location to be able to access the new X1000 field locally All segments in the current transaction that use Segment N2 will contain reference the new element Local customization segment redefinition in 850 Config file Open the 850 Config file and navigate to Config Include 1 3 4 5 6 7 3 9 Tal vwersion 1 0 encoding UTF s t lt Config Version 2 gt I I I Met a gt Belease gt SO1l4 lt Release gt Agqgency ALZ Aqencyv gt r Heta Include hrefs lz Segment HMessaqe gt HessaqgeType gt sS50s MessaqelTywpe gt Insert the following lines before the Include href element lt Elements gt lt Segment name N2 info Additional Name Information gt lt Data ref F93 mergedEntries 2 gt lt Data name X1000 type string maxLength 35 minOccurs 0 info New Element gt lt Segment gt lt Elements gt Wo Oo M n wd M e PRPRPRPREE EB Am kWh Fr Oo tubl version 1 0 encoding UTF s t gt FE Config Version Z gt r Iz Met a gt Relesse gt Soles Releases Agqency AlLZt Agency Het a Element gt lt eguent name Mz info Additional Name Information Data ref F93 mergedEntriess z Data name 1000 type string waxLength 35 mintec
45. EDIFACT 332 X12 343 Input as command line param 95 comparing boolean nodes 90 default value 215 file CSV 177 file Text 186 optional parameters 215 XML instance 397 Input icon mapping 21 Input parameters and code generation 95 Insert 393 database 64 database action 116 InsertXMLFile 479 InsertXMLSchema 479 InsertXMLSchemaWithSample 479 Install plug in for Eclipse 370 Instance input XML instance 397 output XML instance 397 Integrate into C 436 into C 438 into Java 434 Integrate MapForce code 433 Integrating MapForce in applications 524 Internet usage in Altova products 600 Introduction code generator 413 to FlexText 258 Introduction to MapForce 3 ISO 8601 date time format 312 Item 488 duplicating 56 Rows 172 schema mapping 34 Iterating through text files 172 Iteration priority context 91 J Java Ant scripts 27 code 412 code generation 483 generate code 417 generate multiple target 50 integrate generated code 434 JBuilder 418 JBuilder project file 27 JDBC setup 107 mapping database data 64 multiple targets 47 options 485 494 settings 440 Sun ONE studio 420 JavaScript error handling 469 JBuilder 107 Java generate code 418 project file 27 JScript code generation sample 463 2006 Altova GmbH Index 623 K Key database 134 fields in text files 174 L Label connecto
46. Error description nerrorCode Error number amp Oxffff return false return true C C C C gives you easy access to the HRESULT of the COM call and to the IErrorInterface HRESULT hr Call GenerateXSLT from the MapForce API Tf FAILED hr ipDocument gt GenerateXSLT IErroriInfo ipErroriInfo Null If SUCCEEDED GetErrorInfo 0 amp ipErroriInto BSTRbstrDescr ipErroriInfo gt GetDescription amp bstrDescr i handle Error information wprintf L Error message t s n bstrDescr PEOVSE TeSStT ring bstrbescr release Error info ipErroriInfo gt Release Altova MapForce User Manual 2006 Altova GmbH The MapForce API Object Reference 471 26 2 Object Reference Object Hierarchy Apolication Options Prog ProjectItem Documents Document MapForceView Enumerations Description This section contains the reference of the MapForce API 1 0 Type Library 2006 Altova GmbH Altova MapForce User Manual 472 The MapForce API Object Reference 26 2 1 Application Properties and Methods Properties to navigate the object model Apolication Parent Options Proj Documents Application status Visible Name Quit WindowHandle MapForce designs NewDocument UpenDocument UpenURL ActiveDocument MapForce projects NewProject Enterprise or Professional edition is required OpenProject Enterprise or Prof
47. First value E result Last z Title i Phone oon Email E expense item ba E type A E expto Select the menu option Function Create User Defined Function from Selection Enter the name of the new user defined function First_Last Note valid characters are alohanumeric a z A Z 0 9 as well as underscore hyphen dash and colon 4 Use the Syntax and Detail fields to add extra information on the new function and click OK to confirm The library name user is supplied as a default you can of course define your own library name in this field wo N Altova MapForce User Manual 2006 Altova GmbH User defined functions 197 Create User defined Function l x Settings Function name First_Last Library name user Description Syntax resutl concat string space char sting Detail 9 Cormbines two strings and inserts a space character between them Implementation Inline recommended Allows comples parameters filters and multiple outputs C Standard function Allows recursive calls The individual elements that make up the function group appear in a tab with the function name The new library user appears in the Libraries pane with the function name First_Last below it Libraries q EE core logical functions math functions Bo output string functions result edifact EE lang j datetime functor generator functic logi
48. New Design in the Design pane To add mappings to a project 1 Select Project Add active file to project This adds the currently active file to the project The mapping name now appears below the project name in the project tab e Selecting the option Project Add files to project allows you to add files that are not currently opened in MapForce To remove a mapping from a project 1 Right click the mapping icon below the project folder 2006 Altova GmbH Altova MapForce User Manual 20 MapForce overview Projects 2 Select Remove mapping from the pop up menu To create a WSDL project A webservice project differs from a standard project in that a WSDL file is needed for its creation and the result of the code generation process is a complete webservice All that remains is to compile the generated code and deploy the webservice to your specific webserver Each operation defined in the WSDL file is presented as an individual mapping 1 Select File New and double click the Webservice Project from icon 2 Fill in the New Project dialog box fields marked with an asterisk are mandatory Please see the section MapForce and webservices for more information Altova MapForce User Manual 2006 Altova GmbH MapForce overview Mapping between components 21 2 5 Mapping between components A connector visualizes the mapping between the two sets of data and allows the source data value to appear or be
49. Separator 1200 Split base head Ee MapForceFlexText Fy MapForceFlexText3 Sample Text 1 111 332 1 22537 7 5 Container ship Mega p 2111 41579227 10 3 400 Microtome BE 3 111 5152427 7 6 1200 Miscellaneous BE 4222 978 4 7563 1 69 4ir freight Mini BP 5j222 ZZ4U561 10 5 10000 Gas Chromatograph hh e Creates two fragments defined by separator characters that you enter in the Separator field e The separator characters are included in the fragment e The first fragment is defined as all the text up to the line containing the separator The second fragment is defined as the text and line including the separator up to the end of the file fragment e Ifthe separator appears in the first last line of the file fragment then the top container remains empty Use this method to split a file or fragment into two where the separator is anywhere in one of the lines The line containing the separator is not split but is retained whole This is generally useful in files containing record delimiters CR LF and you want to split the fragment into two separate fragments 2006 Altova GmbH Altova MapForce User Manual 282 FlexText FlexText Reference The top fragment contains the text up to the line containing the separator 1 111 332 1 22537 7 5 Container ship Mega 2111 481579227 10 3 400 Microtome BE The bottom fragment contains the entire line containing the separator 1200 and
50. Splits the fragment into multiple vertical columns Enter a value into the Offset field or drag the tab on the horizontal ruler Each fragment contains the characters of the column defined by the Offset width e g 10 to the end of the file fragment Mode Hed length Onentation vertical Offset 10 Fy MapForceFlexTexti Sample Text See eee ieee ae sees ee 111 332 1 22537 7 5 Container ship Mega b 111 81579227 10 3 400 Microtome 5 111 B152427 7 6 1200 Miscellaneous h 222 979 4 17563 1 69 hir freight Nini 222 ZZAW5S61 10 5 10000 Gas Chromatograph ho MODE Delimited floating Default settings are Separator none 3 Block s Mode delimited floating 1 Separator 222 Viszseneral outgassing pollutants 8 1100 897 22 1 716235 LOx8 e Creates multiple fragments defined by separator characters that you enter in the Separator field e The separator characters are not included in the fragment 2006 Altova GmbH Altova MapForce User Manual 276 FlexText FlexText Reference e A block fragment is defined as the text between the first character after the separator up to the last character before the next instance of the same separator Except for first and last fragments please see below Using the separator 222 as shown above produces 3 separate fragments fragment 1 contains all characters from the start of the fragment to the start of the first separator 222 i e
51. Store as FLF Fixed length Store as Value Each of the options you select define the function and content of the container and present further options for you to refine the content to be provided to the target component in MapForce 0 Block s File name Mode fed length Tab sze OQ Orientation horizontal Offset Having selected an option e The container changes appearance type and icon e g Repeated split appear in the title bar e Default options are visible e g mode fixed length Orientation horizontal and Offset 1 e Anew container is automatically appended to the current one e Pressing the Shift key allows you to collapse containers as a group Two chevrons appear when Shift is pressed Clicking the handle collapses that section of the container tree Tis The Node Text in Design view icon E icon displays the active container contents in the Sample Text pane E The Auto collapse unselected node text L icon displays the content in the active container all other containers which contain content are collapsed 2006 Altova GmbH Altova MapForce User Manual 262 FlexText FlexText Tutorial 19 2 FlexText Tutorial The tutorial will show you how to use the most common and most powerful features of FlexText to process a text file and map its output in various ways in MapForce The example uses the Flex tutorial txt file available in the MapforceExamples Tu
52. Webservice Project From WSDL file icon and hit OK to continue New File es De Li Mapping Project File W we Cancel Creates a Maptorce webservice project from aW SOL file 3 Fill in the Insert Webservice dialog box Insert Webservice x Webservice Definition Webservice definition file C Program Files V4 ltova M apForce2006 M apF orce Name of the SDL Service to implement http www altowa comAw 52DE guern weds 2 Choose Mame of the WSDL Port to implement ws 2DBSoapPart Choose i Automatically generate mapping files for all operations Output Generation Code generation language lava OF Cancel 4 Select the WSDL file in the Webservice Definition group query wsdl Query wsdl is available in the MapForceExamples Tutorial directory Selecting the WSDL file automatically fills in the remaining fields 5 Click OK 2006 Altova GmbH Altova MapForce User Manual 350 MapForce and Webservices Creating webservice projects from WSDL files 6 Enter the name of the WSDL project in the Save Project As dialog box Click Save to confirm the settings and create the WSDL project file Project Quern Person database a gh Webservice Folder Ge query wedl ce http wai altova come S 2DE quer wedl S206 Eege WS2DBSoapPort eres http way albova com S 2DE quer wediigetPersan Po E getPerzon mfd Bire http vain albova com S 2DE query wedliputPer
53. What this component does is e Concatenate three inputs and pass on the result string to the output parameter e Double clicking an output parameter allows you to change the parameter name Details and select the datatype String fry concat value H output Details HE input 3 Altova MapForce User Manual 2006 Altova GmbH Chapter 11 Adding custom libraries 222 Adding custom libraries 11 Adding custom libraries MapForce allows you to create and add your own user defined function libraries for Java C and C Libraries can be added by clicking the Add libraries button under the Libraries pane or by selecting the menu option Tools Options Add of the Libraries tab The libraries are shown as files with an mff extension Please note Mappings data using these types of user defined functions cannot be previewed by clicking the Output tab i e using the MapForce Engine as they cannot be compiled by the MapForce engine These functions are of course available when generating code To be able to add user defined functions you need e the mff file which tells MapForce what the interfaces to the functions are and e where the implementation can be found for the generated code A basic mff file for C would for example look like this lt xml version 1 0 encoding UTF 8 gt lt mapping xmlns xsi http www w3 org 2001 XMLSchema instance XS1 noNamespaceSchemaLocation mff
54. and the line that triggered the exception is automatically highlighted 2006 Altova GmbH Altova MapForce User Manual Chapter 18 MapForce engine 254 MapForce engine 18 MapForce engine The MapForce engine allows you to immediately preview and save the result of a transformation without having to go the path of generating program code compiling it and viewing the results This is achieved by simply clicking the Output tab The Output tab also supports the find command enabling you to find any XML data or SQL statement that you might need to find MapForce can also be started from the command line and produce a result without having to generate any intermediate code We would still however recommend that code be generated in one of the respective programming languages after the development phase due to the better execution speed of generated code Depending on the target component of your mapping the Output tab may show different things XML Schema document as target The result of the mapping is immediately presented in the Output tab Any data source components can be used XML Schema files Text and CSV files databases or EDI documents the result you would have achieved if the Java C or C code had been executed appear in the Output tab The screen shot below shows the output of the DB_CompletePO mfd mapping available in MapForceExamples folder An XML Schema document as well as a database ar
55. data types are of the same type e g all input nodes are numerical types or strings then there is no difference between the SP1 and SP2 versions Differing input node types only version SP2 If the input nodes are of differing types e g integer and string or string and date then version SP2 introduces a new rule The data type used for the comparison is always the most general i e least restrictive input data type of the two input types Before comparing two values all input values are converted to a common datatype Using the previous example the datatype string is less restrictive than integer Comparing integer value 4 with the string 12 converts integer value 4 to the string 4 which is then compared with the string 12 The type handling for comparing mixed types follows the XSLT2 guidelines and prevents any content sensitive type conversion strategies The advantage is that the logic is fixed by the mapping and does not change dynamically Additional checks Version SP2 additionally checks mappings for incompatible combinations and raises validation errors and warnings if necessary Examples are the comparison of dates with booleans or datetimes with numerical values In order to support explicit data type conversion Version SP2 introduces three new type conversion functions to the core library boolean number and string In the previously mentioned context these three functions are suitable to
56. e All segments in all messages that use composite C056 will contain reference the new element Composite redefinition in EDSD Segment file Open the EDSD Segment file in XMLSpy or in you preferred editor and navigate to Config Elements Composite C056 lt Composite name CO56 info DEPARTHENT OR EMPLOYEE DETAILS Data ref FS413 mindecurs 0 gt E Data ref F3412 mindeccurs 0 r gt Composite gt Insert the following line in the C056 segment under F3412 lt Data name X 1000 type string maxLength 35 minOccurs 0 info New Element gt The composite definition appears as shown below Composite name CO56 info DEPARTHENT OR EMPLOYEE DETAILS gt Data ref F3413 mintecurs 0 gt Data ref FR412 minOecurs 0 gt Data name ALOOO type string wmaxLength 35 mindecurs 0 info New Element gt Composite gt Please note The new X1000 field is defined using the name attribute as opposed to other fields of the segment which use the ref attribute The two other fields are defined at the beginning of the EDSD Segment file outside of the Composite section using the Data name element and are only referenced here The new field can now be referenced from different Segments or Composites Previewing the new field in MapForce 1 Select the menu option Insert EDI or click the Insert EDI mh Icon 2 Click the EDIFACT Nanonull tab and select the ORDERS m
57. flf mft Sample Text 1Vernon Callaby 58ev callabydnanonull com f e Ooffice Ma Configuring the FLF container data Having defined a container as Store FLF the Sample Text pane appears as shown in the screenshot above A default field of width 10 is automatically inserted e Click the tab icon on the ruler and drag to reposition it A popup appears showing you the current position e Positioning the cursor over the ruler displays a dot clicking places a new tab at the click position 1 T callabyfnanonull e Having defined the new position click the field to select it and edit the name in the Altova MapForce User Manual 2006 Altova GmbH FlexText FlexText Reference 295 Name field Sample Text MOS Mame Last Type sting Size 10 P Email Vernon tCallaby eoeey7 callabydnanonull To remove a field click the tab icon and drag it off the ruler The tab icon changes when this action can be successfully completed Pree begpe fer eed erg gee e deren eee pens PL Email lVernon itCallaby e 56e5 callabyfnanonull Please note Dragging a tab on the ruler automatically repositions all tabs to the right of it To retain the other tab positions hold down SHIFT before moving the tab Clicking a field in the Sample Text pane highlights it allowing you to further configure it Click the append icon my to append a new field of length 10 Click the insert icon to insert a field
58. from 111 to Miscellaneous Sample Text Ia Bp 1 111 332 1 22537 7 5 Container ship Mega 2j111 21579227 10 3 400 Microtome BE 3 111 B152427 7 6 1200 Miscellaneous BF If the separator is not the first set of characters of the first line in the fragment as in this example then the first fragment includes all the text up to the first instance of the separator Eg 222 lf 111 were the separator then the first fragment would only consist of the first line of this fragment minus the separator itself fragment 2 contains the first line containing the separator 222 without the separator Sample Text aea OOO 11978 4 7563 1 69 4ir freight Mini fragment 3 contains the next line containing the separator 222 without the separator itself up to the end of the text file fragment Sample Text 38 DP 1 ZZ20561 10 5 10000 Gas Chromatograph hb Si seneral autqassing pollutants 4 1100 897 22 1 716235 LOx amp S Use this option when you want to process fragments e Containing separators which you want to strip out e Where the fragment might not have CR LF characters and thus have in line separators ous 444 970 4 T563 1 69 Air freiqgqnt Wini a442 44AWoeol MODE Delimited line based Default settings are Separator none Altova MapForce User Manual 2006 Altova GmbH FlexText FlexText Reference 277 i custidOO01 ordidoooi EVRY itemaBC qtyO100 priceoooi 100
59. i Constructors Fl Methods gt main B Bean Patterns C amp tappingConsole D MappingF rare a E Mappinghlaini D TraceTargetConsole Cy maptorce MapForce log MarketingExpenses ant loc build Mapping il Joy J Filesystem MappingFrame StatButton_ lt import java awt fee Mappingdpplication Jara This file was generated by MAPFORCE 2004 OVERWRITTEN WHEN FOU RA ERUN CODE GENERATION Refer to the MAPFORCE Documentation for further http wow altora con mapforce Eg FOU SHOULD NOT MODIFY THIS FILE BECAUSE IT WIL Eg package col mapforce import javax suing DIManager Class Mapping pplication boolean packFrame false public MappingfApplication MappingFrame frame new MappingFr if packFrame frame pack else frame validate i e Open either the MappingApplication or MappingConsole folder depending on which you want to edit and compile e Click the main method in the Methods folder to view the generated code e Select the menu option Build Build to build the selected application either e MappingApplication or e MappingConsole 2006 Altova GmbH Altova MapForce User Manual 422 Code Generator Generating program code BSJ Sun ONE Studio 4 update 1 Community Edition Project Deft File Edit View Project Debug Wersioning Tools Vind B a BS e Compile FO 3 Be com mpile All UmechaltFo UmeschaltF 14
60. i_bIsModified as boolean Dispatch Id 3 Description This event gets triggered whenever the document changes between modified and unmodified state The parameter _b sModifed is true if the document contents differs from the original content and false otherwise 2006 Altova GmbH Altova MapForce User Manual 576 MapForceControl Object Reference 27 9 9 MapForceControlPlaceHolder Properties available for all kinds of placeholder windows PlaceholderWindowID Properties for project placeholder window Project Methods for project placeholder window OpenProject The MapForceControlPlaceHolder control is used to show the additional MapForce windows like Overview Library or Project window It is used like any other ActiveX control and can be placed anywhere in the client application CLSID FPDECSB04 0SF 2 42 7d 936C FO3Ac5DES3CZ2 ProgID Altova MapForceControlPlaceHolder Properties The following properties are defined PlaceholderWindowlD Access to MapForceAPI Project PlaceholderWindowlID Property PlaceholderWindowID aS MapForceControlPlaceholderWindow Dispatch Id 1 Description Using this property the object knows which MapForce window should be displayed in the client area of the control The PlaceholderWindowlID can be set at any time to any valid value of the MapForceControlPlaceholderWindow enumeration The control changes its state immediately and shows the new MapForce window Project
61. mff file configuring 224 Mixed content mapping 68 create mixed content 71 source driven mapping 68 standard mapping 77 text nodes 71 Mode compatible to v2005R3 440 Mono makefile 424 MS Access database info 143 support 2000 and 2003 106 MS Access 2000 support 61 MS SQL Server database info 145 support 61 MS Visual Studio NET MapForce plug in 362 MSSQL 2000 drivers 107 Multiple source schemas 397 sources and code generation 430 target schemas 47 targets and code generation 430 targets and Java 47 viewing multiple target schemas 50 Multiple consecutive elements Edifact X12 337 multiple input items 56 Multiple source to single target item 52 Multiple tables 2006 Altova GmbH Index 625 Multiple tables to one XML 85 MySQL database info 149 N Name 474 486 504 connector 71 401 Named template namespaces 234 Named template summing nodes 244 Namespace named template 234 Namespace URI DTD 103 namespaces in XQuery document 587 in XSLT 2 0 stylesheet 584 Nested user defined functions 215 NewDocument 474 489 NewProject 475 Nillable not supported 429 Node 287 comparing boolean 90 removing text nodes 71 summing multiple 244 testing 102 Node set complement 41 Non printable delimiters 312 Null functions 164 substitute 164 O Object reference 471 Object model overview 462 Object tree
62. overrides and command line parameters for more information E Create Input 4 x Mame Office ame Datatype string M Connection required Preview Code generation I Use alternative value Value Nanonul Partners Inc Altova MapForce User Manual 2006 Altova GmbH User defined functions User defined function example 217 LookupPerson component LookupPerson 5 Office _Name eH result First Name 2 Last Name Double clicking this user defined component displays its constituent components shown below What this component does is e Compares the Office First and Last names of BranchOffices xml with the same fields of the Altova_Hierarchical xml file using the input components and the EqualAnd user defined components e Combines the Email PhoneExt and Title items using the Person2Details user defined function e Passes on the combined person data to the output component if the previous EqualAnd comparisons are all true i e supplied true to the filter component A user defined function always outputs a value which may even be an empty string This would be the case if the filter component bool value is false Only an empty string would be output instead of data supplied by the Person2Details component Altova_Hierarchical a E 1 Altova PrimaryKey i Office PrimaryKey ForeignKey ORTEN fo ME and Hel a Tb adetauk Ottice_Mame cwresult
63. please see Multiple target schemas documents for more information IF Else Condition A condition is a component which allows you to pass on different sets of data depending on the outcome of a preset condition The component header displays the text if else Please see Condition in the Reference section for an example The first input parameter is a bool which contains the data you are checking against e The value true input parameter supplies the data to be passed on as a result if the condition is true e The value false supplies the data to be passed on if the condition is false e The result parameter outputs the data supplied by the value true false input parameters 2006 Altova GmbH Altova MapForce User Manual 12 MapForce overview MapForce components 2 2 MapForce components When creating a mapping single or multiple data sources can be mapped to multiple target components e Data sources can be XML Schemas documents CSV or text files databases as well as EDI messages e Target components can be XML Schemas documents The mapping process allows the source data to be selectively transformed or manipulated using functions before it is output or made available in the Output preview window A data source can have a database CSV or text file and or an UN EDIFACT message as its source Once a data source has been imported converted it is used in exactly the same way as any of the other schema c
64. respectively 2006 Altova GmbH Altova MapForce User Manual 126 MapForce and Databases Mapping XML data to databases Microsoft Access Altova Table File Edit View Insert Format Records Tools Window Help A foel H SY wy hale E PrimaryKey a ae a a 1 http iewe xml Atto iiaa alto http fan wc httg i E r es se 1 The company wa officemnanonul 1992 04 01 ORE T S e E 1 Admin PrimaryKey EMail First Last 1 AAldrichi micratech co Albert Aldrich 2 b banderaimicrotech cor Bert Bander 3 c clovisigamicrotech com Clive Clovis aU c Cicadatmicrotech cor Camilla Cicada 31 c corrigani microatech ce Carol Corrigan 2 sales and Marketing E 3 Engineering PrimaryKey EMail First Last b b flandisGnanonull com Fred Landis Yo omlandisinanonull com Michelle Butler A O tlittleainanonullcaom Ted Little a 4 awayicinanonull com Ann Way a 10 gardnerainanonull cam Liz Gardner gt 11 p smithiginanonull cam Paul omith 3 4 Level 1 support PrimaryKey EMail First Last 12 a marting nanonull cam Alex Martin 13 g hammerainanonull cor George Hammer 14 nnewburyGmicroatech cr Mira Newbury 15 c orgonegmicrotech co Olanda Urigone 2 On March 1st 2 nextoficemnan 2001 03 01 Primarykey Name BE 5 Admin b Sales and Marketing e Level 2 support Update if combinations with delete child data This section describes the effect of the Update if condition on a par
65. wsdl Put xeiitype m0 Person gt First xSLitype ned string Stringt First gt Last xeLlitype xed string gt Stringt Last Title xsLitype ned string gt Stringt Title gt PhoneEXT xsiitype xed string String PhooneEAT gt Email xsLitype ned string gt Stringt Email gt Put gt la put Person SOAP ENYV Body SDAP ENV Envelope gt 5 Replace the placeholder text String with actual person data lt S04F ENV Envelope xmlns S504P ENV http schemas xmlsoap_ oarg soap e S0AP ENV Body u put Person umlnsi m http spam altova con WSD DE query wsdl Put nelitype m0 Person gt SFLrst xSLlitype nuesd string gt Fred First gt Last xeLitype xed string gt Flagellator lt Last Title xsilitype usd string gt S5ircs Title gt Phone EAT xwelitype xed string 7774 PhoneEXT Email xsiitype usd string gt ff home comt Email gt Put gt lt li gt put Person gt S0OAP ENV Body S08P ENV Envelope gt 6 Select SOAP Send request to server to send the request to the server The Send SOAP Request command sends the edited SOAP request document to the server The new person data is then added to the database and a SOAP Response document is sent back as a confirmation The mapping defines the contents of this confirmation message i e Thank you for adding XYZ to our spam database Tuml wersion 1 0 encoding UTF s 7 gt tso0apenyv Envelope nuu
66. zoom in on the text CTRL and zoom out of the text CTRL and 0 resets the zoom factor to standard CTRL and mouse wheel forward backward achieve the same zoom in out effect 2006 Altova GmbH Altova MapForce User Manual Chapter 19 FlexText 258 FlexText 19 FlexText The FlexText module of MapForce 2006 allows advanced processing and mapping of legacy text files A FlexText template which defines file structure and content is defined in the FlexText module and is then inserted as a component into a mapping where you can further decide which items sections you want to map to other target files Target files may be any of the many types that MapForce supports text XML database files Altova MapForce User Manual 2006 Altova GmbH FlexText Overview 259 19 1 Overview FlexText provides a graphical interface which allows you to map extremely complex flat files containing multiple delimiters nested in line structures and other complexities in MapForce ready for your code generation needs FlexText produces a template which is then loaded into MapForce where the individual items can be mapped to any type of target component The template works on a text file that is supplied opened in MapForce This allows you to reuse the same template for multiple text files and in multiple mappings FlexText lets you define the structure of the flat file interactively and get instant feedback in the Sample Text
67. 0 function 586 format date XSLT 2 0 function 586 format dateTime XSLT 2 0 function 586 format time XSLT 2 0 function 586 function available XSLT 2 0 function 586 id in XPath 2 0 support in Altova Engines 591 idref in XPath 2 0 support in Altova Engines 591 index of in XPath 2 0 support in Altova Engines 591 in scope prefixes in XPath 2 0 support in Altova Engines 591 last in XPath 2 0 and whitespace 590 lower case in XPath 2 0 support in Altova Engines 591 normalize unicode in XPath 2 0 support in Altova Engines 591 position in XPath 2 0 and whitespace 590 resolve uri in XPath 2 0 support in Altova Engines 591 Static base uri in XPath 2 0 support in Altova Engines 591 2006 Altova GmbH Index 621 fn system property XSLT 2 0 function 586 fn unparsed text XSLT 2 0 function 586 fn upper case in XPath 2 0 support in Altova Engines 591 FullName 482 502 Function 403 adding 16 adding custom XQuery 242 adding custom XSLT 234 adding custom XSLT 2 0 240 Changing type of user defined 196 complex inline 199 conversion boolean 90 custom 16 datetime 312 exporting user defined 196 extendable 16 generator 139 implementation 228 inline 199 input as parameter 95 library 16 nested user defined 215 null 164 Query 16 restrictions in user defined 196 standard user define
68. 2002 2003 424 2 2005R3 compatibility mode 440 8 8601 ISO date time 312 A Access MS Access support 106 Active 478 ActiveDocument 473 489 Add custom library 222 user def functions 196 Aggregate function 244 Alternative input data 95 Altova Engines in Altova products 597 Altova XML Parser about 596 Altova XSLT 1 0 Engine limitations and implementation specific behavior 582 Altova XSLT 2 0 Engine general information about 584 information about 584 AltovaXQuery engine 192 Annotation connector 401 Annotation settings connector 71 ANSI X12 as target 312 auto completion rules 318 legal values 321 target validation rules 318 ANT 107 script 27 417 API accessing 561 documentation 460 overview 461 Application 472 473 for Documents 488 Application name 440 Application object 462 473 Application level integration of MapForce 525 Assume delimiters present 186 atomization of nodes in XPath 2 0 and XQuery 1 0 evaluation 590 ATTLIST DTD namespace URIs 103 Autoconnect child items 22 Auto mapping child elements 22 auto number 139 B Background gradient 440 with gradient 497 Background Information 594 backwards compatibility of XSLT 2 0 Engine 584 2006 Altova GmbH 616 Index Base package 440 Base package name for Java 485 Bool boolean values in XSLT 88 output if false 215 Boolean
69. Ave 1 Vancouver 5588339 Clive Clovis 363 c clovi Microtech Sales and Marketing Major Ave 1 Vancouver 556898339 Dave Durne Microtech Sales and Marketing MNajor Ave 1 Vancouver S5558339 Eve Ellas Microtech Manufacturing Major Ave 1 Vancouver S5868339 Fred Fortunas 394 Microtech Manufacturing Major Ave 1 Vancouver SS86339 Gerry Gundall 64 2006 Altova GmbH Altova MapForce User Manual 174 MapForce CSV and Text files Creating hierarchies from CSV and fixed length text files 8 3 Creating hierarchies from CSV and fixed length text files This example is available in the MapForceExamples Tutorial folder as Tut headerDetail mfd The example uses a CSV file with fields that define the specific record types and has the following format e Field 1 H defines a header record and D a detail record e Field 2 Acommon key for both header and detail records e Each header detail record is on a separate line Creating hierarchical XML structures from flat files using Key fields The contents of the Orders csv file are shown below H 111 332 1 22537 7 Container ship D111 A 159 79 227 18 3 468 Microtone Do1411 6 152 427 7 6 1268 Miscellaneous H 222 978 4 7563 1 Air freight D242 22 AWS6 1 18 5 188868 Gas Chromatograph Aim of the mapping is to e Map the flat file CSV to an hierarchical XML file and e Filter out the Header records designated with an H and e Associate the res
70. Boolean values and XSLT 1 0 89 Forcing boolean values There might be instances where you want to predefine or force the result of a condition mf ExpReport al ExpReport T arget see Ea 4 expense report gt a 4 Company 2 detailed f ae 3 i currency A ES 4 Title i K Hame value talze Y Person z hei prs en 7 ae Last 1 Connect the constant component directly to the bool parameter of an if else filter component 2 Select the Number radio button in the Insert constant dialog box and 3 Enter 1 for True and 0 for false depending on the condition you want satisfied 2006 Altova GmbH Altova MapForce User Manual 90 MapForce How To Boolean comparison of input nodes 6 4 Boolean comparison of input nodes Data type handling in boolean functions difference between MapForce 2006 SP1 and SP2 During the evaluation of the core functions less than greater than equal not equal less equal and greater equal the evaluation result of two input nodes depends on the input values as well as the data types used for the comparison Example The less than comparison of the integer values 4 and 12 yields the boolean value true since 4 is less than 12 If the two input strings contain 4 and 12 the lexical analysis results in the output value false since 4 is alphabetically greater than the first character 1 of the second operand 12 lf all input
71. Description Path of the document file without name Errors 1200 The application object is no longer valid 1201 Invalid address for the return parameter was specified Save Method save Description Save the document to the file defined by Document FullName Errors 1200 The application object is no longer valid 1201 Invalid address for the return parameter was specified SaveAs Method saveAs i_strFileName as String Description Save document to specified file name and set Document Ful1Name to this value if save operation was successful Errors 1200 The application object is no longer valid 1201 Invalid address for the return parameter was specified Saved Property Saved as Boolean read only Description True if the document was not modified since the last save operation false otherwise Errors 1200 The application object is no longer valid 1201 Invalid address for the return parameter was specified 2006 Altova GmbH Altova MapForce User Manual 488 The MapForce API Object Reference 26 2 4 Documents Properties and Methods Properties to navigate the object model Apolication Parent Open and create mappings CUpenDocument NewDocument lterating through the collection Count Item ActiveDocument Application Property Application as Agplication read only Description Retrieves the application s top level object Errors 1600 The object is no longer valid 16
72. E 493 LT 0 6 0 ERA eee EE E ere E E 494 AD O O ren E E E iat E E EE 494 CodeDefaultOutputDirectOry eeeeeeeeeeeeereeeereeeerererrrrsrrrrererrerersererserersree 494 Compani DINIIV MOC sosissrcasssesrecesessstuosetssanpeetiiaiesssveretindsostansstsaaspsetindessseerenesioss 495 Cops CSS DOMT YDE aiee ena pacaiat eae eet eit 495 CppSettings Generate VCOProjectFile siirsin sine 495 CppSettings Generate VSProject FP ile cccccccccccsccccccccceesssssssssssssseesessssseeeeeees 495 COD SUAS POV AT L P Eer E E E EAN actsoresecece steeds 496 CppSetiings UseMT C oraski intinne irn EE E a 496 B e INS E a N E A E ne 496 DefaultOutputEncoding eeeeeeeeeeeeeeeeeeeeeeerereererserersrrersrrrrsrrrrerersererserersrees 496 POO oea E E oaveedeebandiecssuteiseciscesons 497 a Ee aa TEE E IENE E E E ass 497 SONL LOTOO N OTU orca E E E E N E E 497 Uer TLU EO EEA EE soe tein EAE E AAEE 497 ASL DefaultOu pilD ir eCiOr Vesisemesss accretions 498 Altova MapForce User Manual 26 2 9 IN GV UI sa sees aa scat pee EE stots E E EAEE AES 499 Ti otek OEA AO E OEE A E E E AT ENEE 500 PEE OTE CCUG lased secossa aa aaa M AATE E EE NEE A EAE AA ET 500 A a A E acs ooeseissaeieoeeees 501 APPO OM rece res E E E E E E E R 501 COSE a E ns oan E EA 501 CO E E 501 Cea O Oe as ce E tna E E E T E 502 Ta EET CCT UOTE ECE PTET EN TERETE EC Ot OT EET OE ee Cet EE TT ONT IT Ue eTy ED 502 CHI COC cereus esac acs eae eae ences occas ee nes 502 Cenerale OO OP Ceecee esse ts
73. E E E E senneseeees 401 DAF TOCNO n A A AE A ORE 403 DA OU A AEN E AANO N E 406 DO VE E I N EE E EEE 407 AITO E E E E EE E E EEE RE 408 QAM NACI a A E AE E E E E E T 409 24 12 Oracle client installation ateccncctccurtctetccaneeeceesctantcenscataceeecneeccancaneeerecesecenmtataceeeeneecean cance 410 25 Code Generator 412 23 4 Jntrod ction to cod generator cence sencancvarevenccsensenceucevesonsensanctutevansonenseneemeevasceaemancuateres 413 23 2 Gencratme program Code sisipin S ES A a AE EES 415 252 G neraine Jaya COGC yassaadeinctararesacenicoosrquaeseaga td eraen aei eia arii 417 Generating Java code using JBuilder scccssnvenersuinevdsiecaossaveatostounsncencentenesedeseonss 418 Generating Java code using Sun ONE Studi eeeseessesseessesesesesesesssesesssesees 420 DS Ie EW E E a E eer eT amr ets eee rrr te enter Tmt 424 29 2 3 Generating CHF COJE nccrne e e Er 426 ZI Cod aon rOn S 429 25 4 Code generation mapping example cccccccccccccccceceeeeeesesseseeeecceceeeeeeeseeeaaaaeseessees 430 25 5 Integrating MapForce code in your application cssseeeesesseeeeececeeeeeeeeeeaaseeeeeeeees 433 25 5 1 MapForce code in Java applications 0 ccccccccscsssssssssseeeeeeeeceeeeeeeeeeaaas 434 25 5 2 MapForce code in C applications cccccccccccccccccceesssssseseeeeeeceeeeeseeeeenaaas 436 25 5 3 MapForce code in C applications ccccccccccccsssssssessssssseeeeeeeseeeeeeeeaaas 438 29 0 Co
74. EDIFACT messages to an XML Schema document to produce an XML file for further processing The mapping discussed in this example is available in the MapForceExamples directory as EDI_Order mfd Creating the EDIFACT component in MapForce 1 Create a new project and ensure that one of the programming language icons is active i e Java C or C It is not possible to generate XSLT 1 0 2 0 or XQuery code when mapping from EDI files 2 Select the menu option Insert EDI or click the EDI icon and select ORDERS from the list of EDI collections then click OK Browse EDI collections on x EDIFACT x12 MOYINS Stowage instruction message MSCONS Metered services consumption report message ORCCHG Purchase order change request message Purchase order message Purchase order response message Order status enquiry message Order status report message Party information message Passenger list message Payroll deductions advice message gt IF you didn t find EOI collection you were looking for click this button to view what other collections are curently available trom Altova Download additional EDI collections 3 Select ORDERS EDI from the MapForceExamples directory and click on Open open ees Look ir amp MapForceE samples do fe e Es ESFORDERS EDI 2 File name ORDERS EDI Files of type JEDIFACT files edi Cancel 4 The EDI component now appears in the Mapping a
75. EE E EEEE icaneueatameatnaneseeate 576 IAGO Secs asco erte sg ec soos 576 OpenProject dh EE EE ride cdae AE E TT TAE ES E ENEE ESES 577 L ES e E esictvsaobea see eee scuee aso meee hea 577 OnModifiedFlagChanged PEE E E batsoeatemarreusnaadeatienena staaue ET 5 7 FAO EE O a E ES 578 OU GUD GI sacl lo 1 Leve sirere ee a Tai 578 MapForceControlPlaceholder window scccccccccseeseeeccccsceecsnneseecccseeeeeenes 578 28 Appendices 580 Dood Engine miormatiOn ssesssiisenieiesursysiisess ideias sN Eoi E Ia E 581 28 1 1 XSLT 1 0 Engine Implementation Information eeeeeeeeeeesesssseseeseeeseee 582 28 1 2 XSLT 2 0 Engine Implementation Information ccccccecceeeeeeeeeees 584 General 1a MONOT Aier n E N 584 Altova MapForce User Manual XSLT 2 0 Elements and FUNCTIONS 1ccsccececcscceccsccccsccuccscccuscsccscscuccecescescecs 586 28 1 3 XQuery 1 0 Engine Implementation Information ccccccceeeeeeeeeees 587 28 1 4 XPath 2 0 and XQuery 1 0 Functions 0 0 0 ccccsssseesseeeeeeeeeceeeeeeeeeeeaaas 590 Genera WOMAN aera nanan 590 FUNCHIONS SUDPOM sirana ee nee 591 ZOD NM CCWAICAL DAU siccetetecceigee ts A E AA E AAN 594 28 2 1 OS and Memory Requirement cccccccccccccccccceceeeeeeeeeeeeeeeeeeeeeeeeeeseeeeeeeess 595 Does AOVIAMLE AUS eeascecte caste arceancanisrancgaaccansasaerastansenanseaderacseesedestaunthacteaneaes 596 28 2 3 Altova XSLT and XQuery Engines ccc
76. Escape character First raw contains field names no Split once be Mode delimited line based Separator 1100 Split base head The Split once container shown above is used to create two containers The delimited line based function with the separator 222 is used to achieve this All records up to the first occurrence of 222 are passed to the CSV container The first consisting of all records containing 111 is then defined as a CSV container The Sample Text pane shows the contents of the currently active container Split once Sample Text 1 111 332 1 22537 7 5 Container ship Mega hh 2111 81579227 10 3 400 Nicrotome 3 111 B152427 7 6 1200 Miscellaneous 4j222 979 4 7563 1 69 hir freight Mini gt 5 j222 Z2Z4W0561 10 5 10000 Gas Chromatograph p YiJseneral outgassing pollutants 8 1100 897 22 1 716235 LOx84 9 1110 9832 22991 30 002 N0x 5 10 1120 1213 33 01 008 30z The default CSV settings have not been changed Clicking the CSV container shows its 2006 Altova GmbH Altova MapForce User Manual 290 FlexText FlexText Reference contents in tabular form Split once 1 T Mode delimited lne based Record separator Separator 222 Field separator Split base head Quote character Escape character First row contains field names no 4 Eg Head det mft Sample Text Name Field Type string Size 0 Fieu Field 1 Fid 2 Fie 9 Fia F O Ei Ljiil daoa T o
77. F3412 Department or employee name i 1000 New Element 2006 Altova GmbH Altova MapForce User Manual 334 MapForce and EDI Customizing an EDIFACT message 20 5 5 Customized Orders mapping example The mapping visible in the images below Orders Custom EDI mfd is available in the MapForceExamples Tutorial directory The example maps the ORDERS Custom EDI file to the Order EDI schema The field that has been added to the EDI structure X1000 has been mapped to the Salutation item To see the customization result 1 Create a new folder under the MapforceEDI directory and name it e g EDIFACT Nanonull 2 Unzip the supplied EDIFACT Nanonull zip file from the Tutorial folder into the new folder The ZIP file contains the follow files Admin Segment EDI Collection EDSD Segment Orders config UNCL Codelist 3 Open the Orders Custom EDI mfd file and click the Output tab to see the result of the mapping m ORDERS E Order EDI i HC FID FINANCIAL INSTITUTION INFOR y gt a E Order S63 a El Header TOSGA po Nuber OSES bof gt Received Pi E Customer ho re re re ene bc HE CTA CONTACT INFORMATION H FF3139 CONTACT FUNCTION cok E e Number ig C056 DEPARTMENT OR EMPLC e ContactName H E F 3413 Department or employee e i Y Salutation F3412 Department or employee 4 Company ame hee K1000 New Element gt Et Address P44 COM COMMUNICATION CONTACT
78. For information about implementation specific behavior of XPath 2 0 functions see the section XPath 2 0 and XQuery 1 0 Functions General Information The Altova XSLT 2 0 Engine conforms to the World Wide Web Consortium s W3C s XSLT 2 0 Candidate Recommendation of 8 June 2006 Note the following general information about the engine Backwards Compatibility The Altova XSLT 2 0 Engine is not backwards compatible Depending on the Altova product you are using the following options are available e f you wish to run an XSLT 1 0 transformation using AltovaXML then you should use the Altova XSLT 1 0 Engine of this package e lf you are running an XSLT transformation or carrying out an action involving an XSLT transformation within the XMLSpy StyleVision Authentic or MapForce products the correct built in Altova XSLT Engine 1 0 or 2 0 is automatically selected by the application This selection is based on the value of the version attribute of the stylesheet Or transform element of the stylesheet Namespaces Your XSLT 2 0 stylesheet should declare the following namespaces in order for you to be able to use the type constructors and functions available in XSLT 2 0 The prefixes given below are conventionally used you could use alternative prefixes if you wish XML Schema types http www w3 org 2001 XMLSchema XPath 2 0 functions http www w3 org 2005 xpath functions Typically these namespaces will be declared on the xsl styleshe
79. If the transaction check box has not been activated in the table options or in the component settings and an error occurs e Execution stops at the point the error occurs All previously successful SQL statements are executed and the on trues are stored in the database Transaction option set at database component level e Execution stops at the point the error occurs All previously successful SQL statements are rolled back No changes are made in the database All previously successful SQL statements for that for the database and all its tables can be rolled back Transaction option set at Table Actions level e The Transaction exception dialog box appears with the Rollback all and stop option disabled The failed SQL statement for that specific table can be rolled back Transaction option set at both database component and table action level e The Transaction exception dialog box appears with the Rollback all and stop option enabled All previously successful SQL statements for that for the database and all its tables can be rolled back Hitting the Cancel button rolls back the current SQL statement and stops Please note The transaction prompts are only displayed when the transformation is performed interactively 2006 Altova GmbH Altova MapForce User Manual 138 MapForce and Databases Mapping XML data to databases Generated code performs a rollback and stop when the first error is encountered Altova
80. In general JDBC drivers can be found at http industry java sun com products jdbc drivers MapForce generated Java applications were tested with the following JDBC drivers MS Access MSSQL2000 Oracle 9i MySQL Sybase IBM DB2 This section assumes the following e the reader is familiar with setting Java CLASSPATHs e Java SDK and Ant or JBuilder is already installed and is working correctly e atleast one of the databases described below is running and the minimum privilege read only is granted MS Access The JDBC ODBC bridge is already installed with Java SDK Java internal usage Driver sun jdoc odbc JdbcOdbcDriver URL jdbc odbc DRIVER Microsoft Access Driver mdb DBQ Sourcename Microsoft SQL Server 2000 Download from http Awww microsoft com sql Ant Settings Please make sure that the following jar file entries are in the CLASSPATH C Program Files Microsoft SQL Server 2000 Driver for JDBC lib msbase jar C Program Files Microsoft SQL Server 2000 Driver for JDBC lib mssqlserver jar C Program Files Microsoft SQL Server 2000 Driver for JDBC lib msutil jar assuming that C Program Files Microsoft SQL Server 2000 Driver for JDBC was your installation folder JBuilder Settings Use the menu option Tools Configure JDKs then click Add to add all the jar files listed above 2006 Altova GmbH Altova MapForce User Manual 108 MapForce and Databases JDBC driver setup Java internal usage Driver com m
81. Java Description of parameters Filename path and YourUAPFORCEfile MFD If the path or file name contains a space please use quotes around the path file name i e c Program Files Filename BUILTIN generates all outputs using the built in transformation engine XSLT generates all XSLT files IXSLT2 generates XSLT files XQuery generates XQuery code Java generates the Java application ICS generates the C application using the configuration of the mapping settings CS generates the C application using special configuration given in option field of the command line parameters VS2005 generates Microsoft VisualStudio Net 2005 solution files VS2003 generates Microsoft VisualStudio Net 2003 solution files VS2002 generates Microsoft VisualStudio Net 2002 solution files BORLAND generates Borland C Builder 1 0 project group files MONO generates makefile for MONO environment CPP generates the C application using the configuration of the mapping seitings CPP generates the C application using special configuration given in options field of the command line parameters VC8 generates Microsoft VisualStudio 2005 solution files VC71 generates Microsoft VisualStudio Net 2003 solution file MSXML generates code using MSXML 4 0 XERCES generates code using XERCES LIB generates code for static libraries DLL generates code for dynamic linked libraries MFC generates code supporting MFC NoMFC generates code without MFC su
82. LEa Traver 1 iJ Lt Lt it Lt Lt Lt Lt Lt Lt Lt Lt iT 6 Connect the result icon of the equal component to the bool parameter of the filter component 7 Connect the expense item icon of the source schema with the node row parameter of the filter component expense item n lype i CESA expto g i Meal Sassena mealtype l mapi 7 Location ac A Lodging a Travel ow SS means 7 sie Trav cost ow Destination i Mileage E Parking E Entertainment wt it iw LAR LER ci J LSF LER it wf LER LER TJ F ee fi Rroderayw on truel bool _forrfalsel thy lt n ik al J nu J Lt Lr i r Jo M ip ai al a resulti eg J Lt J J L ee foe Travel Le i J J TJ J J Lt Lt iw J LSR ot L 8 Connect the on true icon of the filter component with the expense item element of the target document Altova MapForce User Manual 2006 Altova GmbH MapForce tutorial Filtering data 43 expense item fh E expense item type srn Currency expto i seven Gill to Date ls h Date Meal 4 Travel mealtype on Travel Coz 4 Name i Destinatio 4 Location i h Car Renta Lodging 4 Au Travel Travel on Mise Trave means 44 Accommoda E Domestic le a ho bal kcal hoa fy filter Pnode row on trued or f
83. Libraries result 4 eql result a gt result a lt result a gt b result as b result logic result logic result logic result logic result value result cellin result value result floor result value result value result roun result value result exists result not e result subsl result conc result cont res ilk norm on The floating Overview Toolwindow is also created Altova MapForce User Manual 2006 Altova GmbH MapForceControl Integration at Document Level 541 G Overview Use File Open to open the file Market ingExpenses mfd which is in the MapForce examples folder The file is loaded and displayed in an own document child window n MapForceControl File Edit Insert Component Connection Function Output core h a3 logical functions wiew Tools Help Window MapForceDoc equal equal or qreater equal or less greater less logical and logical riot logical or hot equal L3 math functions add ceiling divide floor modulus multiply round subtract ei node test functions exists not exists substitute missing result 4 eq result a result at rezult a b result a g b result logic result logic result logic result logic result value result ceilin result value result floor result value result value result rouric result value result exist result not
84. MFGBt PARTNER ID 22 ROUTING ADDR 3 70101 1230 00000000000001 0RDERS 4 1 UNH tO001 0RDERS 5 934 0N BON 2Z21 ABC1IZ34 56R 7249 DTMN 4 200404301742 PDT 303 FIM tPUR tS Rigza purchase order BFF tCT 123 456 EFF CE 1lz WADtSE SS9 92 24hH PizzatLong WaytSan FranciscotCatsd424 05 CTAtSER Ted Little Hr WaADt BY 1l23 92 Nanonull Inc ll3 Oakstreet Suite 46876 VerenotCateo9Zz13t us CTAtPD Michelle Butler Mrs WaADtST 1l23 92 Nanonull Inc 1ll3 Oskstreet Suite 46976 VerencotCateszl1stus TAAtSt 4 4 4 4 4 1 1l2345 6789 0 CUA EZ USD 9 PCOD 12 2 TET 2Z0 4 24h Fizza Fast Carrier LOC 1lL tNanonull Main Entrance The CTA Contact Information segment of the ORDERS message must be extended for the new data to be able to be mapped Please note Customization information for EDIFACT and ANSI X12 is supplied by two structurally equivalent files that allow the use of multiple consecutive elements of the same name in each of the EDI formats EDIFACT uses the EDSD segment file while ANSI X12 uses the X12 Segment file Please see Multiple consecutive elements for more information The format of the configuration files used to customize EDI messages has undergone a major change in MapForce2006 R3 please see Converting customized EDI configuration files or more information 2006 Altova GmbH Altova MapForce User Manual 326 MapForce and EDI Customizing an EDIFACT message
85. MOX 1120 1213 O08 JOA Clicking a field in the Sample Text pane highlights it allowing you to configure it further e Click in the Name field to edit the default text that is presented e Click in the Type field to define the field datatype string boolean decimal etc e Click the append icon my to append a new field e Click the insert icon od to insert a field before the currently active field e Click the delete icon TH to delete the currently active field Please note The field boundaries can be dragged by the mouse to display the data 2006 Altova GmbH Altova MapForce User Manual 294 FlexText FlexText Reference 19 6 7 Store as FLF delimited Store FLF allows you to store text fragments as fixed length text and map individual columns to MapForce Any number of FLF containers components can be created in FlexText and each of the FLF containers may have different fill characters The Sample Text pane provides an overview of the current FLF fragment and also allows you to specify field names lengths and widths Each column appears as a mappable item in the text component in MapForce Container default settings are Fill character none First row contains field names no T fined length 1 Type string lon vertical e 107 Be ieee Split once Mode Hed length rentation vertical Split line 213 el Split base head store Type sting lt 4 Ee Head detz mft Eg cs
86. Mame aDepartment D 7 On amp OW ha fOTtice sOTTiCe lt Name Nanonull Partners Inc Mame gt Department l M Mame Administrations Mame s NamesMarketings Mame Name lT amp amp Technical Support Mame Department sfOTtice gt lt A itova 2006 Altova GmbH Altova MapForce User Manual 158 MapForce and Databases Mapping large databases with MapForce Tf Mapping large databases with MapForce When using large databases in mappings MapForce creates all database relations between the imported tables of the whole database This is due to the fact that the application cannot automatically decide which tables will be used in the mapping process all possibilities have to be covered These type of large databases increase the size of the database component exponentially which can lead to performance or memory issues The solution to this dilemma is to create multiple database components of the same database which only use import those tables that are needed for the mapping process This method also makes for a more intuitive mapping E g In a production company various components are assembled to produce customer defined units Before delivery the units undergo a unit test and all results are stored in a database At some point during the prototype testing phase it is discovered that a batch of components are faulty and a recall has to be initiated The goal of the mapping
87. Manual 2006 Altova GmbH Chapter 5 Copy all connections 80 Copy all connections 5 Copy all connections This type of connection allow you to organize your workspace and automatically connect all identical items in source and target components meaning that depending on the source and target type all source child items are copied to the target component if either the source and target types are identical or if the target type is xs anyType if the source and target types are not identical and if the target type is not xs anyType the source data is transferred mapped to the respective target items of the same name and the same hierarchy level If the names of the target items differ then the target item is not created Note that only the names of the child items but not their individual types are compared matched Currently Copy all connections are supported between XML schema complex types and between complex components XML schema database EDI and complex user defined functions components containing the same corresponding complex parameters please see Complex output components defining for an example The example below shows these connectors using the MarketingAndDailyexpenses mfd file in the MapForceExamples folder 1 Right click the Person component and select Copy all from the context menu A prompt appears reminding you that the target connectors will be deleted F Person
88. Please see the Altova XQuery Engine documentation for more information on the command line parameters 2006 Altova GmbH Altova MapForce User Manual Chapter 10 User defined functions 196 User defined functions 10 User defined functions MapForce allows you to create user defined functions within user defined libraries which can contain any number of input and outputs where any of these can be in the form of simple values XML nodes databases EDI files or FlexText structure files There are two types of user defined functions those defined as Inline and the others as Standard please see Inline vs Standard user defined functions for more information Also note that user defined functions can be changed from the one type to the other The main use of user defined functions is to combine data sources as well as input and output components into a single user defined function component which can be used across different mappings User defined functions can be e built from scratch or e use functions currently available in the mapping tab This example uses the Tut ExpReport mfd file available in the MapForceExamples folder To create a user defined function 1 Drag to mark both the concat and the constant functions you can also hold down the CTRL key and click the functions individually mf ExpReport El Y expense report exp detailed amet Currency Fi concat E Person ow
89. PrimaryKey entry and select the equal entry click OK to confirm i a Database Table Actions Person All input data are compared to the DE table data using the ope IF all comparisons are true then the specific action i executed Action on input data Update if fa Primark ey egual fa ForeignkKey EMail iFirst m Last Fl ll ll 4 Use Transactions The source and target primary keys are compared using the equal operator If the two keys are identical then all the mapped fields of the Person tables are updated 8 Click the Output tab at the bottom of the mapping window to see the pseudo SQL code that this mapping produces 9 Click the Run SQL Script icon in the function bar to run the script and update the database records If the script was successful a confirmation message appears Click OK to confirm 10 Open the Altova database and double click the Person table to see the effect All the person records of the database have been updated Altova MapForce User Manual 2006 Altova GmbH MapForce and Databases Mapping XML datato databases 123 E Person Table a a a ee 1 A Aldrich mici Albert 1 b bandencemicr Bert 1 c clovistemicra Clive 2 d Durnellia imicr Dave 2 e allasi microt Eve 3 ffortunasigmic Fred 3 g gundallicemicr Gerry 3 h hardyigdmicra Harry 3 Lldilkot microte Ingrid 3 judyiaimicrote June 3k krove emicrot Karl OW CO Om amp to bi A
90. Republic of Austria excluding its conflict of laws principles and the U N Convention on Contracts for the International Sale of Goods and you expressly agree that exclusive jurisdiction for any claim or dispute with Altova or relating in any way to your use of the Software resides in the Handelsgericht Wien Commercial Court Vienna and you further agree and expressly consent to the exercise of personal jurisdiction in the Handelsgericht Wien Commercial Court Vienna in connection with any such dispute or claim This Software License Agreement will not be governed by the conflict of law rules of any jurisdiction or the United Nations Convention on Contracts for the International Sale of Goods the application of which is expressly excluded Altova MapForce User Manual 2006 Altova GmbH Appendices License Information 613 This Software License Agreement contains the entire agreement and understanding of the parties with respect to the subject matter hereof and supersedes all prior written and oral understandings of the parties with respect to the subject matter hereof Any notice or other communication given under this Software License Agreement shall be in writing and shall have been properly given by either of us to the other if sent by certified or registered mail return receipt requested or by overnight courier to the address shown on Altova s Web site for Altova and the address shown in Altova s records for you or such other addre
91. The Service Port and Operation fields are automatically filled once a WSDL file has been selected 2006 Altova GmbH Altova MapForce User Manual 392 MapForce Reference Edit 24 2 Edit Most of the commands in this menu become active when you view the result of a mapping in the Output tab or preview XSLT code in the XSLT tab kj Undo MapForce has an unlimited number of Undo steps that you can use to retrace you mapping steps Redo i The redo command allows you to redo previously undone commands You can step backward and forward through the undo history using both these commands Find i Allows you to search for specific text in either the XSLT XSLT2 XQuery or Output tab Find Next 3 Searches for the next occurrence of the same search string Cut Copy Paste Delete The standard windows Edit commands allow you to cut copy etc any components or functions visible in the mapping window Select all Selects all the text code in the XSLT XSLT2 XQuery or Output tab Altova MapForce User Manual 2006 Altova GmbH MapForce Reference Insert 393 24 3 Insert XML Schema File Inserts an XML schema file into the mapping tab You are then prompted if you want to include an XML instance file which supplies the data for the XSLT XSLT2 XQuery and Output previews as well as the for the XML target schema document Database Inserts a schema component with a database as the data source The dat
92. User Manual 2006 Altova GmbH MapForce CSV and Text files Mapping Database to CSV Text files 189 8 6 Mapping Database to CSV Text files This example maps a simple MS Access database altova mdb to a CSV file The altova mdb file is available in the MapForceExamples Tutorial folder E altova a H Department Office FIG Person gyPrimaryKey Text file p o Rows aa Office name a Department Phone extension i sense Email Address a State i a a T bo baai bo al i re LSR LSF LER kry iw it I Lt i al baal bal krai m Primary key m ForeignKey al a ed bo ol koai inal l i l l l b io ad LA L ba 2006 Altova GmbH Altova MapForce User Manual 190 MapForce CSV and Text files Mapping Database to CSV Text files The Offices txt file entry entered in the Output file field is the name that is automatically supplied when you click the Save generated output icon from the Output tab hd Text import export a a x Difices tt Output file Cancel Input file encoding ie A Unicode UTF 8 Little ndian byte order Big endian byte order Input Output File CSW Settings Field delimiter Test enclosed in C Tab Semicolon Comma Space Custom Ic Hot fo fe First row contains field names State string Email Address string Phone extension string
93. User Manual 2006 Altova GmbH MapForceControl Object Reference 569 Description QueryStatus returns the enabled disabled and checked unchecked status of the command specified by ncmdID The status is returned as a bit mask Bit Value Name Meaning 0 1 Supported Set if the command is supported 1 2 Enabled Set if the command is enabled can be executed 2 4 Checked Set if the command is checked This means that if QueryStatus returns 0 the command ID is not recognized as a valid MapForce command If QueryStatus returns a value of 1 or 5 the command is disabled Events The MapForceControl ActiveX control provides the following connection point events OnUpdateCmdUL OnDocumentOpened OnProjectOpened OnCloseFditinqwindow OnDocumentOpened Event OnDocument Opened objDocument as Document Dispatch Id 3 Description This event gets triggered whenever a document gets opened The argument objDocument Is a Document object from the MapForce automation interface and can be used to query more details on the document or perform additional operations When integrating on document level it is often better to use the event MapForceControlDocument OnDocument Opened instead OnCloseEditingWindow Event OnCloseEdit ingWindow i_strFilePath as String as boolean Dispatch Id 1002 Description This event gets triggered when MapForce needs to close an already open document As an answer to this event clients should close the ed
94. aeons sera gi ees 502 CeneradieC ode lieri eneen a otnmaa etoe a E E 503 CenetrateCodel nE N aeaea aTe E ET 503 Toser e DST O a E 503 Do E E E E 503 JAVA_BOSCE ACKAQEN CINE sosessitensantescasenesnnsnededntss savieesoanesaesgasuuessandeandes eevaasoutes 504 NOME R sadist oc saicaea incense satense antes aewie oneness ete 504 Ou T OY OG ee nT On ee ee 504 Output TO scat sss sects E yogurts e EE sss 504 OUTDUL TCX EN COG iss ccesenceestee tencissaxapsneestanctienceesdenstenciseesassneetancusegvaesenss 505 Ta eea rs eeea soe scs E eae ssa dees 505 PGT Sasocacteece see poste E E A ne 505 OYE aC Cee ne ee eee ne Teer ee eee er ey errr 505 O E E E teas saseenenst es eeteteena ee 506 ProjectItem Enterprise or Professional Edition c cc eeesssseeeseeeeeeeeees 507 N a cic E E E E tae ob tes E OAO 507 AOA CHVE FP O AEEA NEN EEE T N eos EEE NE 508 Add Oaa AR A A EEEN EAE EE EEEE 508 App CON esprai E E E E oosabdarneshs 508 CodeGenSettings__LaAnguage sseeeseesrseeerserersereeserreserrrsrerrsrerrsrersererserersereeseees 508 CodeGenSettings_OutputFoldeT eessseeeeeeeeesseeeeeeerresseseerrerrrrssseereerrrrssseeees 509 CodeGenSettings_UseDefault ee eeesseseeeeseesssseeeeserrrrssseeererrrrsssserrerersssseeees 509 COU eE A AEE EE EE EE 509 Ca O aa E A NE EE EA oe 509 CredieMappino ol TO E en eee E E A 510 CeT E COG a A asia eecaaas onsen eee aan ee 510 Cenerale COU EP Coreinae aeesaveuaaeeests 510 CGEMCTOTEC OO acieonetinceesechucuene sin
95. against you by a third party that is based upon a claim that the content contained in the Software infringes a copyright or violates an intellectual or proprietary right protected by United States or European Union law Claim but only to the extent the Claim arises directly out of the use of the Software and subject to the limitations set forth in Section 5 of this Agreement except as otherwise expressly provided You must notify Altova in writing of any Claim within ten 10 business days after you first receive notice of the Claim and you shall provide to Altova at no cost with such assistance and cooperation as Altova may reasonably request from time to time in connection with the defense of the Claim Altova shall have sole control over any Claim including without limitation the selection of counsel and the right to settle on your behalf on any terms Altova deems desirable in the sole exercise of its discretion You may at your sole cost retain separate counsel and participate in the defense or settlement negotiations Altova shall pay actual damages costs and attorney fees awarded against you or payable by you pursuant to a settlement agreement in connection with a Claim 2006 Altova GmbH Altova MapForce User Manual 610 Appendices License Information to the extent such direct damages and costs are not reimbursed to you by insurance or a third party to an aggregate maximum equal to the purchase price of the Software If the S
96. agreement etc MapForce Plugin 1 0 0 1 Click the Show Properties link displays the specific plug in information Copyright General information etc Altova MapForce User Manual 2006 Altova GmbH MapForce plug in for Eclipse Installing MapForce plugin 371 To check the currently installed version 1 Select the menu option Help About Eclipse SDK about Eclipse SDK Pe x Eclipse SDE Version 3 1 2 Build id M20060118 1600 cl Copyright Eclipse contributors and others 2000 2005 All rights reserved visit http ie eclipse org platform This product includes software developed by the Apache Software Foundation Akko Www apache org Feature Details Plug in Details Configuration Details 2 Click the MapForce icon to view the version specifics 2006 Altova GmbH Altova MapForce User Manual 372 MapForce plug in for Eclipse Starting Eclipse and using MapForce plugin 23 2 Starting Eclipse and using MapForce plugin Ci Workbench 50 to the workbench Place the cursor over the arrow symbol and click when the Go to the workbench text appears This opens an empty MapForce window in Eclipse Starting Eclipse and Using MapForce Plug in Having used the MapForce for Eclipse installer you are presented with an empty Eclipse environment Java Eclipse SDK 5 x Fie Edit Navigate Search Project Run Window Help I ES OR oO G E l Java EEG Swe o 0n
97. and connect it to the substring item of the contains function 6 Click the part Query item again and connect it to the part Result item of the getPersonSoapOutput component The Query item element of the getPersonSoaplin component is the query placeholder i e this is where the query string is entered in the SOAP client once the code has been PTS Altova MapForce User Manual 2006 Altova GmbH MapForce and Webservices Creating webservice projects from WSDL files 351 generated compiled and deployed on the webserver 7 Insert a filter component and complete the mapping as shown in the diagram below E people fa filter IES Persons HERE rst nvarch on falzel b First rc bo onta i i mL Last rvarch i litle nvarch oO getPersonS oap utput tf hae Ryser result gt ae fr tee a mE mail r arc E Hb part Result nl Aray0fPers contains 43n1 Person nl Person a ioe First nl string feza n 7 4 Last nl string Tithe nl sting 7 4 PhoneEXT nl string AE Input getPersonSoaplin gt oe Email rm string part Query xzd string You are now ready to generate code to create a webservice Webservices can currently be generated for Java or C The following sections describe the code generation compilation and deployment of the relevant webservices for both Java and C 2006 Altova GmbH Altova MapForce User Manual 352 MapForce and Webservices Generating Java webservices with MapForce
98. and functions through MapForce API Activex control Project management functions to group mappings and WSDL projects Creation of WSDL webservices and mapping of webservice operations FlexText advanced legacy file processing Definition of custom XSLT 1 0 and 2 0 libraries Support for XPath 2 0 functions in XSLT 2 0 and XQuery Definition of user defined functions components having complex in outputs Advanced search and replace functions in transformation preview data XML Schema substitution groups Support for source driven mixed content mapping MapForce plug in for Eclipse MapForce for MS Visual Studio NET All transformations are available in one workspace where multiple sources and multiple targets can be mixed and a rich and extensible function library provides support for any kind of data manipulation 2006 Altova GmbH Altova MapForce User Manual MapForce 2006 ALTOVA mapforce Copyright 21998 2005 Altova GmbH All rights reserved Use of this software is governed by and subjectto an Altova software license agreement SMLSpy MapForce StyleVisian SemanticWorks SchemaAgent UModel Ditt Oog Authentic Altova 8ML and ALTOVA are trademarks andor registered trademarks of Altova GmbH Patent Sl pending AML SSL SATMAIL and WS are trademarks registered in numerous countries of the world Wide web Consortium marks of the WC are registered and held by its host institutions MIT INRIA and Keio U
99. bead m be I 1 Le Po i T7 Lt Li 1 E Fo i a i F I I Lt LI 1 ia al Y Destination a Y Car Rental ow Air Travel 2 he d Misc Travel ac 4 Accommodat E Y Entertainmen r E Meal H Lodging A 3 Travel oo means E M 1 laa iL i SS Trav cost iL 4 Create the same mappings that were defined for the first XML source file 2006 Altova GmbH Altova MapForce User Manual 58 MapForce tutorial Mapping multiple source items to single target items Person to Employee 2 Last to Name Title to Title Phone to Tel Email to Email expense item to expense item Scroll down and map Travel to Travel and Trav cost to Travel Cost Heal i Y CashAddvance Lodging E mi ExpReport a Employee 2 Travel gt a E expense report T Title detailed 3 iray CUIrency means Tra cost i Destination p p E1t Person oon Email Mileage e P ie l gt O DomesticDaily Parking gt P J a 3 Y ForeignD ailyR Entertainment i Title e Y Expense detai Misc OY i Phone 15 Y expense item Email description Al Y expense item joe Currency AQ Travel Travel Cos EM Destinatio 1 a 7 gt i Car Rental fl lt Lodging Air Travel TIAA rave gt i i i Misc Trave staid Means m Accommodat
100. before the currently active field length 10 Click the delete icon IH to delete the currently active field Click in the Name field to edit the default text that is presented Click in the Type field to define the field datatype string boolean decimal etc Inserting the FlexText template into MapForce allows you to map the data to any of the supported target files In this example FLF items are mapped to XML items a A Root gt b E Split once n n Sime i a Split once DEJE C Person i T OF T P sss First i P ne First i n Last i i ae Last ts N 0 Title i _ nonce xk _ PhoneE xt i i on EMail i e e Position gt l L 22 Store L 2006 Altova GmbH Altova MapForce User Manual 296 FlexText FlexText Reference 19 6 8 Store value wt el Allows you to define a container which makes its data available as a mappable item in MapForce If you do not change the container name in FlexText then the mappable item appears with the name Store Container default settings are Type string Trim no The screenshot below shows the Store container with its contents visible in the Sample Text pane 3 Block f mt fel Cu Repeated split 7 E Mode delimited line based Type sting oF Trim No Separator 222 Saving this template and opening it in MapForce allows you to map the Store item to other items in a target component OJ Flex
101. can be viewed by clicking a database component and selecting the menu option Component Component Settings The table below shows the different applications that can be compiled in each of the environments MappingConsole java Console application JM a o ooo A o MappingApplication java Dialog application O0 W BE To generate Java code in MapForce 1 Select the menu option File Generate code in Java You are then prompted for the target directory of the generated files 2 Select the directory you want to place the files in and click OK to confirm eg c codegen Java A Java Code generation completed message appears when the process was successful If not an error message appears detailing the specific error s If you are using an ANT build script e Navigate to the Java subdirectory and execute ant which automatically opens the build xml file e This will compile and execute the Java code The XML target instance file is automatically generated at the end of this sequence ey C WINDOWS Systems2 cmd exe Ss HE C sTemp Market ingExpenses gt ant Buildfile build xml compile javac Compiling 47 source files to C TempMarket ingExpenses javac Compiling 340 source Files to C Temp Market ingExpenses Mapping Application 1 Loading C Projects Files aANLS pyExeFo lder NapForceExamples ExpRe port javal Saving MarketingExpenses xml java Finished BUILD SUCCESSFUL Total time 5
102. choices in this example compile for C use XERCES generate code for dynamic libraries generated code not to support MFC create a log file in the outputdir with the name LogFileName VI generate all output files target XML document and databases using the built in transformation engine MapForce exe Filename outputdir BUILTIN Altova MapForce User Manual 2006 Altova GmbH MapForce How To Input values overrides and command line parameters 95 6 7 Input values overrides and command line parameters MapForce allows you to create special input functions that can e define an override or alternative value for data being input by the current mapping and e use this input component as a parameter in the command line execution of the compiled mapping Please note This specific type of input function cannot be used inside a user defined function The mapping below uses such an input function The aim of this mapping is to search for a specific article number and replace it with a value 1033 if found If the search is not successful retain the current number What the input function allows you to do is override the current input which is 1 and replace it with whatever you define in the input function Please note that the input in this example is a constant i e 1 but that this will generally not be the case in a complex mappings where the input can be any type of data from any input source The input fu
103. comparing input nodes 90 values in XSLT 88 Build C build configurations 426 Build xml 417 Builder user defined function 196 C C code 412 code generation 482 compile code 424 enumeration 520 error handling 469 generate code 424 integrate generated code 436 integration of MapForce 534 535 537 539 540 options 494 496 settings 440 C build configurations 426 code 412 code generation 483 compile code 426 EDIFACT X12 generation 334 enumeration 516 517 error handling 469 generate code 426 integrate generated code 438 options 494 495 496 settings 440 Call template 234 Character fill 179 character entities in HTML output of XSLT transformation 582 character normalization in XQuery document 587 Check type checking 248 Child items autoconnect 22 Children standard with children 77 Class ID in MapForce integration 526 Client Oracle installation 410 Close 482 project 501 Code built in types 455 generation 415 generation example 430 integrating MapForce code 433 SPL 442 Code compatibility v2005R3 440 code generation 490 492 and absolute path 47 and input parameters 95 C 482 C 483 C class EDIFACT X12 334 enumerations 516 517 518 520 521 generate XQuery 192 input parameters 95 Java 483 options 486 options for 494 495 496 sample 463 XSLT 484 Code Generator 412 Code generation options for 475 498 collations
104. component is used as a complex input component 2006 Altova GmbH Altova MapForce User Manual 208 User defined functions Complex user defined function XML node as input GA Articles A Articles E Article h os i Number I 8 Insert the rest of the components as shown in the screenshot below namely a second simple input component filter equal and output components and connect them as shown G Article bool _ on falselp 4 Number 7 Name Please note e The Articles input component receives its data from outside of the user defined function Input icons that allow mapping to this component are available there e An XML instance file to provide data from within the user defined function cannot be assigned to a complex input component e The other input component input 1 supplies the ShortPO article number data to which the Articles Number is compared e The filter component filters out the records where both numbers are identical and passes them on to the output component 10 Click the Home icon zal to return to the mapping 11 Drag the newly created user defined component from the Libraries pane into the mapping Libraries left EE UZET FindArticle Add Libraries 12 Create the connections as shown in the screenshot below Altova MapForce User Manual 2006 Altova GmbH User defined functions Complex user defined function XML node as input 209
105. confusion about the control for the user Adding the Placeholder Controls Placeholders on the MDI Frame The example project has to place Placeholder controls on the main MDI Frame They are also added via the Toolbox window by dragging a rectangle on the destination Form To set the type of the Placeholder which should be displayed one has to set the PlaceholderWindowID property This property can also be changed during runtime in the code of the application The Placeholder control would change its content immediately Properties of the Library window on the left side of the MDIMain Frame window are shown below 2006 Altova GmbH Altova MapForce User Manual 536 MapForceControl Integration at Document Level DataBindings DynamicProperties Mame 4AccessibleDescription 4ccessibleHame 4ccessibleRole SllowOrop Anchor Causes alidation Dock ImeMode Location Locked Modifiers PlaceholderwindowIC Size Tablndex TabStop Tag Visible axMapForceControlLibrary Default False Top Left True Left MoContral 0 0 False Private MapForcexLibrary Window eff 625 Fa True True Properties of the Output window at the bottom DataBindings DynamicProperties Marnie 4ccessibleDescription 4AccessibleName 4ccessibleRole AllowOrop Anchor Causes alidation Dock ImeMode Location Locked Modifiers PlaceholderwindowIC Size TabIndex TabStop Tag Visible axMapForceControlOutput Default Fa
106. constituent components of the user defined function the two input components at left and the output component at right fa equal i result ci Articles esa fi filter ZJE OArticles f bool E Article Y Number 2006 Altova GmbH Altova MapForce User Manual 206 User defined functions Complex user defined function XML node as input 10 3 1 Complex input components defining Defining complex input components 1 Create a user defined function in the usual manner i e Function Create User Defined function and click Enter to confirm Note that the Inline option is automatically selected Implementation f Inline recommended Allows complex parameters filters and multiple outputs C Standard function Allows recursive calls 4 2 Click the Insert input component icon in the icon bar 3 Enter the name of the component into the Name field Create Input x Mame Articles Type C Simple type integer string etc Datatype string es Structure Choose Foot Choose Cancel 4 Click the Complex type radio button then click the Choose button next to the Structure field This opens the Insert Inout Parameter dialog box The top list box displays the existing components in the mapping in this example three schemas Note that this list contains all of the components that have been inserted into the active mapping e g XML schema database EDI file or FlexT
107. costs i of sort alpha ascending lt l Company details location and general company infoarmation i elpara gt spara White papers and further information vill be made available in the near future i lt iDesc Please note the sequence of the text and bold italic nodes of Nanonull Inc in the XML instance file they are lt para gt The company lt bold gt Vereno lt bold gt in 1995 lt italic gt multi core lt italic gt February 1999 2006 Altova GmbH Altova MapForce User Manual 70 Source driven mixed content mapping lt bold gt Nano grid lt bold gt The company lt italic gt offshore lt italic gt to drive lt para gt Mapping The initial state of the mapping is shown below E Tut OrgChart a A OrgChart E 4 CompanyLogo i href i a ko T 4 Office Name E 7 Desc E para pod ko kon kog wt it LA LER LER LER LSR LSF LER LER LE LAR L Output of above mapping E TutPerson E Company Person i5 CompanyLogo oe 2 href E Office i Name E Desc E para Y italic ie F Location i cece Y Phone oo 3 EMail eas kog r kog r kog kcal pa kog aa i it J J LSR J J J J Lt J J Li om L esl The result of the initial mapping is shown below Organization Chart as well as the individual office names have been output lt Ysml version 1 0 encoding UITF 3 7 Company Pe
108. data in child tables f Ignore input child data PP Result Updates parent table data Department records Retains existing database tables Engineering in this case which do not have a counterpart in the input XML file no source keys for the Update if comparison Delete if only deletes those Person records for which a corresponding Person PrimaryKey exists in the source XML file Database records which do not have the corresponding Person key are retained To see a further example involving duplicate items Insert Update and transactions please see the Customers_DB mfd sample file available in the MapForceExamples folder The example shows how XML schemas and database sources can be mapped to target databases In the example XML Schema to database Customers and Addresses exist in the target database These entries are updated with the new data from the from the source XML Schema document The FirstName an LastName items are used to find the correct rows in the database Database to database Address and Person data are supplied by the database source and are inserted into the database The target table Customers is duplicated CustomerID for each record are created anew with the initial value being A1000 2006 Altova GmbH Altova MapForce User Manual 130 MapForce and Databases Mapping XML data to databases E Customers I Customers gt E Customer 3 Humber LastName E
109. deep equal functions For any node selection that selects text nodes also boundary whitespace only text nodes would typically also be included in the selection However since the XML Infoset used by the Altova engines has boundary whitespace only text nodes stripped from it these nodes are not present in the XML Infoset As a result the size of the selection and the numbering of nodes in the selection will be different than that for a selection which included these text nodes The fn position fn last fn count and fn deep equal functions therefore could produce results that are different from those produced by some other processors A situation in which boundary whitespace only text nodes are evaluated as siblings of other elements arises most commonly when xsl1 apply templates is used to apply templates When the n position fn last and fn count functions are used in patterns with a name test for example para 3 whichis short for para position 3 boundary whitespace only nodes are irrelevant since only the named elements para in the Altova MapForce User Manual 2006 Altova GmbH Appendices Engine information 591 above example are selected Note however that boundary whitespace only nodes are relevant in patterns that use the wildcard for example 10 Numeric notation On output when an xs double is converted to a string scientific notation for example 1 0E12 is used when the a
110. dialog box 1 Use the Character Map application to select and copy the specific character into the system clipboard 2 Paste the character into one of the combo boxes Mapping date and time datatypes Prior to MapForce 2006 R3 date and time were of type string in EDIFACT and X12 components From this release on date and time can be mapped directly to from xsd time or xsd date also from SQL date time User defined functions prior to the R3 version that convert xsd date or xsd time into an EDI format generate an error message and cannot be used as they are Please use the schema datatype xsd datetime which can be mapped using the built in functions date from datetime or time from datetime in the datetime library If you need to map dates within user defined functions please make sure that they adhere to the ISO 8601 date time format i e YYYY MM DD Altova MapForce User Manual 2006 Altova GmbH MapForce and EDI UN EDIFACT and ANSI X12 as target components 315 20 3 1 UN EDIFACT target validation The following items are checked when a UN EDIFACT document is validated Whether a UNB and a UNZ segment exist Whether UNB S004 contains a valid date time specification Whether UNB 0020 and UNZ 0020 contain the same value Whether UNZ 0036 contains the correct number which is defined as the number of functional groups if present or the number of messages If there are functional groups this should be the number of fu
111. documen a Lens sunk l raul Le ilk Lens sunk Add Libraries 3 Select the XSL or XSLT file that contains the named template you want to act as a function in this case Name splitter xslt The XSLT file appears in the Libraries tab 2006 Altova GmbH Altova MapForce User Manual 236 Adding custom XSLT 1 0 functions Libraries General Generation 3 Add hha Delete 4 Click OK to insert the new function core xsstylesheet version 0 xmins xsl hittp iy exshoutput method sml versian 1 0 encoi HE Hame splitter tokenize result tokenizel string xsttemplate match gt f axl tor each select gt EE xslt 5 i eyvstcalltemplate name tokenize gt ei xpath functions exelwith param name string selects i lang result langi string sixakcall template last result lasti sd o sisl for each local name result localnamel node fcsltemplate gt name result namel node HaMmespace U result namespace unil r position result position sxsltemplate name tokenize gt xsl param name string select gt sxs variable name Ccaps select translat xsl variable name Ccapscount select st The XSLT file name appears in the library window along with the function s defined as named templates below it In this example Name splitter with the tokenize function 5 Drag the function into the Mapping window to use it in you current mapping and map
112. document This is accomplished by using the generated factory functions called newXXX please see the example code below LibraryDoc doc new LibraryDoc doc setSchemaLocation Library xsd optional create root element with no namespace prefix LibraryType lib new LibraryType doc http www nanonull com LibrarySample Library BookType book 1ib newBookType factory functions are generated for all members of a complex type book addISBN new SchemaString 0764549642 book addTitle new SchemaString The XML Spy Handbook book addAuthor new SchemaString Altova lib addBook book doc savet Library xmi Jab j General tab e Specify if you want to show the logo on start and or when printing e Enable disable the MapForce gradient background e Define the Default Output Encoding e an execution timeout for the Output tab when previewing the mapping result Libraries tab e Add or delete user defined XSLT or programming language Libraries functions to MapForce Mapping settings Select the menu option File Mapping settings to define e the Application name name of generated Java files used when generating code e Base Package Name when compiling for Java 2006 Altova GmbH Altova MapForce User Manual 442 Code Generator The way to SPL Spy Programming Language 25 7 The way to SPL Spy Programming Language This section gives an overview
113. e The Messages pane displays any validation warnings or error messages that might occur during the mapping process Clicking a message in this pane highlights it in the Mapping tab for you to correct Altova MapForce User Manual 2006 Altova GmbH MapForce overview 9 Wi MapForce Tut ExpReport mfd x ioj xi E File Edit Insert Project Component Connection Function Output wiew Tools Window Help Dello oly Bs eX oh A ga Bis oe o ce ce ree Re fa ExpReport_ Tutorial El expense report exp a E 4 Com 2 gt 10002 Stel thiols amp Bh 4 Eh Project em Mapping Folder om detailed gt E En TutEspReport r currency fy concat ii SE a Tut headerDeta Person value Y First value E result sven Last valued amp 3 oo Title oe Phone Email E Y expense item awash type 3 expto E 7 Meal aan mealtype fa filter 4 Mapping MOLT Output i 6 Libraries Project Ready CAP NUM SCRL g 2006 Altova GmbH Altova MapForce User Manual 10 MapForce overview Terminology 2 1 Terminology Library A Library is a collection of functions visible in the Libraries window There are several types of functions core and language specific as well as user defined functions Please see the section on functions for more details Component In MapForce a component is a very generic object Al
114. ee Tray cost ioi JE i AMET 5 Click the Output tab to see the result of the mapping Altova MapForce User Manual 2006 Altova GmbH MapForce tutorial Mapping multiple source items to single target items 59 zramm version 1 0 encoding UTF 0 t slompany xmins xsi http Mee ws org 00 SAMLSchema instance xsi schema lt Employees lt Tithe Project Manager Title gt lt Name Landis Mame Tel 123 456 78 lt Tel lt Email f landiccenanonull com Email sexpense item io Travel Travel Cost 337 88 svVexpense item sexpense itenm sexpense item ib Travel Travel Cost 1014 22 i svexpense item Sexpense tem fo eTravel Travel Cost 2000 gt l sfexpense tem i sexpense itemss JEmployee gt Employee gt lt Tithe Manager Tithe i Name Johnson Mame gt lt Tel 456 789 125 lt Tel Email johnm nanonull cam Email sexpense iteme ff eTravel Travel Cost 150 44 t gt l sfexpense tem sexpense item l sexpense iteme fof eTravel Travel Cost 1020 s gt sfexpense tem sexpense item lt Travel Travel Cost 0 r gt i sfexpense item JEmployee gt company gt D M oh amp Ww ha The data of the second expense report has been added to the output file Johnson and his travel costs have been added to the expense items of Fred Landis in the company expense report To save the generated output to a file e Click the Save icon a which appears in t
115. extra content exists for one of the items 2006 Altova GmbH Altova MapForce User Manual 338 MapForce and EDI Customizing an ANSI X12 transaction 20 6 2 X12 customization set up The text in the following sections describes how to customize the configuration files to be able to map the changed X12 transaction to the ORDER x12 xsd schema It assumes that the supplied ZIP file is not used Setting up the customizing example e copy the following files from the MapForceEDI X12 folder into the X12 Nanonull folder EDI Collection 850 config X12 Segment e Change the attributes of these files to read write to make them editable Configuring the EDI Collection file 1 Open EDI Collection file in XMLSpy or in you preferred editor 2 Remove all Message elements except for the 850 Purchase Orders Make sure you retain the lt Messages gt tags however tuml version 1 0 encoding UTF s t gt FE Messages Version 2 gt S Met a gt BRelease gt SO0le lt Release gt Agqgency ALZt r Agency Met a gt Message Type s60 File 850_Config Description Purchase Order gt 4 Messages gt 3 Save the file To see the content of the collection file 1 Start MapForce select Insert EDI or click the Insert EDI icon The Browse EDI collections dialog box opens displaying a new tab named X12 Nanonull Only one entry is visible the first column shows the message type 850 and the second th
116. fact that only the Hebrew and Arabic versions of Windows NT contains support for rendering and editing right to left text on the operating system layer 2006 Altova GmbH Altova MapForce User Manual 600 Appendices Technical Data 28 2 5 Internet Usage Altova applications will initiate Internet connections on your behalf in the following situations If you click the Request evaluation key code in the Registration dialog Help Registration the three fields in the registration dialog box are transferred to our web server by means of a regular http port 80 connection and the free evaluation key code is sent back to the customer via regular SMTP e mail If you use the Open URL dialog box to open a document directly from a URL File Open URL that document is retrieved through a http port 80 connection This functionality is available in XMLSpy and Authentic Desktop If you open an XML document that refers to an XML Schema or DTD and the document is specified through a URL it is also retrieved through a http port 80 connection once you validate the XML document This may also happen automatically upon opening a document if you have instructed the application to automatically validate files upon opening in the File tab of the Options dialog Tools Options This functionality is available in XMLSpy and Authentic Desktop If you are using the Send by Mail command File Send by Mail in XMLSpy the current selecti
117. file is used as the input sample to evaluate the mapping Errors 1300 The application object is no longer valid 1301 Invalid address for the return parameter was specified InsertXMLSchema Method Insert XMLSchema i_strSchemaFileName as String i_strRootElement as Description Adds a new item to the mapping The item s internal structure is determined by the specified schema file The second parameter defines the root element of this schema if there is more then one candidate No XML input sample is assigned to this item Errors 1300 The application object is no longer valid 1301 Invalid address for the return parameter was specified InsertXMLSchemaWithSample Method Insert XMLSchemaWithSample i_strSchemaFileName as String i_strXMLSampleName as String i_strRootElement as String Description Adds a new item to the mapping The item s internal structure is determined by the specified schema file The second parameter is stored as the XML input sample for mapping evaluation The third parameter defines the root element of this schema if there is more then one candidate Errors 1300 The application object is no longer valid 1301 Invalid address for the return parameter was specified 2006 Altova GmbH Altova MapForce User Manual 480 The MapForce API Object Reference Parent Property Parent as Document read only Description The parent object according to the object model Errors 1300 The applicati
118. function standard 201 functions 196 functions complex 205 210 functions restrictions 196 functions changing type of 196 importing exporting 196 2006 Altova GmbH Index 629 User defined look up functions 201 nested functions 215 output if bool false 215 User defined functions 196 V Validate mapping project 25 output data 25 XML 254 Validator in Altova products 596 Value boolean in XSLT 88 default 215 Store 296 Variables in SPL 445 View 407 of MapForce 478 Visible 476 Visual Basic error handling 469 integration of MapForce 546 Visual function builder 196 Visual Studio NET and MapForce differences 365 MapForce plug in 362 open MapForce files in 363 VS NET 2002 2003 424 W Warning validation 25 Webservice fault 360 whitespace handling and XPath 2 0 functions 590 whitespace in XML document handling by Altova XSLT 2 0 Engine 584 whitespace nodes in XML document and handling by XSLT 1 0 Engine 582 WindowHandle 477 Windows support for Altova products 595 X X12 as target 312 auto completion rules 318 code generation C class 334 customization set up 338 global customization 340 inline customization 343 legal values 321 local customization 341 merged entries 337 target validation rules 318 Xerces support 440 XML mapping from UN EDIFACT 302 mapping multiple tables to 85 save output 254 save XML output 27 vali
119. fy equal or greater Feb result ff filter PApnode row on truel or talzel a E Company gt E Employee oo Title E oa Name i E Bill to 2 2 Date E Y Travel Altova MapForce User Manual 2006 Altova GmbH MapForce How To Specifying alternate database resources 99 6 9 Specifying alternate database resources When opening a mapping file mfd containing a database component it is possible that the database location has changed or the data source name does not exist any more If this is the case a message box opens allowing you to continue the process and select a different database connection maproree x The connection bo the Following database could not be opened OSMW Barnabas iSeries ODBC Database Connection Error Reason Data source name not Found and no default driver specified Do you want to continue loading and specify a different connection e Clicking No halts the file loading process Any additional database components connections in the mapping are ignored e Clicking Yes opens the Select a source database dialog box in which you can start the database selection process If the database connection can be established then the file opening process continues If additional database connections cannot be opened you are also prompted to select them anew If the database connection cannot be established then the loading process is halted
120. gt lt nature gt com altova mapforceeclipseplugin MapForceNature lt nature gt lt natures gt Any MapForce project files and mappings contained in this project will now participate in the automatic build process For MapForce specific details see Using MapForce Eclipse projects for automatic build 2006 Altova GmbH Altova MapForce User Manual 384 MapForce plug in for Eclipse Extending MapForce plug in 23 7 Extending MapForce plug in MapForce plug in provides an Eclipse extension point with the ID com altova mapforceeclipseplugin MapForceAPI You can use this extension point to adapt or extend the functionality of the MapForce plug in The extension point gives you access to the COM Interface of the MapForce control and the MapForceAPI Your MapForce Eclipse installation package contains a simple example of a plug in that uses this extension point It checks for any file open events of any new MapForce mappings and sets the zoom level of the mapping view to 70 Installing the Sample extension plug in MapForce plug in requires the JDT Java Development Tools plug in to be installed 1 Start Eclipse 2 Right click in Navigator or PackageExplorer and select the menu item Import 3 Select Existing projects into Workspace and click Next Select Create new projects From an archive file or directory This does nok copy the project into the workspace Select an import source E Archive File h Check
121. i Received 4 Customer 3 oe 4 Number 7 sss 4 ContactName i CompanyName E 7 Address ow Y Street i LI Lt r m i LI Lt L r m r r ir i L r L it i ho LI Lt r r w E i r Filtering out the Buyer purchase orders At this point we want to filter out the Buyer purchase orders These can be identified by the party function code qualifier of the NAD Name and address segment In this case the value BY indicates a Buyer Party to whom merchandise and or service is sold 1 Drag an equal function from the core library into the Mapping area 2 Select the menu option Insert Filter Nodes Rows 3 Insert a Constant component using Insert Constant click All other and type BY into the text field E ew f Number f All other Cancel Map the following items SG2 NAD F3035 The Constant BY The result of the equal function SG2 NAD The result of the filter function gt the b input of the equal function gt the a in put of the equal function gt the bool input of the filter function gt the node row input of the filter function gt Order Customer in the schema The aim here is to only map data if the NAD node refers to a Buyer as identified by the party function code qualifier BY Altova MapForce User Manual 2006 Altova GmbH MapForce and EDI UN EDIFACT to XML Schema mapping 309 won SS F2005 e
122. i i i i j r koni a i ww L Altova MapForce User Manual 2006 Altova GmbH MapForce tutorial Database to schema mapping 61 3 8 Database to schema mapping This section will show how to use a simple Microsoft Access database as a data source to map database data to a schema To use other databases please see the JDBC driver setup section In the current MapForce release the following databases are supported Microsoft Access 2000 and 2003 Microsoft SQL Server Oracle MySQL Sybase IBM DB2 ADO compatible databases e ODBC databases The table below shows the type of database created the restrictions and the connecting methods when inserting databases Insert Database connection methods Create Schema from Database Supported ODBC restrictions ADO restrictions Oracle OCI database unique keys are not supported by ODBC Microsoft Access OK not not ADO recommended Primary and Foreign keys are not supported MS SQL Server OK ADO Oracle OCI P aT table E table containing columns containing columns of type of tyoe CLOB CLOB BLOB BFILE BLOB BFILE XML tables owner XML tables information Identity constraints are not read from the database waooo om o o oo Sybase ODBC o ox o J ooo smo oa oe ooo ooo o Recommended connection method for each database MySQL When creating the ADO connection based on ODBC it is recommended to use either the U
123. i HE First Name _ ar aii m role f ho r r kog r kog l state Last Name E street Y zip E Contact first last pi LER L Li r T u u ee f ar f ar f ar f ar ar ar ar Laer _ it it kog kosi 2006 Altova GmbH Altova MapForce User Manual 216 User defined functions User defined function example Configurable input parameters The input 1 component receives data supplied when a mapping is executed This is possible in two ways e as acommand line parameter when executing the generated code e g Mapping exe OfficeName Nanonull Partners Inc e as a preview value when using the MapForce Engine to preview the data in the Output window H input 14 Manonull Inc Officename i i aE 7 BranchOffices i gt gt Office Name To define the Input value 1 Double click the input 1 component and enter a different value in the Value text box of the Preview Mode group e g Nanonull Partners Inc and click OK to confirm 2 Click the Output tab to see the effect A different set of persons are now displayed Please note that the data entered here is only used in preview mode i e when clicking the Output tab If a value is not entered or the check box is deactivated then the data mapped to the input icon default is used Please see Input values
124. i e mixed true as source componenis e XML schema complexTypes including mixed content database tables EDI documents elements CSV and fixed length files as target components Please note Mixed content text nodes can only be mapped in their entirety you cannot limit or transform the data they contain Filters or any other type of function cannot be used to access text node data The image below shows an example of mixed content mapping The para element is of mixed content and the connector is shown as a dotted line to highlight this a Office i e 4 Office Name fs gt l sone 7 Hame a Desc ie E Desc a para k i E para bold 5 l bold Y italic E Y italic TE K l Location Right licking a connector and selecting Connection settings allows you to annotate or label the connector Please see section Connection in the Reference section for more information Altova MapForce User Manual 2006 Altova GmbH Source driven mixed content mapping 69 The files used in the following example Tut Orgchart mfd are available in the MapForceExamples Tutorial folder The image below shows the content model of the Description element Desc of the Tut OrgChart xsd schema file This definition is identical in both the source and target schemas used in this example Content model of para element e para is acomplexType with mixed true of type TextType e
125. instance xsi schema Employee lt Tithe Project Managers Title lt Mame Fred Landis Mame lt Tel 123 456 78 Tel Email t landisienanonull com Email sexpense item Currency USD Bill to Sales gt b sDate 2003 01 01 lt iDates PoP lt Accommodation 2 ob DomesticAcc DomesticAcc Cost 1 21 2 PoP lt fAccommodation sfexpense tem sexpense item Currency USD Bill to Sales Dete 2003 03 03 lt Date sfexpense item s Employee lompany od moh ew ha The XML output contains two records both billed to Sales the Domestic Accommodation cost of 121 2 and an Expense item record which only contains a date This record originates from the expense item Meal There is currently no mapping between meal costs and domestic accommodation costs and even if there were no cost would appear as the XML instance does not supply one Please note You can save this XML data by clicking the Save generated output icon while viewing the XML output in the preview window The resulting XML instance file can also be validated against the target schema by Ly clicking the validate button To generate XSLT 1 0 XSLT 2 0 code for multiple target schemas 1 2 3 Select the menu item File Generate code in XSLT 1 0 or XSLT 2 0 Select the folder you want to place the generated XSLT files and click OK A message appears showing that the generation was successful Navigate to the designated fold
126. is empty e Separator tsSeparator IS true ID is 0 and Label is not set The SubCommands collection is empty e Sub Menu The subCommands collection contains MapForceCommand objects and Label is the name of the menu ID is set to 0 and IsSeparator Is false ID Property 1D as long Description ID is 0 for Separators and menus For commands this is the ID which can be used with Exec and QueryStatus Label Property Label as string Description Label is empty for separators For command objects that are children of the ALL_COMMANDS collection this is a unique name Command icons are stored in files with this name See Query MapForceCommands for more information For command objects that are children of menus the label property holds the command s menu text For sub menus this property holds the menu text IsSeparator Property IsSeparator as boolean Description True if the command is a separator SubCommands Property SubCommands aS MapForceCommands Description The SubCommands collection holds any sub commands if this command is actually a menu or submenu 2006 Altova GmbH Altova MapForce User Manual 564 MapForceControl Object Reference 27 5 2 MapForceCommands Properties eka ge Item Description Collection of MapbForceCommand objects to get access to command labels and IDs of the MapForceControl Those commands can be executed with the Exec method and their status can be querie
127. item value to which the Last item is connected Altova MapForce User Manual 2006 Altova GmbH MapForce tutorial Using functions to map data 39 rof E xoR eport i El expense report expl h concat ow detailed pvaluel E D J peta results I TETTI CUITENCY z E Person i value oe A First 7 oe Last Title bee Phone om Email E expense item 7 Connect the result icon of the concat component to the Name item in the target schema 8 Click the Output tab to see the result of the current mapping lt Ysml versian 1 0 encoding LITF 3 eCompany xmins xsi http kw vw org 2001 MLS chema instance Employee lt Tithe Project Manager Tithe gt Name Fred Landit Mame Emails landist nanonull com Email JEmployee gt lt flompany gt oo 4 moh eo a You will see that the Person name Fred Landis is now contained between the Name tags The first and last name have been separated by a space character as well Mapping the rest of the personal data 1 Create mappings between the following items e currency to Currency e Phone to Tel e expto to Bill to e Date to Date 2 Click the Output tab to see the result lt xml version 1 0 encoding LITF a gt Company xmins xsi http Mee vw org l2001 AML Schema instance xsi schema Employees lt Tithe Project Manager Tithe sName gt Fred Landis lt Mame lt Tel 123 45
128. language specified 1706 Error during code generation GenerateCodelnEx Method GenerateCodeIn i_nLanguage as ENUMProgrammingLanquage as ErrorMarkers Description Generates code for the project item and its children in the specified language The output location is determined by CodeGenSettings UseDefault and CodeGenSettings OutputFolder Children of this project item can have their own property settings related to code generation An object that can be used to iterate through all messages issued by the code generation process is returned These messages are the same as those shown in the Messages window of MapForce Errors 1700 The object is no longer valid 1701 Invalid language specified or invalid address for the return parameter was specified 1706 Error during code generation Item Property Item i_nItemIndex as Integer as ProjectItem read only Description Returns the child at 1_nItemIndex position of this project item The index is zero based The largest valid index is Count 1 For an alternative to visit all children see _NewEnum Errors 1700 The object is no longer valid Examples See Project Ite or Project NewEnum Kind Property Kind as ENUMProjectItemType read only Description 2006 Altova GmbH Altova MapForce User Manual 512 The MapForce API Object Reference Retrieves the kind of the project item Availability of some properties and the applicability of certain methods
129. lt Mame lt singlePrice 2 3 lt SinglePrice gt lt Article lt Article o ehumber 3 lt Mumber NamesPants lt Mame lt SinglePrice 34 lt SinglePrice gt Article gt Article lt Number 4 lt Mumber lt Name Jacket Wame gt lt SinglePrices57 5 lt SinglePrice gt lt A rticle 2 Mrticles The original article number 2 has been changed to 1033 The value supplied by the input function has taken precedence over the value supplied by the constant Input values and Code generation Values or strings entered in the Create Edit input dialog box are only applicable when e Previewing results in the Output tab or e when generating program code in XSLT 1 0 2 0 XQuery Java C or C The data directly supplied by the input icon are used when generating code Using input values as parameters in command line execution of mappings Input values can be used as parameters when calling the generated mapping where Altova MapForce User Manual 2006 Altova GmbH MapForce How To Input values overrides and command line parameters 97 e the generated application name is Mapping exe e the input value name TrueVal is the first parameter and e the input value 2 is the second parameter The command line thus becomes mapping exe TrueVal 2 Please note Running mapping exe without parameters displays a warning message and help on the command line syntax needed e Alternative values
130. may not be placed between the filter and either the exception or target components Altova MapForce User Manual 2006 Altova GmbH Chapter 22 MapForce plug in for MS Visual Studio NET 362 MapForce plug in for MS Visual Studio NET 22 MapForce plug in for MS Visual Studio NET You can integrate your version of MapForce2006 into the Microsoft Visual Studio NET IDE versions 2002 2003 and 2005 This unifies the best of both worlds integrating advanced mapping capabilities with the advanced development environment of Visual Studio NET To do this you need to do the following Install Microsoft Visual Studio NET e Install MapForce Enterprise or Professional Edition Download and run the MapForce Visual Studio NET Edition integration for Microsoft Visual Studio NET package This package is available on the MapForce Enterprise and Professional Editions download page at www altova com Please note You must use the integration package corresponding to your MapForce edition Enterprise or Professional iy Libraries QuotationsDoc mfd CompletePo nfd MFD File1 mfd HE Core e3 conversion functions boolean E Quotations number Ca Quotations of famo gt E14 People gt amg E Y Person logical functions FirstName s string LastName xs string equal g l gt Hg ear fi string equal or greater i l 4 Quotation 2 string Pa CY xogo sayojdeg savas Ee equal or less gre
131. menu Depending on the edition of MapForce you have installed some of these commands might not be supported See Query MapForce Commands on how to query the current resource structure and command availability The same topics shows how to use the same command icons that are used by MapForce if you are not already integrating on application level Use the command identifiers with MapForceControl QueryStatus Or MapForceControlDocument QueryStatus to check the current status of a command Use MapForceControl Exec Of MapForceControlDocument Exec to execute a command File Menu Edit Menu Insert Menu Project Menu COmponent Menu Connection Menu Function Menu vu puc Menu View Menu Tools Menu Window Menu Help Menu Commands not in Main Menu 2006 Altova GmbH Altova MapForce User Manual 548 MapForceControl Command Table 27 3 1 File Menu Commands from the File menu Menu Text 3 3 3 3 3 3 Close Al 3 Save Project Close Project Print Preview Print Setup ID_FILE PRINT SETUP Generate code in selected language ID_FILE_GENERATEXSLT2 ID_FILE_GENERATECSCODE Mapping Settings Recent Files Recent File D FILE MRU_FILE1 Recent Projects Recent Project 1 NO Q O gt NO Generate code in XSLT 2 0 1 enerate code in C Sharp ioe NO oo O mS Save All Generate code in XSLT 1 0 Generate code in XQuery Generate code in Java Generate code in C 1 NO oO 09 ee Alto
132. navigation 476 480 Application 473 Document 482 MapForceView 478 Mapping 486 Options 494 497 Project 501 OnDocumentClosed 481 OnDocumentOpened 473 OnProjectClosed 500 OnProjectOpened 473 Open MapForce files in VS NET 363 OpenDocument 475 489 OpenProject 475 Option CSV file options 177 Optional input parameters 215 Options 475 494 for code generation 486 496 for Java 485 Oracle client installation 410 database info 147 support 61 Oracle Qi drivers 107 OS for Altova products 595 Out of memory 429 Output 406 file CSV 177 file Text 186 find data 27 parameter 215 user defined if bool false 215 validate 25 validate XML 254 validating 25 window 254 window zoom factor 254 XML instance 397 Output directory for code generation files 494 for XSLT generated output 498 Output encoding 2006 Altova GmbH 626 Index Output encoding default used 496 Output icon mapping 21 Override input data 95 Overview 259 of MapForce API 461 Overview of MapForce 8 P Parameter alternative value 95 and code generation 95 command line 93 extending in functions 16 Input function as a 95 optional 215 output 215 Parent 476 488 490 493 505 mapping and filters 100 Parser built into Altova products 596 Path 486 505 absolute when generating code 47 Platforms for Altova products 595 Plug in applying MapF
133. new empty project The current project is closed The new project is accessible under Project Errors 1000 The application object is no longer valid 1001 Invalid address for the return parameter was specified OpenDocument Method OpenDocument i_strFileName as String as Document Description Loads a previously saved document file and continues working on it The newly opened document becomes the ActiveDocument This method is a shorter form of Documents OpenDocument Errors 1000 The application object is no longer valid 1001 Invalid address for the return parameter was specified OpenProject Method NewProject as Project Description Opens an existing Mapforce project mfp The current project is closed The newly opened project is accessible under Project Errors 1000 The application object is no longer valid 1001 Invalid address for the return parameter was specified OpenURL Method OpenURL i_strURL as String i_strUser as String i_strPassword as String Description Loads a previously saved document file from an URL location Allows user name and password to be supplied Errors 1000 The application object is no longer valid 1001 Invalid address for the return parameter was specified Options Property Options as Options read only Description This property gives access to options that configure the generation of code 2006 Altova GmbH Altova MapForce User Manual 476 The MapFor
134. newly created user defined component from the Libraries pane into the mapping Libraries left EE UZET FindArticle Add Libraries Project 11 Create the connections as shown in the screenshot below Having created the Article connector right click it and select Copy all from the context 2006 Altova GmbH Altova MapForce User Manual 214 User defined functions Complex user defined function XML node as output menu The rest of the connectors are automatically generated and are highlighted in the screenshot below a A ShortPO gt E LastName CustomerNr gt gt E Address E Lineltems f Street E Lineltem i j oo ArticleNrp Find rticle Amount i a e 4 Article Com 4 Humber H 4 Lineltems E Lineltem SinglePrice P E Article Amount Number 7 Price 7 T it ot i T 1 it it ot it T it T 43 SinglePricel Amount Price i it T Please note When creating Copy all connections between a schema and a user defined function of type Inline the two components must be based on the same schema It is not necessary that they both have the same root elements however The left half contains the input parameter to which a single item is mapped e ShortPO supplies the article number to the POArtNr input component The right half contains e a complex output component called Article CompletePO with its XML child nodes
135. of Spy Programming Language It is assumed that you have prior programming experience and are familiar with operators functions variables and classes as well as the basics of object oriented programming which is used heavily in SPL You should also have detailed knowledge of XML Schema The templates used by MapForce are supplied in the MapForce2006 spl folder You can use these files as an aid to help you in developing your own templates How code generator works The basis of the generator are the template files spl The template file is interpreted by the code generator and outputs a cpp java cS source code file or project or any other type of file depending on the template The source code is then compiled into an exe file which can then be started The exe file then accesses the XML data described by the schema file SPL files have access to a wide variety of information that is collated from the source schemas Please note that an SPL file is not tied to a specific schema but allows access to all schemas Make sure you write your SPL files generically avoid structures etc which apply to specific schemas Creating a new file in spl create test cpp include stdafx h close This is very basic SPL file It creates a file named test cpp and places the include statement within it The close command completes the template Altova MapForce User Manual 2006 Altova GmbH Code Generator The way to SP
136. oooooeeeoeeeeneesssssssssssssseeceeerersssssssssssssseeeeeeeeo 20 5 5 Customized Orders mapping example ccccccccccsessssseeeeeeeeeeeeees 20 6 Customizing an ANSI X12 transaction oo ccccccsssssesessesseeeeceeeeeseeeeeaaas 20 6 1 Customizing X12 source files oo ccccccccccccececceeeeeeeeeeeeeeeeeeeeeeess 200 2 X I2 customization SOU Up socere EEEE 20 6 3 Global CUStOMIZATION ssecissesirenki epen 20 6 4 Local customization ossoseeeoeeeeeessssssssssssssseceteererssssssssssssseeeeeeeeee 20 6 5 Inline customization nneeneeeeeeeeeeeeeserereeerererererereerrerrrrrrreereeseens 20 6 6 Customized X12 mapping example cc cccssssssssesseeeeeeeeees 21 MapForce and Webservices 21 1 WSDL info supported protocols cccccccccccccccceceeeeeeeeeesseseeeeeeeeeeeeeeeeaeaas 21 2 Creating webservice projects from WSDL files cc eeceeeeeeeeeeeeeeeeeeeeeeaes 21 3 Generating Java webservices with MapForce ccceeecccceececeeeeeeeeeeeees 21 3 1 Using the webservice getPerson operation sseeeeeeeeeeeeeees 21 3 2 Using the webservice putPerson operation csseeeeeeeeeeeeees 21 4 Generating C webservices with MapForce cccccccssssesesesseeeeeeeeeeeeeeeeneas Dl WCDSEIVICS PF a E E E E 22 MapForce plug in for MS Visual Studio NET 22 1 Opening MapForce files in MS VS NET uuu cccccccccececceceeeeeeeeeeeeeeees 22 2 Differences between NET and sta
137. owned by Altova and its suppliers The structure organization and code of the Software are the valuable trade secrets and confidential information of Altova and its suppliers The Software is protected by copyright including without limitation by United States Copyright Law international treaty provisions and applicable laws in the country in which it is being used You acknowledge that Altova retains the ownership of all patents copyrights trade secrets trademarks and other intellectual property rights pertaining to the Software and that Altova s ownership rights extend to any images photographs animations videos audio music text and applets incorporated into the Software and all accompanying printed materials You will take no actions which adversely affect Altova s intellectual property rights in the Software Trademarks shall be used in accordance with accepted trademark practice including identification of trademark owners names Trademarks may only be used to identify printed output produced by the Software and such use of any trademark does not give you any right of ownership in that trademark XMLSpy Authentic Style Vision MapForce Markup Your Mind Axad Nanonull and Altova are trademarks of Altova GmbH registered in numerous countries Unicode and the Unicode Logo are trademarks of Unicode Inc Windows Windows 95 Windows 98 Windows NT Windows 2000 and Windows XP are trademarks of Microsoft W3C CSS DOM MathML RDF
138. pane FlexText has three main panes Design Overview and Sample Text pane e The Design pane contains text fragment containers with default names describing their function e g Repeated Split e The individual containers or Sample Text pane display the contents of the currently active container e The Overview pane gives a birds eye view of all the containers in the Design pane The red rectangle is used to navigate the Design pane 2006 Altova GmbH Altova MapForce User Manual 260 FlexText Overview af MapForce FlexText Flex tutorial mit l ol x E File wiew Tools Window Help _ Ax Dee 4S Repeated split EF Switch Mode Heed length 1 Fd E Orientation hornzontal Content starts with 111 Offset Content starts with 222 Output For the first fi Ug i te l o o o smon hH Mode fied length el Onentation horizontal Co csv Split line 1 Record separator lt CR gt lt LF gt oF 4 Fey MapForceFlexText1 OVeryviey fhe COP NUM SCRL g Containers have clickable container icons which allow you to define the type and content of the container Clicking the container icon opens a pop up menu from which you can select the container type Altova MapForce User Manual 2006 Altova GmbH FlexText Overview 261 Rot EE Repeated Spit File name me Tab size U Split Once Switch Mode Ignore MapForceFlexTexti Store as CS delimited
139. publisher Products that are referred to in this document may be either trademarks and or registered trademarks of the respective owners The publisher and the author make no claim to these trademarks While every precaution has been taken in the preparation of this document the publisher and the author assume no responsibility for errors or omissions or for damages resulting from the use of information contained in this document or from the use of programs and source code that may accompany it In no event shall the publisher and the author be liable for any loss of profit or any other commercial damage caused or alleged to have been caused directly or indirectly by this document Published 2006 2006 Altova GmbH Table of Contents 1 MapForce 2006 3 2 MapForce overview 8 aL MC Aol y acca ctns sere eater eceacaaiec tances souaeses sah ece see aanaves aacteuc onsen ne sehete cesar aaereug nes 10 22 MapForce components eisereen 12 29 Funcions and DTA ES ero T S E eacieisooateus 16 A POR a E E S 19 29 Mapping between COMPONEIUG sicsccctancsotscosdecsavssndshceanhsceadsnsotscesdacsossudsiceanhsasdnedoiseatin 21 Dede Connector Proper oS essers eco r E NE E ES 22 2 6 Validating mappings and mapping output sssessssssesseoeeerseesssssssssssssseserrereesssssssssssssss 25 2 7 XSLT Output tab generating XSLT or program code ec ececccceeeeeeeeeeeeeees 21 3 MapForce tutorial 30 3 1 Setting up the mapping environment
140. reproduce or distribute any key code except with the express written permission of Altova If the Software that you have licensed is an upgrade or an update then the update replaces all or part of the Software previously licensed The update or upgrade and the associated license keys does not constitute the granting of a second license to the Software in that you may not use the upgrade or update in addition to the Software that it is replacing You agree that use of the upgrade of update terminates your license to use the Software or portion thereof replaced g Title Title to the Software is not transferred to you Ownership of all copies of the Software and of copies made by you is vested in Altova subject to the rights of use granted to you in this Software License Agreement As between you and Altova documents files stylesheets generated program code including the Unrestricted Source Code and schemas that are authored or created by you via your utilization of the Software in accordance with its Documentation and the terms of this Software License Agreement are your property h Reverse Engineering Except and to the limited extent as may be otherwise specifically provided by applicable law in the European Union you may not reverse engineer decompile disassemble or otherwise attempt to discover the source code underlying ideas underlying user interface techniques or algorithms of the Software by any means whatsoever directly or indir
141. restrictions set forth in this Agreement and as provided in FAR 12 211 and 12 212 48 C F R 12 211 and 12 212 or DFARS 227 7202 48 C F R 227 7202 as applicable Consistent with the above as applicable Commercial Computer Software and Commercial Computer Documentation licensed to U S government end users only as commercial items and only with those rights as are granted to all other end users under the terms and conditions set forth in this Software License Agreement Manufacturer is Altova GmbH Rudolfsplatz 13a 9 A 1010 Vienna Austria EU You may not use or otherwise export or re export the Software or Documentation except as authorized by United States law and the laws of the jurisdiction in which the Software was obtained In particular but without limitation the Software or Documentation may not be exported or re exported 1 into or to a national or resident of any U S embargoed country or ii to anyone on the U S Treasury Department s list of Specially Designated Nationals or the U S Department of Commerce s Table of Denial Orders By using the Software you represent and warrant that you are not located in under control of or a national or resident of any such country or on any such list GENERAL PROVISIONS If you are located in the European Union and are using the Software in the European Union and not in the United States then this Software License Agreement will be governed by and construed in accordance with the laws o
142. screenshot below shows the constituent components of the user defined function the input component at left and the complex output component at right HE POA de tauk POA E ve ih titer P resin El artices roserow onur Al Y Articles gt ebook on falze t E Article Number g ka Q Article e Number 7 Name SinglePrice Amount Price Altova MapForce User Manual 2006 Altova GmbH User defined functions Complex user defined function XML node as output 211 10 4 1 Complex output components defining Defining complex output components 1 Create a user defined function in the usual manner i e Function Create User Defined function and click Enter to confirm Note that the Inline option is automatically selected Implementation f Inline recommended Allows complex parameters filters and multiple outputs C Standard function Allows recursive calls 2 Click the Insert output icon in the icon bar and enter a name e g CompletePO Create Output Gg xX Mame CompletePO Type C Simple tyoe integer string etc Datatype stririg id Structure Choose Foot Choose Cancel 3 Click the Complex type radio button then click the Choose button This opens the Insert Inout Parameter dialog box The top list box displays the existing components in the mapping in this example three schemas Note that this list contains all
143. store gt Root gt F Rows p e E Repeated split A Field if L Store gt sat Field Field l i Field4 L Please note The field1 item in the target text file will contain all 3 fragments supplied by the Store item when you click the Output tab to preview the result Type Allows you to define the datatype of the text fragments Trim side Defines the side from which the characters will be trimmed left right or both Selecting Yes activates the Trim character set option Trim character set Defines the characters you want to trim from this text fragment You can enter any number of Altova MapForce User Manual 2006 Altova GmbH FlexText FlexText Reference 297 characters here by double clicking in the field The characters you enter are removed from the Trim side s of the fragment 2006 Altova GmbH Altova MapForce User Manual Chapter 20 MapForce and EDI 300 MapForce and EDI 20 MapForce and EDI MapForce currently supports the Electronic Data Interchange formats UN EDIFACT and ANSI X12 and allows you map data to and from these EDI documents Please note that you need to select one of the programming languages Java C or C as the mapping output to be able to work with EDI files This bi directional mapping support includes e EDI to from XML Schema e EDI to from flat file formats e EDI to from Databases UN EDIFACT is a de facto financ
144. sum nodes Altova MapForce User Manual 2006 Altova GmbH Adding custom XSLT 1 0 functions 235 To add a custom XSLT function 1 Create an XSLT file that achieves the transformation result you want The example below Name splitter xsIt shows a named template called tokenize with a single parameter string What the template does is work through an input string and separate capitalized characters with a space for each occurrence exs stylesheet version 1 0 xmins xal httg ww vv org 99S SL Transform lt xshoutput method xml version 1 0 encoding UTF 8 indent yes gt xeltemplate match gt lt xehfor each select gt xsl call template name tokenize sexs ywith param names string select i gt lt fxst call template est for each lt fcshtemplate gt xSTemplate name tokenize gt eysi param name string select f exel variable name caps select translatel string abcdetghiikimnopaqrstu aacel variable name capscount select string length capsy gt exelvariable name token 2 Click the Add Libraries button and then click the Add button in the following dialog box Libraries 555555 lx COTE HE xslt L3 xpath functions lang result langi strin last result last local name result local ram name result namel rno namespace u result namespar position result position 3 xslt Functions curent result currenti document result
145. support for Schema simpleTypes as classes for each of the supported programming languages The integration of these Schema simpleTypes in your library will be explained later in this document Function Descriptions Functions are accompanied by short and long descriptions in the library window The short description is always shown to the right of the function name while the long description is Altova MapForce User Manual 2006 Altova GmbH Adding custom libraries Defining the component user interface 227 displayed as a ToolTip when you place the mouse cursor over the short description Short description EE helloworld hella result hellolgreeting_type Long description EE helloworld helo Returne a greeting sentence according to the given greeting type EO O MOOO 2006 Altova GmbH Altova MapForce User Manual 228 Adding custom libraries Function implementation details 11 3 Function implementation details We are now at the point where we need to make a connection between the function in the library window and the function in the Java C or C classes This is achieved with the lt implementation gt element As previously stated one function may have multiple implementation elements one for each supported programming languages lt component name hello gt lt implementations gt lt implementation language cs gt lt function name HelloFunction gt lt implementatio
146. tables active Parenttable Department J o oo o Table action Update if compare PrimaryKey Delete data in child tables A J ooo Ignore input child data J child table Person fT Table action Delete if compare PrimaryKey S o Delete data in child tables J ooo o O Ignore input chid data EP e Updates parent table data Department records e Deletes child data Person records from all Departments because the Delete data in child tables option is active All Person records are deleted for each Department which has a corresponding PrimaryKey in the source XML l e even Person records of the database which have no counterpart in the source XML are deleted Retains existing database tables Engineering in this case which do not have a counterpart in the input XML file no source keys for the Update if comparison e The child table data Person records are deleted before the Table action Delete if is executed no records are deleted Update if on parent table Delete if on child table Delete data in child tables deactivated Parent table Department ooo Table action Update if compare PrimaryKey Delete data in child tables O Delete data not active Ignore input child data Of Altova MapForce User Manual 2006 Altova GmbH MapForce and Databases Mapping XML data to databases 129 child table Person Tt Table action Delete if compare PrimaryKey Delete
147. the Java debug or run command to test the resulting mapping application But the project has not been assigned the JDT nature e Then the output target folder is the project folder and the code generation language defaults to the current setting in the MapForce Options To activate the Automatic Build process 1 Make sure that the menu option Project Build automatically is checked To temporarily deactivate automatic building of MapForce mapping code This is only available to Eclipse projects that have added the MapForce nature Right click the Eclipse project in the Navigator pane Select Properties from the context menu Click the Builders entry in the left pane of the project properties dialog Un check the MapForce builder check box in the right pane Modifications to any mapping files or MapForce project files in this Eclipse project will now no longer trigger automatic generation of mapping code eet E N Altova MapForce User Manual 2006 Altova GmbH MapForce plug in for Eclipse MapForce code generation 383 23 6 3 Adding MapForce nature to existing Eclipse Project Applying the MapForce Nature to Existing Projects Add the following text to the natures section of the project file in the Eclipse project e g in the c eclipse3 1 workspace MapForce folder lt nature gt com altova mapforceeclipseplugin MapForceNature lt nature gt lt natures gt lt naturetorg eclipse jdt core javanature lt nature
148. the MapForce Plug in e Download and install the MapForce edition you intend to use from the Download section of the Altova com website i e Enterprise Professional or Standard edition e Download and install the MapForce Plug in for Eclipse from the Download section of the Altova com website You will be prompted for the installation folder of Eclipse during the installation process Configuring an eclipse installation to use a previously installed MapForce plug in 1 Start Eclipse and select the menu option Help Software Updates Manage Configuration 2 Select the menu option File Add an extension location and browse to the installation folder of your MapForce Eclipse plug in e g C Program Files Altova MapForce2006 eclipse Follow the instructions to access a previously installed plug in Clicking a plug in or folder icon displays various installation options in the right hand pane g Product Configuration EO Ioj x File ale 2 ae a Eclipse SDK A cleclipses1 a i Eclipse Poe aE Lha MapForce 2006 Enterprise Professional Home Edition Ele coProgram Files 4ltova MapForcez006 eclipse Editions for Eclipse 3 0 3 1 Version 1 0 0 More info a MapForce Plugin 1 0 0 MapForce Plugin 1 0 0 Available Tasks Disable You can enable or disable the Functionality of a feature The Feature is not removed by this action Show Properties View properties of the Feature such as version provider name license
149. the bool value of detailed is true or false you will always have the contents of First in the target schema XSLT currently takes all string input as True so this method cannot be used to directly check a boolean value Clicking the Insert Condition icon inserts the IF Else condition function E mf ExpReport E ExpReport T arget A expense report detailed k i ze i iam if Le snees CUITeEnc a T l E 1 Person i bool I ig i rely i First Ei a Last j l 4 Title To use boolean values as comparison values in XSLT 1 Supply a boolean value using the constant component e g true 2 Use the equal component to check if the value of the constant is equal to the content of the boolean node detailed 3 Pass the result of the comparison on to the bool parameter of the if else condition If the detailed element supplies true then the equal result parameter is also true E mf E pA eport Ca true E ExpR eport T arget gt a F expense report lee i gt ew detailled l 3 egual l i T currency pE Person 2 resulti ew First i i aswea 3 Last g it Title p fh i in F Phone pool resulti e If the bool value of if else is true then the value of First is passed on to the target schema e If false then the value of Last is passed on to the target schema Altova MapForce User Manual 2006 Altova GmbH MapForce How To
150. the mapping file from the Open dialog box Remove item Removes the currently selected item from the project tree 2006 Altova GmbH Altova MapForce User Manual 396 MapForce Reference Project Insert Web Service Allows you to insert a Web Service based on an existing WSDL file Open WSDL file in XMLSpy Opens the selected WSDL file highlighted in the Project window in XMLSpy Project properties Opens the Project properties dialog box Project Settings i E x Project Mame Guery Person database Project Directory C Program Files 4ltovast apForce 2006 SM apForcee Browse Output Settings Output Directory C Program Files 4ltovath apForce20064M apFoarceE x Browse Test Encoding Unicode LITF 2 Language Jaya Java Settings Base package name com mapforce Generate code in default language Generates project code in the currently selected default language Right click the project name in the Project window and select Project settings to define the default language Generate code in Generates project code in the language you select from the flyout menu Altova MapForce User Manual 2006 Altova GmbH MapForce Reference Component 397 24 5 Component Edit Constant Allows you to change the entry currently defined in the Constant component A Constant is obec L added by clicking the Insert Constant icon Align tree left Aligns all the items along
151. the menu item Help MapForce Table of Contents Altova MapForce User Manual 2006 Altova GmbH MapForce plug in for Eclipse 369 File Edit Navigate Search Project Insert Component Connection Function Output View Bun Window Help w le Qa e gt l FY mapForce i Java MapForce Tut ExpReport mfd Eclipse SDK ES core rmof E xp eport a conversion functions E expense report exp boolean result boolean detailed number result number CUITency string result string an E Person on First 7 oo Last Title 7 a Y Phone a3 logical functions equal result a equal b equal or qre result a gt b equal or les result a lt b Greater result a gt b 2 F Email less result az b Al expense item logical and result logical an logical not result logical na logical or result logical or Hot equal result logical na a Y Meal on mealtype 5 math functions PL fi Filker add result value i ceiling result ceilingl w Mapping ALT Output divide result value floor result floor vali modulus result value rr multiply result value x rcl me rom ilk Al wel ut Add Libraries writable 2006 Altova GmbH Altova MapForce User Manual 370 MapForce plug in for Eclipse Installing MapForce plugin 23 1 Installing MapForce plugin Installing the MapForce Plug in for Eclipse To install
152. the necessary items as show in the screenshot below Libr aries _ E Customers E CompletePO SA Name splitter JE Customers i EIE O CompletePO E Customer E Customer EE xslt Number Number FirstName ie FirstName H Y LastName 2 LastName 4 Address gt 4 Address Street 2 Street tokenize resul tokerize string ei xpath functions lang result langi string last result last local name result local narne node name result namel node namespace u result namespace uril r a position result position i F i State E Lineltems a xslt functions E Lineltem 6 Click the XSLT tab to see the generated XSLT code Altova MapForce User Manual 2006 Altova GmbH Adding custom XSLT 1 0 functions 237 L gt xsl stylesheet version 1 0 xmins sl htth Savy w3 org S9SSL Transform simlns xsi http lt xshoutput method xml encading LITF 8 gt exshinclude href C Program Files AtovaiMAPPORCEZO04 MapForceeExamples Mame spliter xsi lt xeltemplate match lustomers CompletePo gt i of exehattribute name xsinoNamespaceSchemaLocation C PROGRA 1 AttovaMAPPORCEZO0 l axal for each Select Customer gt fo eCustomer l axal for each select Mumber i sMumber e xsh value of select fod svNumber efxst for each i exetfor each select FirstName l x variable name V4 993024 47986944 select f gt sxshvariable n
153. the string Travel in the input field Mileage i m Parking BO Ententoinnent Ere HE 7 Misc E description 2 Insert the logical function equal from the core library logical functions group 3 Connect the expense item type item in the source schema to the a parameter of the equal function El expense item on SS hype i PE explo g i Meal er mealtype kog Ler i J J aee L j k j TF ii a i L ho 7 oni Location T H Lodging E Travel ow E means 7 aie Tra cost Destination Mileage Parking a Y Entertainment HE Misc Ler 1 T a r el i Lt re J L 1 foment L EL T prg hh Travel ip a it J J J it iw J LER Li 4 Connect the result icon of the constant component to the b parameter of the equal function 2006 Altova GmbH Altova MapForce User Manual 42 MapForce tutorial Filtering data a Travel e SS means 7 sie Trav cost 4 Destination Mileage E Y Parking E Entertainment 1 Misc a i Meal zasaini mealtype a sre Location ac T Lodging a Travel ow means 7 oe Tra cost 4 Destination Mileage E Y Parking E Entertainment 1 Misc i 5 i it ne iJ I ea ff filter noderow on truebr on falzel Lt it J L kog io al al bl i it ra J Lr ee T a S
154. title E Shortlnfo l 44 MainSection Description of the applicatior IAE Shortinfo l m amp author Author of the describing text l El Info gt L i a Trademark l Title i Keyword E Y Description j ii A SubSection Further description scion pie Bold gt author Suthor of the describing test eR Italic 5 sii Trademark e oo Keyword E SubSection Further description sectior Mapping result e The mixed content text of each description has been mapped correctly the text as well as the bold and italic tag content have been mapped as they appear in the XML source file 2006 Altova GmbH Altova MapForce User Manual 76 Source driven mixed content mapping Mixed content example xml version 1 0 encoding LITF 8 7 gt lt Shortinto xmins xsi http wavy sas org 2001 AML Schema instance et nohamespaceschemaLocation CUPROGRAW1 AltovadMapF orce2005 MapForceExamplesShortinta xsd gt lt Inta gt lt Title gt xMLSpy Title gt Description Attova Bold xMLopy Bold 2005 Enterprise Edition is the industry standard sitalic AMLeMtalic development environment for modeling editing debugging and transtorming all lt Italic xML talic technologies then automatically generating runtime code in muttiple programming languages lt Description lt nto Altova MapForce User Manual 2006 Altova GmbH Source driven mixed content mapping Sou
155. to XML Schema mapping cae 1 ee 7 2 Order F6063 ph es gt E Header i F060 i dateti Number on SS FBATT p TS _ Received ac PCD 8 Y Customer ALI i Number E DTH F i ae ee Y Contact ame HE MOA i sene CompanyName E C GEI gt HA Address 2 E GIN 2 2 Street E GIR im JAYR i i ac 7 DOC i Skate lt PAI P gt 2 Lineltems A MTD H Lineltem HE FTX r gt E Article ac 5629 a Number 4 5G30 l E 5G32 gt E 3 SinglePrice IM PRI gt a Amount 15 cs09 gt 4 Price i L F5125 o fi multiply multiply ee e eeer an iii b F5118 fi 2 one result ae eyalue BOTA EF fii divide a result oI I ST ee ee a ee e a it it i i ot it at BOCA 0533 et C243 PE L P5279 pb cine n F1131 F3055 en gt on EEFRDB Clicking the output tab performs an on the fly transformation and presents you with the XML document result Altova MapForce User Manual 2006 Altova GmbH MapForce and EDI UN EDIFACT to XML Schema mapping 311 zramm version 1 0 encoding UTF 3 H lt Cirder xmins xsi htp Aha ws org 00T AML Schema instance Header i e Number 4A5C1 234564 Z lt humber Received 2004 04 3071 7 42 00 09 00 Received Header sustomer i Mumber 4 23 lt Mumber l ontact Name Michele Butlers ontactMHamne CompanyNam
156. to add a new condition to the Switch container 2 Double click in the Content starts with field enter Initializ and hit Return Output For the first triggered condition 1 sgj 114 D EP ae 005 1 22 17 PM arg wa A new container is added Data will be forwarded to this container if the condition is true If not the data is forwarded to the default container 3 Click the Content starts with combo box and change it to Content contains The first condition has now been defined and you can see the result below The first fragment does not contain Initializ and its contents are therefore forwarded to the default container 2006 Altova GmbH Altova MapForce User Manual 284 FlexText FlexText Reference Switch Output For the first triggered condition ljug 2 2005 Lie 1d 14 D lug 22 2005 1 22 17 PH org a Content contains Initializ TJINFO Initializing C 24lAugq 22 2005 1 22 17 l Output For the first triggered condition id 214 D TINFO Initializing Coyote HTT 2j4ugq 22 2005 Llit2ze il PM org a default The Initializing fragment now appears in its associated container and the default container is empty Stepping through the fragments gives you a preview of what the individual containers hold 5 Click the container icon button and select Store as value i 6 Double click in the Store title bar and change the text e g Initialize Type sting Trim No default
157. to consider the following main design factors e What technology or programming language can the hosting application use to integrate the MapForceControl e Should the integrated Ul look exactly like MapForce with all its menus toolbars and windows or will a subset of these elements like allowing only one document and a restricted set of commands be more effective e How deep will the integration be Should the MapForce user interface be used as is Are user interface extensions and or restrictions required Can some frequently used tasks be automated The sections Integration at the Application Level and Integration at Document Level both of which have examples in various programming languages will help you to make the right decisions quickly The section Object Reference describes all COM objects that can be used for integration together with their properties and methods For automation tasks the MapForce Automation Interface is accessible from the MapForceControl as well Altova MapForce User Manual 2006 Altova GmbH MapForceControl Integration at the Application Level 525 27 1 Integration at the Application Level Integration at application level is simple and straightforward It allows you to embed the complete interface of MapForce into a window of your application Since you get the whole user interface of MapForce you get all menus toolbars the status bar document windows and helper windows Customizat
158. to perform You shall use reasonable efforts to cooperate in diagnosis or study of errors Altova may include error corrections in Altova MapForce User Manual 2006 Altova GmbH Appendices License Information 611 maintenance releases updates or new major releases of the Software Altova is not obligated to fix errors that are immaterial Immaterial errors are those that do not significantly impact use of the Software Whether or not you have purchased the Support amp Maintenance Package technical support only covers issues or questions resulting directly out of the operation of the Software and Altova will not provide you with generic consultation assistance or advice under any circumstances Updating Software may require the updating of software not covered by this Software License Agreement before installation Updates of the operating system and application software not specifically covered by this Software License Agreement are your responsibility and will not be provided by Altova under this Software License Agreement Altova s obligations under this Section 6 are contingent upon your proper use of the Software and your compliance with the terms and conditions of this Software License Agreement at all times Altova shall be under no obligation to provide the above technical support if in Altova s opinion the Software has failed due to the following conditions 1 damage caused by the relocation of the software to another loca
159. transaction SAVEPOINT ROLLBACK TO SAVEPOINT MF set save point MF rollback to save point 2006 Altova GmbH Altova MapForce User Manual 148 MapForce and Databases Database feature matrix Altova MapForce User Manual 2006 Altova GmbH MapForce and Databases Database feature matrix 149 7 5 4 Database info MySQL own authentication Trusted authentication special issues Connection MF used init Statements MF used final Statements support for DB schemas identity Support MF read back identity value sub select support JOIN support a DB object name qualification MF upper function SQL exec multiple stat in one command separator special error handling S retrieve parameter types special issues when using SQL Execution Transactions Flat transactions supported Start flat transaction via execution of SQL command Nested transactions supported MF begin transaction MF commit transaction MF rollback transaction MF set save point ee set transaction isolation supported Notes y y n TYPE INNODB _ for tables when relations transactions are used n not supported by MapForce y y z via ODBC none none a nao not supported by MapForce y y IDENTITY special implementation for DELETE necessary y with limits MySQL does not produce an error and continues if no nested transactions exist a 20
160. travel report Selectively filter the source data and only let the travel expense records through Generate an XSLT transformation file Transform the personal expense report to the company expense report using the generated XSLT file e Assign an StyleVision Power Stylesheet to the resulting XML file enabling you to view and edit the resulting file in the Authentic View The tutorial makes use of the following components e source and multiple target schemas e an MS Access database as the data source e several functions including concat filter equal and constants Files used in the tutorial All the files used in this tutorial are available in the MapForceExamples Tutorial folder The XSLT and transformed XML files are also supplied Tutorial files Personal expense report Tut ExpReport mfd The expense report mapping single target Tut ExpReport multi mf The multi schema target expense report mapping PersonDB mfd The employee mapping using an MS Access DB as the data source mf ExpReport xml Personal expense report XML instance document mf ExpReport xsd Associated schema file mf ExpReport sps styleVision Power Stylesheet used to view the personal expense report in Authentic View of XMLSpy or Authentic Desktop Company expense report ExpReport Target xml Company expense report XML instance document ExpReport Target xsd Associated schema file ExpReport Target sps StyleVision Power Stylesheet used to view the Company expense
161. type checking of the respective fields is automatically performed If the inout data and the field format defined here to do not agree then the data is highlighted in red E g changing field2 from string to integer would make all surnames of that column appear in red Please note The field types that one can select for a specific column are based on the default XML schema datatypes E g The Date type is in the form YYYY MM DD bJ Component Settings 1 x Input Output File fram Files ValtovaM apForce2 005M apForceE samples T utorahAlora_ cev cew Input file Output file Cancel Input file encoding f itthe endian byte order lu code UTF 8 a stoi Big endian byte order CoV Settings Field delimiter Text enclosed in iP coy C Tab Semicolon Comma Space C Custom C Not f fe ES Fired P Ritst row contains held names Field3 Field4 Fields string string string Sh Wucallabyienanonull com Office Manager 47 tuthernanonul com Accounts Receivabl J63 Limatizeminanonullcom Accounting Manage B21 firstbreacdinanonull com Marketing Manager E SUZ Po s sannacnanonull cam Art Director a i i 4 Append Field Insert Field B Input file Select the CSV file you want to use as the source file for this component move Field EE re Ze Please note This field can remain empty if you are using the Text file component as a target for another t
162. unbounded gt Previewing the new field in MapForce 1 Select the menu option Insert EDI or click the Insert EDI ne Icon 2 Click the X12 Nanonull tab and select the 850 Purchase Order transaction 3 Click the Cancel button to skip the selection of the source EDI file for the moment The 850 component is now visible in the mapping window 4 Navigate to Envelope Interchange Group Message LoopN1 N2 to see the new X1000 element ac 3 TXI Tax Information LoopLDT m LoopAMT 4 LoopN9 10 LoopN1 HCN Party Identification PE 2 N2 Additional Name Information FOS Name PES ry f T a E HC IN2 Individual Name Structure Compete ii HEINI Party Location 3 2006 Altova GmbH Altova MapForce User Manual 344 MapForce and EDI Customizing an ANSI X12 transaction 20 6 6 Customized X12 mapping example The mapping visible in the images below Orders Custom X12 mfd is available in the MapForceExamples Tutorial directory The example maps the Orders Custom x12 file to the Order X12 schema The field that has been added to the EDI structure X1000 has been mapped to the Salutation item 1 Create a new folder under the MapforceEDI directory and name it e g X12 Nanonull 2 Unzip the supplied X12 Nanonull zip file from the Tutorial folder into the new folder 3 Open the Orders Custom X12 mfd file C 2004 04 30T
163. version 1 0 encoding UTF 0 7 gt 4 ltova xmins xsi htp ien wa orgi 00 AML Schema instance sQffice Name gt NManonull Inc lt hame lt Name Nanonull Partners Inc Mame sfOttice gt lt JAltova 1 z E 4 5 z T a The next bit of information we want to extract are the department names of each office e Compare the Department foreign key with the Office primary key If both keys are the same then e Pass on the contents of the Department name to the node row parameter of the filter component and e Place the on true result in the Department Name item in the target schema document 2006 Altova GmbH Altova MapForce User Manual 156 MapForce and Databases Using MapForce to create database relationships E altova no relation E Altova_Hierarchical fa fiter bnoderow or truel Altova E Department eee PrimarypKey oo Fy ForeignKey F Phone ol Address Primar 7 a Foreig erd ia ai a ify Filter Prode row on truel cou i state on falzel a be F street on P zip E Y Departm on Primar as se D i i ee LER it J J ene re eeu J Jt it J jes The result of the above mapping is shown below e Both office and department names are displayed The order of their occurrence is currently determined by the structure of the target schema document lt xml version 1 0 encoding LITF 38 7 Altova mins sis htth hewn vv org
164. which non travel expense records will be placed and follows on from the current tutorial example Tut ExpReport mfd Creating the second target schema component 1 Click the Insert XML Schema File icon 2 Select the ExpReport Target xsd file from the Open dialog box You are now prompted for a sample XML file for this schema 3 Click No and select Company as the root element of the target document The target schema component now appears in the Mapping tab 4 Click the Company entry and hit the key on the numeric keypad to view all the items 5 Click the expand window icon and resize the component Place the schema components so that you can view and work on them easily There is now one source schema mf expReport and two target schemas both ExpReport Target visible in the Mapping tab E a eport T arget Preview fy ExpReport T arget gt F Company Fi I a 4 Employee Y Title concal uel pl lt Title We E resulti Name Wes El _ di oe Tel a 3 Email DomesticD ailyRate ForeignD ailyR ate H Expense detail i expense item Currency Laie as Te D i i i a i BE te ea J LER J i al al i J L koa _ 1 Oexpense ow Curren 7 Bill to io Date ld Travel sai eal io al og Travel Travel Cost Ry B J TJ J L sl Destination i EET on truel on talzely Filtering out the non travel data 1 Conne
165. xsd version 2 library helloworld gt lt implementations gt lt implementation language cs gt lt setting name namespace value HelloWorldLibrary gt lt setting name class value Greetings gt lt setting name reference value C HelloWorldLibrary HelloWorldLibrary dll gt lt implementation gt lt implementations gt lt group name SsString functions gt lt component name hello gt lt sources gt lt datapoint name greeting_type datatype boolean gt lt sources gt lt Cargqgets lt datapoint name result datatype string gt lt targets gt lt implementations gt lt implementation language cs gt lt function name HelloFunction gt lt implementation gt lt implementations gt lt description gt lt short gt result hello greeting_type lt short gt lt long gt Returns a greeting sentence according to the given greeting_type lt long gt lt description gt lt component gt lt Groups lt mapping gt The image below shows the appearance of the mff file in MapForce The new library helloworld appears as a library entry sorted alphabetically containing the hello string function Altova MapForce User Manual 2006 Altova GmbH Adding custom libraries 223 Libraries Eel Core logical functions math functions string functions edifact helloworld hello result hello greetin EE lang datetime functions generator functions logical fu
166. you having to generate or compile program code We would recommend that you use this option until you are satisfied with the results and then generate program code once you are done The generated program code will have a much faster execution speed To save the generated XSLT code 1 Select the menu option File Generate code in XSLT 1 0 or XSLT 2 0 2 Browse for the folder where you want to save the XSLT file 3 A message appears when the generation was successful 4 Navigate to the previously defined folder where you will find the generated XSLT file To save the XML or output data from the Output tab 1 Click the Output tab to preview the mapping result 2 Click the Save generated output icon a and specify where you want the result to be saved If the target is an XML Schema file e The Save generated output icon is active Click it to save the output If the target is a Database e The Run SQL script icon is active Click it to update insert or delete the database data To transform an XML Schema file using the generated XSLT 1 Open the XML file in the editor of your choice KMLSpy for example 2 Assign the XSLT file to the XML file XSL XQuery Assign XSL 3 Start the transformation process XSL XQuery XSL Transformation The transformed XML document appears in your editor To generate program code 1 Select the specific menu option File Generate code in XSLT XSLT2 XQuery Java C C 2 Br
167. you want to import or have access to Select All Click the Insert Now button at the bottom of the dialog box The database component now appears in the Mapping window 2006 Altova GmbH Altova MapForce User Manual 14 MapForce overview MapForce components r AE Address py PrimarypKey m ForeignKey m maea r A kan ho k HE Altova Department Office ie Person E Schema component context menu Right clicking a schema component in the Mapping window opens the context menu Align Tree Left Align Tree Right Show Types Show Annotations Duplicate Input Remove Duplicate Database Table Actions Database Key Settings Ctrl s Ctrl C Ctrl Delete Change Root Element Edit Schema definition in MLopy Component Settings Align tree left Aligns all the items along the left hand window border This display is useful when creating mappings from the source schema Align tree right Aligns all the items along the right hand window border This display is useful when creating mappings to the target schema Show types Altova MapForce User Manual 2006 Altova GmbH MapForce overview MapForce components 15 Displays the schema data type of all the schema items Show annotations Shows schema annotations as well as EDI info Duplicate input Inserts a copy clone of the selected item allowing you to map multiple input data to this item Duplica
168. your computer please generate and compile Java code without user defined functions you will then find the classes in the directory you specified Add the functions you specified in the mff file as public static Do not forget that you may only use the Schema simpleTypes as input output parameters package com hello functions import com altova types public class Hello public static SchemaString HelloFunction SchemaBoolean GreetingType if GreetingType getValue return new SchemaString Hello World return new SchemaString Hello User Compile the Java file to a class file and add this to your Classpath You have now finished creating your custom library How to write a C library 1 2 5 Open a new Project and create a class library Go to add reference and add the Altova dll If you encounter problems finding Altova dll on your computer please generate and compile the C code without user defined functions you will then find the DLL in the directory you specified Add the using Altova Types line The class name should be the same as you specified here Greetings lt implementation language cs gt lt setting name namespace value HelloWorldLibrary gt lt setting name class value Greetings gt lt setting name reference value C HelloWorldLibrary HelloworLldLibrary dli gt lt implementation gt Add the namespace using the same value as you specified in the impl
169. zero or more Output messages e zero or more Fault messages In MapForce each operation is a separate mapping within a mapping i e an mfd file The collection of operations are grouped into a MapForce WSDL project file which describes the complete webservice Please note e Input messages can only be used as Source components e Output and Fault messages can only be used as target components WSDL support version 1 1 W3C Note from http Awww ws org TR wsdl WSDL type system XML Schema 2001 SOAP support version 1 1 W3C Note from http www ws org TR 2000 NOTE SOAP 20000508 Protocols SOAP over HTTP HTTP POST HTTP GET protocols are not supported C The SOAPAction must be different for each operation in C Bindings multiple operations with same name are currently not supported WSDL 2 5 2006 Altova GmbH Altova MapForce User Manual 348 MapForce and Webservices WSDL info supported protocols style use SOAP headers SOAP encodingStyle SOAP SOAP encoding SOAP ENC Array Custom SOAP enhancements Default or fixed values in schemas Non SOAP message validation Namespaces document literal supported RPC literal supported in C RPC encoded limited support One style use per webservice Java or operation C is currently Supported Depends on underlying platform If use encoded encoding style http schemas xmlsoap org soap encoding for complete soap Body is
170. 0 5 10000 Gas Chromatograph hh e Creates two fragments defined by separator characters that you enter in the Separator field e The separator characters are not included in the fragment The first fragment is defined as the text between the first character of the file fragment up to the last character before the separator e The second fragment is defined as the first character after the separator up to the Altova MapForce User Manual 2006 Altova GmbH FlexText FlexText Reference 281 last character in the file fragment e lf the separator appears in the first last position of the file fragment then the top container remains empty Use this method when you want to split off one section of a file or fragment where the separator is anywhere in the file fragment This is generally useful in files that do not contain CR or LF characters and you want to split the fragment into two at some specific in line location The top fragment contains the text up to the separator i e 400 1 111 332 1 22537 7 5 Container ship Mega 2 111 81579227 10 3 The bottom fragment contains the remaining characters after the separator iMicrotome hp 2 111 5152427 7 6 1200 Miscellaneous BE 3 222 976 4 7563 1 69 4ir freight Mini BP 222 624 4N561 10 5 10000 cas Chromatograph MODE Delimited line based Default settings are Separator none Split base head Mode delimited line based
171. 006 Altova GmbH Altova MapForce User Manual 110 MapForce and Databases Mapping XML data to databases 7 3 Mapping XML data to databases MapForce allows you to not only map database data to XML documents but you can do the reverse as well map XML data to databases and even create mappings between databases MapForce takes primary and foreign key constraints into account and also generates transaction data which ensure data integrity Database functions table actions currently supported by MapForce e Insert e Update e Delete e Database key field handling Examples for each of these table actions follow and are of a simple nature to get you acquainted with how to achieve the specific goals Currently supported databases and connection types are Microsoft Access ADO Microsoft SQL Server ADO Oracle OCI MySQL ODBC Sybase ODBC IBM DB2 ODBC Any ADO compliant database e Any ODBC compliant database Files used in this section Altova_Hierarchical xsd the hierarchical schema file containing identity constraints Altova cmpy xml the Altova company data file which supplies the XML data Altova mdb the Altova MS Access database file which functions as the target database All these example files are available in the MapForceExamples folder Please note This section makes heavy use of the Altova mdb database to show the database as target functionality of MapForce Make sure you backup the fi
172. 01 Invalid address for the return parameter was specified Parent Property Parent aS Application read only Description Retrieves the application s top level object Errors 1600 The object is no longer valid 1601 Invalid address for the return parameter was specified Count Property Count as Integer read only Description Retrieves the number of documents in the collection Errors 1600 The object is no longer valid 1601 Invalid address for the return parameter was specified Item Property Item nIndex as Integer as Document read only Description Altova MapForce User Manual 2006 Altova GmbH The MapForce API Object Reference 489 Retrieves the document at nIndex from the collection Indices start with 1 Errors 1600 The object is no longer valid 1601 Invalid address for the return parameter was specified NewDocument Method NewDocument as Document Description Creates a new document adds it to the end of the collection and makes it the active document Errors 1600 The object is no longer valid 1601 Invalid address for the return parameter was specified OpenDocument Method OpenDocument strFilePath as String as Document Description Opens an existing mapping document mfd Adds the newly opened document to the end of the collection and makes it the active document Errors 1600 The object is no longer valid 1601 Invalid address for the return parameter was specifi
173. 06 Altova GmbH Altova MapForce User Manual 150 MapForce and Databases Database feature matrix MF rollback to save point ROLLBACK TO MF used init Statements SET AUTOCOMMIT 0 Altova MapForce User Manual 2006 Altova GmbH MapForce and Databases Database feature matrix 151 7 5 5 Database info Sybase supported Notes Sybase DB engine as service own authentication Trusted authentication Connection not supported by MapForce y y n n y ODBC connection string issues Select must be applied Method Cursor y via ODBC MF used init Statements none MF used final Statements none DB object name qualification support for DB schemas identity support MF read back identity value IDENTITY sub select support y y UPPER JOIN support MF upper function of O UW oJ m O O J y y E SQL Execution exec multiple stat in one y retrieve parameter types special issues when using only ASCII 127 characters are allowed in string constants when using ODBC Flat transactions supported Start flat transaction via execution of SQL command not supported by MAPFORCE Nested transactions supported Sybase does not produce an error continues if no nested transactions exist set transaction isolation API call API call MF begin transaction MF commit transaction 2006 Altova GmbH Altova MapForce User Manual 152 MapForce and Databases Data
174. 1 742 00 celia fH Crder ED E 4 Order rl a pi sinha a Header 2 Gi Na o 3 gt Number a ii aT on Received J P E Customer a N Number E ines OEP i ContactName 2 E arty ceryhcauor g Lo CY Salutation Pp GG bee m FOBT Entity Identifier Code e PPE EG ie CompanyName PG be F93 Name i ijj a e a E Address PG bee F66 Identification Code Qualities Pi eo oe Street an h SS FBP Identification Code smn F706 Entity Relationship Code gt fi bee E F9B_2 Entity Identifier Code e PE MQ N2 Additional Name Information gt FOS Name Ln M kani LER Li ko State E Lineltems E 7 Lineltem E 7 Article r koa nL lt xml version 1 0 encoding UITF 3 7 j Order xmins xsi htp Shay ws org 2001 AML Schema instance xsi noMamespace sHeader o eMumbers4BC1 234564 Z Number Received 2004 04 3071 7 42 00 Received s Header Customer ec Mumber 1 23 lt Mumber Contacthame Michelle Butler Contactame gt Salutation Mrs Salutation lt CompanyMame Nanonull Inc CompanyName eAddress eStreet 119 Cakstreet Suite 487 6 Street PoP aCityeverenos City gt P 2971 3 2 P i of State gt CA States stddress gt Altova MapForce User Manual 2006 Altova GmbH Chapter 21 MapForce and Webservices 346 MapForce and Webservices 21 MapForce and Webservi
175. 1000Type is generated which is accessible from the CC056Type class 2006 Altova GmbH Altova MapForce User Manual 336 MapForce and EDI Customizing an ANSI X12 transaction 20 6 Customizing an ANSI X12 transaction MapForce allows you to customize X12 transactions to take different nonstandard or changed X12 formats into account This example uses the Orders Custom X12 mfd file available in the MapForceExamples Tutorial folder Please note that a ZIP file X12 Nanonull zip is also included in the Tutorial folder The ZIP file contains the files final result of the customization procedure The X12 source file available in the Tutorial folder Orders Custom X12 has been changed to include a new field in the N2 segment e Line 6 contains an additional Mrs entry TSA 00 00 teeatSenderID teatReceiverIt GStPo SenderiID BheceiverlID Z0060s0e 1lsz347 1 0Nt osolle ST 850 1z345 BEGCT OOt SA S BCL 234564 72 4 200490430 Wltl NWanonull Inc tle 3 WetHichelle ButlerttHrs Wstll3 Oakstreet Suite 4876 WatVerenotCateoel3 POL l 2 POStL 4 7 2 4 14 05 PID Ll Pizza Pepperoni THIt L 9 AMT 1 720 F l tt t 13 2 POStL 6 6t 05 l ral 3 4 5 5 7 z Please note Customization information for EDIFACT and ANSI X12 is supplied by two structurally equivalent files that allow the use of multiple consecutive elements of the same name in each of the EDI formats ED
176. 20 5 1 EDIFACT customization set up The text in the following sections describes how to customize the configuration files to be able to map the changed EDIFACT message to the ORDER EDI xsd schema It assumes that the supplied ZIP file is not used Setting up the customizing example e Create an EDIFACT Nanonull folder e copy the following files from the MapForceEDI EDIFACT folder into the EDIFACT Nanonull folder Admin Segment EDI Collection EDSD Segment Orders config UNCL Codelist e Change the attributes of the files marked with an asterisk to read write to make them editable Configuring the EDI Collection file 1 Open EDI Collection file in XMLSpy or in you preferred editor 2 Remove all Message elements except for the ORDERS message Make sure you retain the lt Messages gt tags however 2Txuml wersion 1_ 0 encoding UTF 8 7 Fl Messages xmlns xSi http J fw ws arg Z2001 RMLSchema instance VYersion 2 gt a lt Meta gt VWersion D VYersion gt Pelease gt O04B Releases sAgency UN r Agency lt r Heta Message Type 0P DEES File 0PDERS Config Description Purchase order message gt Messaqges gt 3 Save the file To see the content of the collection file 1 Start MapForce select Insert EDI or click the Insert EDI icon The Browse EDI collections dialog box opens displaying a new tab named EDIFACT Nanonull Only one entry is visible the first column shows the me
177. 2001 XML Schema instance sOffices lt Mame Nanonull nesame lt Mame Hanonull Partners Inc Mame gt lt Department lt Name gt Administration Mame Po lt Mame Marketing Mame gt lt Mame Engineering ame fof sMameslT amp amp Technical Support Mame gt lt Name Administration Mame Po lt Mame Marketing Mame gt eMame lT amp Technical Support Mame lt Department sflttice gt lt Altova od moh E Wha a It would of course be more useful to output each office with its respective departments e To achieve this create a mapping between the Office items Deactivate the Auto complete child items function by clicking the icon before doing this if it is active Altova MapForce User Manual 2006 Altova GmbH MapForce and Databases Using MapForce to create database relationships 157 LS gE Altova ee E resul l Pnode row on trueth T ebool for falsel a fa equal Department gt m PrimaryKkey gt m ForeignKey a rezulti Office The mapping now defines e for each Office element output the office name and then all departments in that office zramm versian 1 0 encoding UTF 0 gt zAktova xmns xsi http Ma ww orai 200 AML Schema instance gt sQffice sName Nanonull Inc lt hame gt lt Department fo sName gt Administration Mame gt lt Name Marketing Mame lt Name Engineering Mame lt NameslT amp amp Technical Support
178. 3 gt lt PARAM name FileName value MapForceExamples MapForceExamples mfp gt lt OBJECT gt Create Placeholder for MapForce Helper Windows The HTML oBJEcT tag is used to instantiate a MapForceControlPlaceHolder ActiveX control that can host the different MapForce helper window Initially no helper window is shown lt OBJECT id objPlaceholderWindow Classid clsid FDEC3B04 05F2 427d 988C F03A85DE53C2 width 200 height 200 VIEWASTEXT gt lt PARAM name PlaceholderWindowID value 0 gt lt OBJECT gt Three buttons allow us to switch the actual window that will be shown The JavaScript execute on button click sets the property Pl1aceHolderWindowID to the corresponding value defined in MapForceControlPlaceholderWindow lt input type button value Library Window onclick BtnHelperWindow 0 gt lt input type button value Overview Window onclick BtnHelperWindow 1 gt lt input type button value Validation Window onclick BtnHelperWindow 2 gt lt SCRIPT ID Javahandlers LANGUAGE javascript gt a specify which of the helper windows shall be shown in the placeholder control function BtnHelperWindow i_ePlaceholderWindowID objPlaceholderWindow PlaceholderWindowID i_ePlaceholderWindowID lt SCRIPT gt Create a Custom Toolbar The custom toolbar consists of buttons with images of MapForce commands lt button id btnInsertXML title Insert XML Schema File onclick BtnDoCommand 13
179. 4 Field45 string string string 3 29 29 Please note e There is no Input file entry which means that this text component only receives data from the mapped source component e Field lengths have been defined to correspond to the field lengths in the data source Altova FLF e No data can be seen in the preview as the target component is not based on an existing text file e Clicking the Output tab displays the mapped data Check box Assume record delimiters present e if checked a new record is created after the sum of the defined field lengths i e in this case all fields add up to 71 characters a new record will be created for character 72 Yerno Calaby SDAY callabyminanonull com Office Managert EAEEREN Frankeetel urthereeaes ff turthereinanonull conti Accounts Recelvablesteete 1 2 3 Lobyttttiaticettet oe al matisemenanonull commits tAccoaunting Managertteetet 4 Joeteeter irsthread61 firsthreadmenananull comMarketing Manager Europe e if unchecked the mapped data appears as one long string including the defined fill characters VernonttCallabytetaoey callabyi nanonull comt Office Managerttetieteeeee rank Append field Insert field Remove field Allows you to append insert or remove fields in the preview window which defines the structure of the CSV file Next Previous Clicking one of these buttons moves the currently active column left or right in the preview window Altova MapForce
180. 6 78 lt Tel lt Email t landisinanonull com Email gt sexpense item Currency USD Bill to Sales 2 Dete 2003 01 02 lt Dates Date 2003 01 01 lt Date gt Date gt 2003 07 07 Date gt Dates 2003 02 02 Date gt 2 Dete 2003 03 03 lt Dates sfexpense item lt JEmployee gt flompany gt There are currently five items originating from the assigned XML instance file 2006 Altova GmbH Altova MapForce User Manual 40 MapForce tutorial Using functions to map data Please note Functions can be grouped into user defined functions components to maximize screen space Please see the section on User defined functions components for an example on how to combine the concat and constant functions into a single user defined function component Altova MapForce User Manual 2006 Altova GmbH MapForce tutorial Filtering data 41 3 4 Filtering data The aim of this section is to filter out the Lodging and Meal expenses and only pass on the Travel expenses to the target schema document This will be done by Using the Equal function to test the value of a source item Using a Constant function to supply the comparison string that is to be tested Using the Filter function which passes on the Travel data if the bool input value is true Placing the on true result of this process into the expense item element of the target schema document Filtering data 1 Insert a constant component and enter
181. 635 gt lt img src Images ID_INSERT_XSD gif width 16 height 16 gt lt bubtcon gt lt button id btninsertDB title Insert Database onclick BtnDoCommand 13590 gt lt img src Images ID_INSERT_DATABASE gif width 16 height 16 gt lt DULL On gt lt button id btninsertEDI title Insert EDI onclick BtnDoCommand 13591 gt lt img src Images ID_INSERT_EDI gif width 16 height 16 gt lt button gt On clicking one of these buttons the corresponding command Id is sent to the manager control lt SCRIPT ID Javahandlers LANGUAGE Jjavascript gt perform any command specified by cmdID command routing includes application active document and view function BtnDoCommand cmdID 2006 Altova GmbH Altova MapForce User Manual 544 MapForceControl Integration at Document Level objMapForceX Exec cmdID msgtext innerText Command cmdID performed lt SCRIPT gt Create More Buttons In the example we add some more buttons to show some automation code lt p gt lt input type button value New File onclick BtnNewFile objDocl gt lt input type button value Save File onclick BtnSaveFile objDocl gt lt input type text title Path id strPath width 150 gt lt input type button value Open MarketingExpenses onclick BtnOpenMEFile objDocl gt lt p gt lt p gt lt input type button id GeneratexSLT value Generat
182. 78 HighlightMyConnectionsReCursivey sccccccccccccccccccccccessssssssssssssssesesssssssseeeeees 479 TACT VI Eaa E ees cioteos EE AN tte cuadewe sev etd oor 479 Inser X MLS Chemia erga r E E 479 TN SCTIXIVL SCHEMGW 11S GIP e sew ivnrssanesebssadeintstevesnbsertisonssnuessbasadosntetetossinenn 479 PPI OIE arses sank erst cc aa he pees E Seven es aaa neds eee S 480 SOW TEC IPES EEE E E E E edapete caves anit T 480 ShowLibrarylnFunctionHeadeTf eeeseeeeseeeeseeeeeereserressressseerererssreesereesseeess 480 AS DO OE a E A E A 481 Eroi ce E E cates 481 OnDocamnon oode EE E N E IEN E EE T 481 OnIMiGdi fed hae Changed aaa 481 AE acatse ca can tts E esis sae oo seats ae cee 482 Appli cati oeron iora E E eee eased eee eee 482 COS a EA E E E E E ake oe 482 T NO a tansas os oeetara tea sor essen ieeottanss lessee aoraitansetesdetaeeteueis ess 482 Generatie Has hC OO E sevescvchedosestayectevscedessehuueaucentevanasteueaseiwsaconcsdaveniavpievescoeuess 482 GenerateCpp Code ei PEE ROUTE PEPE Pre irrinircesi ies inosirsiii ini rinnan riii intaia 483 GeneraleCodel Vai cncinscwsssaregaceiwasesneyeesiercsdceasieta ag ewes ouesaeieeaineeidneteeneees 483 GenerateJava COG 2 snscaicaauliciutsunnsaiieacmcaiaeescassieswiatotapnenste weabe worsen iicasietatensesiaes 483 Cener COG oss asa R soe scan sala sd naan E E E 484 General eN DUET IEEE en rr rer 484 CGn a S a E E E eigen 484 Generale X SLI arrere aE eia 484 HiehliehtSerializedMarke tcosatat cos tat avabescecausestete
183. C code generated by Document GenerateCppCode Errors 1400 The application object is no longer valid 1401 Invalid address for the return parameter was specified See also Code Generation CSharpSettings ProjectType Property cSharpSettings_ProjectType as ENUMProjectType Description Specifies the type of C project used by Document GenerateCHashCode Errors 1400 The application object is no longer valid 1401 Invalid address for the return parameter was specified See also Code Generation DefaultOutputEncoding Property DefaultOutputEncoding as Boolean Altova MapForce User Manual 2006 Altova GmbH The MapForce API Object Reference 497 Description File encoding used for output files Errors 1400 The application object is no longer valid 1401 Invalid address for the return parameter was specified See also Code Generation Parent Property Parent as Agplication read only Description The parent object according to the object model Errors 1400 The application object is no longer valid 1401 Invalid address for the return parameter was specified ShowLogoOnPrint Property ShowLogoOnPrint as Boolean Description Show or hide the MapForce logo on printed outputs Errors 1400 The application object is no longer valid 1401 Invalid address for the return parameter was specified ShowLogoOnStartup Property ShowLogoOnStartup as Boolean Description Show or hide the MapForce logo on app
184. CO on F306 aut Pe F3045 FOCOS ri F304 ii a F4164 OCHI i ee E F3229 ETES F113 LOC BOF 0863 BOR DTM OsGe4 EQ SG5 HEC CTA ow SFIS C056 Ta ee oa ibe El Order E Header 4 Number i Received 1 Customer ase 4 Number ais ContactName gt CompanyNamel gt 8 Address oo Street T kon Pa Soo r kaa ka ka ka State E 7 Lineltems E 4 Lineltem E Article om Number kon kon ken kon i Lt Lt Lt Lt Lt Lt Lt Lt Lt wt I 1 M Continue the mapping process and map SG28 SG28 LIN C212 F7140 SG28 IMD C273 F7008 SG28 QTY C186 F 6060 SG28 SG32 PRI C509 F5118 gt Order LineItems gt Order LineItemns LineItem Article Number gt Order LineItems LineItem Article Name gt Order LinelItems LinelItem Article Amount gt Order LineItems LineIten Article SinglePrice Altova MapForce User Manual 2006 Altova GmbH MapForce and EDI UN EDIFACT to XML Schema mapping 307 wm ORDERS S626 at 628 GOIN i ow FOB 7 ae F12 79 Oca o sn F140 TESE Fr143 Ei 3 oe F055 OCES ami FF1222 i FFOSS OPI GE OIMD es F7077 a oce72 me F708 7 S F1131 L F3055 00273 en FrO009 2 7 a F113 oo F4055 7 a F008 x FTOOR
185. Childless nodes so called leaf nodes contain data nodes having children structure data into logical groups Altova MapForce User Manual 2006 Altova GmbH MapForce and EDI UN EDIFACT and ANSI X12 as target components 313 Two properties are checked during validation of leaf nodes e whether the data string is less than or of equal length to that specified in the configuration file and e ifthe datatype is set to decimal i e whether the string contains data which can be interpreted as a decimal according to EDIFACT conventions Properties checked for parent nodes are e the child nodes that are to be expected specified by the configuration files and e the min and max occurrence of each child node Automatic data completion Automatic data completion does not generally change existing data It does however create specific mandatory nodes and inserts data where necessary after the mapping process to produce a valid document Please note that fields not listed in the Automatic data completion sections that follow are NOT inserted or created The correct values cannot be ascertained automatically Generic Settings several settings can be defined that are applicable to all EDI documents e Auto complete missing fields should auto completion be enabled or not Default true e Begin new line after each segment should a new line be appended to each segment for improved readability The EDI standard ignores the
186. Data Sources Program Files ttovaihiAPPORCELO04 MapF orceExamples VT ut SELECT IFIMAx Atoval Primarykey IS MULL 0 MAA Aktora FPrinaryk ey 0 AS Primarykey FROM Altova gt OK One or more rovs INSERT INTO Atova Name Primary Key VALUES Microtech OrgChart PrimaryKey 2 gt gt OK 1 roves Please note You can only run SQL scripts once from the Output window you have to switch back to the Mapping window and to the Output window again to re run the script Inserting tables and related child tables This example uses the previous example as a basis and extends it by inserting related Office child tables to the Altova parent table Table relationships are only generated automatically wnen mappings are created between child tables of a root table In this case mappings are created between the Office fields that appear directly under the Altova parent or root table 1 a INS Right click the Office entry and select the menu item Database Table Actions The Insert All table action is selected by default you do not have to make any changes here click OK to confirm Right click the Office PrimaryKey field and select the Database Key Settings entry Select the Maximum number entry and click OK to confirm Create the following mappings between the two components Office to Office Desc to Desc and Email to Email Established to Established and Name to Name Altova MapForce Use
187. Document Opened i_objDocument as Document Description This event is triggered when an existing or new document is opened The corresponding close event iS Document OnDocumentClosed OnProjectOpened Event onProjectOpened i_objProject aS Project Description This event is triggered when an existing or new project is loaded into the application The corresponding close event is Project OnProjectClosed ActiveDocument Property ActiveDocument as Document read only Description Returns the automation object of the currently active document This property returns the same aS Documents ActiveDocument Errors 1000 The application object is no longer valid 1001 Invalid address for the return parameter was specified ActiveProject Property ActiveProject as Project read only Description Returns the automation object of the currently active project Errors 1000 The application object is no longer valid 1001 Invalid address for the return parameter was specified Application Property Application as Agplication read only Description Retrieves the application s top level object Errors 1000 The application object is no longer valid 2006 Altova GmbH Altova MapForce User Manual 474 The MapForce API Object Reference 1001 Invalid address for the return parameter was specified Documents Property Documents as Documents read only Description Returns a collection of all currently open doc
188. E E EE 472 Te eee ree eee eee eee eet ere ee eee eee errr ae 473 nDocimentOpene deirinta eee etree ey eer ce ee 473 COMP rOjeCIO pened esacarccosnecesreusspenacevatearonesmeeeaarieansoeanpnecnatunesstasmmteeterrnemneens 473 PACT VED OCIA GIA serront anaE EE OES 473 FOTO C1 sacar E aaa ce canes a A E eee eens 473 ADPU CUT OSA E E A EA E E 473 Documeni S oecessree pease ns ween esse vc E cease Ea 474 HighliehtserializedMarkeT xcs sasncemesasnsseacastqacpsa aroa e EEN Eii 474 NAME gra EN EA E E E se vateatet ancsp E E E 474 IN CVO IDO CTIIUCTT acinicesscoisccowesiiesasneatatdcmeabateorswiddersGabecewseunicaes ccucanneonicesweatosteseaenee 474 NEWT FOC IER E E AE E NE E asian S 475 OPN DOU aE A E E E EEE E E E egeseeoeesgee ee 475 OPEN TO E A wun nen ae aes 475 Altova MapForce User Manual CIT e a scenes R E aang E ER T E AE T E A S 475 OD ONS e E A E E E E E reattonnnese 475 PO o E E Sewers E cee 476 PrO CC sata groeeg ss cncecsiteaase tes A oo eas anand ts ones eeensaneee 476 OC re E E 476 WTS e aE E A E elec case EE AEE 476 WO VGC AROE VEEE EAEN E ET E AO E 477 20 22 Map orce View cscsestsesxescstesacteisenzienstossassiessveancdeseasutanazsensersareiavensaasdeensactaees 478 AE e seis icons sauteseecaaaesneis oneianesuacersyaestesets ss eanaseeeeiae 478 ADP COG OIEA E E N satan nas E E E pac negoseoe ane nteaapaemeets 478 HighlightMy Connections ccccccccccccccssssscccceesssececesesssseeeeessseseeseessaseeeeeesaaes 4
189. E on Street 4 SG6 OSG gt i mO SGE on State it se10 gt 2 lt Lineltems it S12 gt G Lineltem i m 5G13 gt gt El Article iQ S15 Number 4 5G16 gt 7 it S618 SinglePrice 4 S619 gt gt Amount 0 S625 4 SG26 it S628 a kop kan LI J LI J LI poi icf a peal ka r mL kaa kaa a ET be E ut Lt Lt Lt Lt Li LJ Lt Li Le Lt Lt LJ Lt Lt Lt Li LJ Le Lt Li baad ies af banal kaa baal r ka kn kaa See Clicking the Output tab displays the mapping result shown below Altova MapForce User Manual 2006 Altova GmbH MapForce and EDI Customizing an EDIFACT message 335 lt Yxml version 1 0 encoding LITF a lt Order mins xsi http wy wa org 2001 AMLSchema instance xsinohamespace gt sHeader eNumbersABC123456 Y Z lt Mumber gt s Header lt Customer sNumber 92 Mumber lt Contacttame gt Ted Lithe Contacttame gt lt Salutation Mr lt Salutation lt CompanyMame 24h Pizzas company ame gt sAddress lt Street Long VWay lt Street i aCity San Francisco iCity gt ZlPe34424 lt 7IP gt io lt State CA lt State gt sAddress eflustomer gt CUstomer ehumber 92 hMumber lt ContactWame Michelle Butler Contacttame Salutation Mrs Salutation LompanyMame Manonull Inc CompanyMame Code generation note When generating C code a class named CX
190. F ci SELECT IIFIMAS Anoval Primarykey 5 NULL OMA Atoval Primary Key AS Prima INSERT INTO Attova Mame PrimaryKey VALUES Microtech OrgChart PrimaryKey 6 ELETI Clicking the Run SQL script icon executes the SQL select statement and presents you with a report on the database actions as shown in the screen shot below e Actual SQL statement that were executed on the target database e Multiple table actions if any occurred i e UPDATE gt gt gt OK 0 rows affected and the INSERT gt gt OK 1 rows affected e Results of every SQL statement e g OK and xx rows affected if successful or FAILED and a detailed error message li The following QL statements were executed during Generate output function Every single result is written right to the gt string These statements are only for previews and may not be executed in another SL GQuery tonl The database was connected using the following connection string Provider Microsott Jet OLEDB 4 0 Data Sources Program Files 4AttovahiAPPORCEZO04 MapF orceExamples VT ut nh mo 1 M OF amp tw ha SELECT IIFIMAx Atoval Primarykey IS MULL 0 MAA Atoval PrimarykKey ij 1 AS PrimarykKey FROM Altova gt gt OK One or more rows INSERT INTO Akova Name Primary Key VALUES Microtech OrgChart PrimaryKey 2 gt gt OK 1 roves Hotkeys for the Output window keyboard and numeric key pad CTRL and
191. Finished MappingConsole The screenshot below shows the mapping output in JBuilder 2006 Altova GmbH Altova MapForce User Manual 420 Code Generator Generating program code Ci 0Builder9 jdkl 4bin javaw classpath C Temp MarketingExpenses classes C Mapping Application Loading C Projects Files AMLSpyExeFolder MapForceExamples ExpReport xml saving MarketingExpenses xml Finished H a Pe bI Process finished m by ch alg x MappingApplication x Mapping Console The com subdirectory contains the generated code in various subdirectories Generating Java code using Sun ONE Studio If you are using Sun ONE Studio e Open Sun ONE studio e Mount the target directory you specified when you generated the Java code Explorer Filesystems ol x C Version Control SL 9 eExpReport 5 Archive JAR Zip E MarketingExpenses The Explorer window at left displays the source file structure Altova MapForce User Manual 2006 Altova GmbH Code Generator Generating program code 421 Sun ONE Studio 4 update 1 Community Edition Project Default File Edit View Project Build Debug Versioning Toole Window Help Eee tee ol x Ef Source Editor MappingApplication J Files ystems O I CTemp iMarketingExpenses atova maptorce E ExpReport G E MarketingExpenses D ES Mapping pplication gt class Mapping4pplication amp Fields amp
192. First Last HE input 1 fi concat EH output Bam test C Reusing exporting and importing User defined functions User defined functions defined in one mapping can be imported into any other mapping 1 Click the Add Libraries button and select a previously defined mfd file that contains the user defined function s you want to import The user defined functions now appear in the Libraries window under user if that is the default library you selected 2 Drag the imported function into the mapping to make use of it To change the user defined function type 1 Double click the user defined function to see its constituent components 2 Select the menu option Function Function settings and click the radio button of the type you want to change it to Standard or Inline Altova MapForce User Manual 2006 Altova GmbH User defined functions Inline vs Standard user defined functions 199 10 1 Inline vs Standard user defined functions The main difference between these two types of functions is the level of complexity that they each support and the implementation of each during code generation The graphical representation of the two types also differ e Standard user defined functions are shown with a solid outline e Inline user defined functions are shown with a dashed outline Implementation f Inline recommended Allows complex parameters filters and multiple outputs C Standard function Allows re
193. Fooo7 E Address on FOODS on Street a0 s003 i be FODD e FO0DF e FOOT kog oo al kog kog kog ied E i State E Lineltems kg it Li Jt it LER J LSR LER it wt LAR LER LER We are now ready to start mapping EDI items from the source EDI component to the target schema Mapping the EDI items The EDI component now shows us the structure of a message based on the collection ORDERS we selected Typically not all of the nodes will actually contain data so the project author must be sufficiently familiar with the EDI documents being worked on to locate the relevant nodes In this case the following nodes starting from the Group Message node need to be mapped directly BGM C106 F1004 SG2 NAD C082 F3055 SG2 NAD C080 F3036 SG2 NAD C059 F3042 SG2 NAD F3164 SG2 NAD C819 F3229 SG2 NAD F3251 SG2 SG5 CTA C056 F3412 gt Order Header Number gt Order Customer Number gt Order Customer CompanyName gt Order Customer Address Street gt Order Customer Address City gt Order Customer Address State gt Order Customer Address ZIP gt Order Customer ContactName At this stage the mapping should look similar to the graphic below 2006 Altova GmbH Altova MapForce User Manual MapForce and EDI UN EDIFACT to XML Schema mapping wm ORDERS ah 0082 ia a F3039 pi F117 Iii F3055 m COSB O
194. Force User Manual 6 1 6 2 6 3 6 4 6 5 6 6 6 7 6 8 6 9 6 10 6 11 6 12 7 1 TZ 7 3 7 4 7 5 Copy all connections 80 MapForce How To 84 Mapping multiple tables to one XML file wo eeeseeeeeeeeeeeeeeeeeeeeeeneteneeeeeeeeeeeeeeeaaaas 85 Mappings and root element of target documents ssssssssssessssssssssssssssssssssssssssssssssesseeee 87 Boolean values and XSLT 1 0 secensstccectctetemeatecaestetozemeatecenetetetersesticactclozennsabecenntetesern 88 Boolean comparison Of input nodes cccceeccccceeccecceeeeeaeseseeseeeececeeeeeeeeeeeeaaaaaaeeesees 90 Pory Gio Ic meee A ee ee ee ee a 91 Command line paranicterS csser nenies ennea aE E EN E ee E EEE 93 Input values overrides and command line parameters cccccceeeeeeeeeeeeeeeeeeeeeeees 95 Filtering database data by date rsen E EE eases 98 Specifying alternate database resources sseseeessesssssesssesssssreseesessesseesesseeeeesseeeeses 99 Filter components Tipo sesei uesia iaaii 100 Node 1S aiene E E E 102 Using DTDs as schema components 2 00 ececcccecceeceeeaeeeeeseeeeeeeeeeceeeeeeeeeeaaaaeeeeesees 103 MapForce and Databases 106 IDEC OEN E T a E nee eee ee ee ee 107 Development environments for code generation sssssssssssssssssssssssssssssssssssssssssesseeee 109 Mapping XML data to databases nnnenoessseseeeeeeenenessssssssssssssseererersssssssssssssseeeeereee 110 7 3 1 Setup of XML to database mapping
195. ForceCmdlID Altova MapForce User Manual 2006 Altova GmbH MapForceControl Integration at Document Level 539 private void ProcessCommand int nID MaprOorceDoc GoCcMaprorce CetCurrenlLMapr orceboc 1 docMapForce null docMaprorce axMaprorceControlpoc Exec nD elbe axMaprorceControl Bxectniip ProcessCommand delegates the execution either to the MapForceControl itself or to any active MapForce document loaded in a MapForceControlDocument control This is necessary because the MapForceControl has no way to know which document is currently active in the hosting application Handling Events Because all events in the MapForce library are based on connection points you can use the C delegate mechanism to provide the custom event handlers You will always find a complete list of events on the property page of each control of the MapForce library The picture below shows the events of the main MapForceControl Properties DataBindings Causes alidation changed DockChanged Enter Leave Location Changed Move OnDocumentOpened OnFileExternalChange axMapForceControl_ OnFileExternalChange OnProjeckOpened CnUpdatecmdl Parenthanged Resize SizeChanged SystemColors Changed Validated Validating Visible Changed As you can see the example project only overrides the OnFileExternalChange event The creation of the C delegate is done for you by the C Framework All you need to do is to fill t
196. ForceEDI folder which allows you to validate the result of EDI mappings in the Output window 2006 Altova GmbH Altova MapForce User Manual 332 MapForce and EDI Customizing an EDIFACT message 20 5 4 Inline customization e Changes only have to be made to the ORDERS config file at the specified location to be able to have inline access to the new X1000 field e Only the redefined CTA segment in the current message will contain reference the new element e In other words the CTA segment is redefined locally to contain a redefined Composite C056 with the local definition of the new field X1000 Open the ORDERS Config in XMLSpy or in you preferred editor and navigate to Message Envelope Interchange Group Message SG2 SG5 CTA or search for SG5 Group name SE5 mindecurs 0 maxOceurs 5 info CTA Contact information gt Beqment rert CTA gt Seqment reft COM mindecurs 0 maxOecurs 5 r Groups Replace the line lt Segment ref CTA gt with the following lines lt Segment name CTA info CONTACT INFORMATION gt lt Data ref F3139 minOccurs 0 gt lt Composite name C056 minOccurs 0 info DEPARTMENT OR EMPLOYEE DETAILS gt lt Data ref F3413 minOccurs 0 gt lt Data ref F3412 minOccurs 0 gt lt Data name X1000 type string maxLength 35 minOccurs 0 info New Element gt lt Composite gt lt Segment gt lt Group nanes SES mintecur
197. Hello gt lt setting name reference value C HelloWorldLibrary Hel loWorldhibrary dll y gt lt implementation gt Note for C it is very important that the generated code uses the namespace which is defined here C also needs to know the location of the dll that is to be linked to the generated code C lt implementation language cpp gt lt setting name namespace value helloworld gt lt setting name class value Greetings gt lt setting name path value C HelloWorldLibrary gt lt setting name include value Greetings h gt lt setting name source value Greetings cpp gt lt implementation gt e namespace is the namespace in which your Greetings class will be defined It must be equal to the library name e path is the path in which the include and the source files are to be found e The source files will then be copied to the directory targetdir libraryname defined when selecting the menu option File Generate xxx code and selecting the directory e If you have multiple include files or source files just add an additional setting element for include or source All the include files you supply will be included in the generated Algorithm Adding a component Each component you will define will be located within a function group Staying with the helloworld example lt group name string functions gt lt component name hello gt lt component gt lt Grouo gt Please ma
198. I The focus of this documentation is the ActiveX controls and interfaces required to integrate the MapForce user interface into your application To allow you to automate or control the functionality of the integrated components the following properties give you access to the MapForce automation interface MapForce API MapForceControl Application MapForceControlDocument Document MapForceControlPlaceHolder Project Some restrictions apply to the usage of the MapForce automation interface when integrating MapForceControl at document level See Integration at document level for details 2006 Altova GmbH Altova MapForce User Manual 562 MapForceControl Object Reference 27 5 Object Reference Objects MapForceCommand MapForceCommands MapForceControl MapForceControlDocument MapForceControlPlaceHolder To give access to standard MapForce functionality objects of the MapForce automation interface can be accessed as well See MapForceControl Application MapForceControlDocument Document and MapForceControlPlaceHolder Project for more information Altova MapForce User Manual 2006 Altova GmbH MapForceControl Object Reference 563 27 5 1 MapForceCommand Properties 10 Label L eoeparacor SubCommands Description Each MapForceCommand object can be one of three possible types e Command tp is set to a value greater 0 and Label is set to the command name IsSeparator IS false and the SubCommands collection
199. IFACT uses the EDSD segment file while ANSI X12 uses the X12 Segment file Please see Multiple consecutive elements for more information The format of the configuration files used to customize EDI messages has undergone a major change in MapForce2006 R3 please see Converting customized EDI configuration files for more information Altova MapForce User Manual 2006 Altova GmbH MapForce and EDI Customizing an ANSI X12 transaction 337 20 6 1 Customizing X12 source files When customizing an X12 transaction it is important to take note that segments often allow the use of multiple consecutive elements of the same name Multiple consecutive elements of the same name The goal of this section is to be able to map an ANSI X12 file that has been customized to an XML schema file A new field has been added to the N2 segment i e Mrs This additional data field should be mapped to the Salutation field in the XML schema LOOP ID N1 3100 Party Identification 3200 3250 Individual Name Structure Components 3300 Party Location 3400 Geographic Location 3450 Location ID Component Reference Information Adding a new field to an X12 file would normally entail adding a single separator character generally the character followed by the data The N2 segment specification shown below allows for two consecutive fields specified as Name REF ELE ID MAMIE RPT ATTRIBUTES O1 33 Hame M AN 160 Of 93 Hame O AN 160 The
200. ISDICTION c Limitation Of Liability TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW EVEN IF A REMEDY FAILS ITS ESSENTIAL PURPOSE IN NO EVENT SHALL ALTOVA OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL INCIDENTAL DIRECT INDIRECT OR CONSEQUENTIAL DAMAGES WHATSOEVER INCLUDING WITHOUT LIMITATION DAMAGES FOR LOSS OF BUSINESS PROFITS BUSINESS INTERRUPTION LOSS OF BUSINESS INFORMATION OR ANY OTHER PECUNIARY LOSS ARISING OUT OF THE USE OF OR INABILITY TO USE THE SOFTWARE OR THE PROVISION OF OR FAILURE TO PROVIDE SUPPORT SERVICES EVEN IF ALTOVA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES IN ANY CASE ALTOVA S ENTIRE LIABILITY UNDER ANY PROVISION OF THIS SOFTWARE LICENSE AGREEMENT SHALL BE LIMITED TO THE AMOUNT ACTUALLY PAID BY YOU FOR THE SOFTWARE PRODUCT Because some states and jurisdictions do not allow the exclusion or limitation of liability the above limitation may not apply to you In such states and jurisdictions Altova s liability shall be limited to the greatest extent permitted by law and the limitations or exclusions of warranties and liability contained herein do not prejudice applicable statutory consumer rights of person acquiring goods otherwise than in the course of business The disclaimer and limited liability above are fundamental to this Software License Agreement between Altova and you d Infringement Claims Altova will indemnify and hold you harmless and will defend or settle any claim suit or proceeding brought
201. If it does not contain data the first two characters of the controlling agency from the user defined settings are inserted See Settings Controlling agency e That UNT 0074 exists If it does not contain data the number of segments in the message is calculated and inserted e That UNT 0062 exists If it does not contain data the value from UNH 0062 is copied e That UNH 0062 exists If it does not contain data the value from UNT 0062 is copied If only the trailer segment number is mapped then the corresponding field in the header segment is supplied with the same value Settings Clicking the Extended button in the component settings dialog box opens the extended settings dialog box Please see the UN EDIFACT specification for more details Extended EDIFACT Settings x Controlling Agency Syntas Wersion Number Syntas Level Suppress UNA segment Cancel wih Altova MapForce User Manual 2006 Altova GmbH MapForce and EDI UN EDIFACT and ANSI X12 as target components 317 Controlling agency Default UNO Syntax version number Default 2 Syntax level Default A Suppress UNA segment Default unchecked 2006 Altova GmbH Altova MapForce User Manual 318 MapForce and EDI UN EDIFACT and ANSI X12 as target components 20 3 2 ANSI X12 target validation The following items are checked when a ANSI X12 document is validated Whether an ISA and an IEA segment exist Whether ISA I01 contains a
202. Invalid language specified Invalid address for the return parameter was specified Output_TextEncoding Property Output_TextEncoding as String Description Sets or gets the text encoding used when generating XML based code Errors 1500 The object is no longer valid 1501 Invalid text encoding specified Invalid address for the return parameter was specified Parent Property Parent as Agplication read only Description Retrieves the top level application object Errors 1500 The is no longer valid 1501 Invalid address for the return parameter was specified Path Property Path as String read only Description Path of the project file without name Errors 1500 The object is no longer valid 1501 Invalid address for the return parameter was specified Save Method save Description Saves the project to the file defined by Ful 1Name Errors 1500 The object is no longer valid 1502 Can t save to file 2006 Altova GmbH Altova MapForce User Manual 506 The MapForce API Object Reference Saved Property Saved as Boolean read only Description True if the project was not modified since the last Save operation false otherwise Errors 1500 The object is no longer valid 1501 Invalid address for the return parameter was specified Altova MapForce User Manual 2006 Altova GmbH The MapForce API Object Reference 507 26 2 9 Projectitem Enterprise or Professional Edition Properti
203. L Spy Programming Language 443 25 7 1 Code Blocks Code generator instructions are enclosed in square brackets T and T Multiple instructions can be included in a bracket pair additional instructions have to be separated by a new line or a colon Valid examples are x 0 x x 1 or x 0 x x 1 2006 Altova GmbH Altova MapForce User Manual 444 Code Generator The way to SPL Spy Programming Language 25 7 2 Comments Comments always begin with a character and terminate on the next line or at a block close character Altova MapForce User Manual 2006 Altova GmbH Code Generator The way to SPL Spy Programming Language 445 25 7 3 Variables The character is used when declaring or using a variable a variable is always prefixed by Variables types e integer e string e class iterator see foreach statement Variable types are declared by first usage x 0 x is now an integer x teststring x is now treated as a string Working with strings The previous example shows how a fixed string is assigned to a variable You will also need to concatenate strings as well as assign them to different variables Assigning a string to a variable x module Defining string concatenation uses the amp character x testconcat amp ination amp module 2006 Altova GmbH Altova MapForce User Manual 446 Code Generator The way to S
204. LEASE AND EVALUATION PRODUCT ADDITIONAL TERMS If the product you have received with this license is pre commercial release or beta Software Pre release Software then this Section applies In addition this section applies to all evaluation and or demonstration copies of Altova software Evaluation Software and continues in effect until you purchase a license To the extent that any provision in this section 1s in conflict with any other term or condition in this Software License Agreement this section shall supersede such other term s and condition s with respect to the Pre release and or Evaluation Software but only to the extent necessary to resolve the conflict You acknowledge that the Pre release Software is a pre release version does not represent final product from Altova and may contain bugs errors and other problems that could cause system or other failures and data loss CONSEQUENTLY THE PRE RELEASE AND OR EVALUATION SOFTWARE IS PROVIDED TO YOU AS IS WITH NO WARRANTIES FOR USE OR PERFORMANCE AND ALTOVA DISCLAIMS ANY WARRANTY OR LIABILITY OBLIGATIONS TO YOU OF ANY KIND WHETHER EXPRESS OR IMPLIED WHERE LEGALLY LIABILITY CANNOT BE EXCLUDED FOR PRE RELEASE AND OR EVALUATION SOFTWARE BUT IT MAY BE LIMITED ALTOVA S LIABILITY AND THAT OF ITS SUPPLIERS SHALL BE LIMITED TO THE SUM OF FIFTY DOLLARS USD 50 IN TOTAL If the Evaluation Software has a time out feature then the software will cease operation after the conclusion of the d
205. Manual 364 MapForce plug in for MS Visual Studio NET Opening MapForce files in MS VS NET Debug Insert Component Connection Function Output Authentic 8ML Convert Ry Solution Explorer Ctr Alt L FT Show Types Bookmark window Ctri K Ctrl EO Show Library In Function Header Class view Chrl Shift 0 Show Tips Code Definition Window Ctrl ShiFt hae Show selected component connectors Object Browser Ctrl 4lk Gutput Alk 2 SOOM Property Manager Library Window Resource view Ctrl Shifk E Messages Toolbox hrl Flk Overview 2 Dock the floating window at the position you want to use it e g left border To open an supplied sample file 1 Select the menu option File Open navigate to the MapForceExamples folder and open a MapForce file CompletePO mfd is shown in the screenshot below it Libraries ox CompletePO mfd MFO Filel mfd Start Page core Ee E ShortPo a conversion functions f boolean A F ShortPO gt Y CustomerNr E Lineltems 1 Lineltem 4 ArticleNr Amount number string Jado jde3 Javag amp E3 logical functions egual xogo 3 equal or qreater equal or less E Customers greater gt El lt Customers gt s E Y Customer gt oo Number gt i 4 FirstName gt LastName E 4 Address we Add Libraries Happing MOLT Output less logical and logical not logical or not equal Mes
206. MapForce User Manual 2006 Altova GmbH MapForce and Databases Mapping XML data to databases 139 7 3 8 Generating output values The Java C and C libraries have been extended by two functions which can generate values for database fields which do not have any input data from the Schema database or EDI source component Auto number and create guid can both generate values for fields Both functions are located in the generator functions subset of the lang library auto number is generally used to generate primary key values for a numeric field create guid Creates a globally unique identifier as a hex encoded string for the specific field 2006 Altova GmbH Altova MapForce User Manual 140 MapForce and Databases Database relationships and how to preserve or discard them 7 4 Database relationships and how to preserve or discard them Maintaining database relationships To map all Last names from the Person table where the Department primary key is equal to 4 create mappings under the same root table Department e PrimaryKey is mapped from the Department root table e Last is mapped from the Person table which is a child of the Department root table a er E Y OrgChart HE gl E Compan a daa E filter To on falzelp Result of the above mapping The last names of the persons in the Department with the primary key of 4 IT amp Technical support are displayed in the Outpu
207. MapForce view settings Menu Help The Help menu contains the submenu MapForce Help which is where you can open the MapForce help It also contains links to the Altova Support center Component download area etc Unsupported features of the NET edition of MapForce Both the Project pane and Project menu are not available in these editions This means that MapForce projects as well as WSDL projects cannot be opened in these editions 2006 Altova GmbH Altova MapForce User Manual Chapter 23 MapForce plug in for Eclipse 368 MapForce plug in for Eclipse 23 MapForce plug in for Eclipse Eclipse 3 x is an open source framework that integrates different types of applications delivered in form of plugins MapForce for the Eclipse Platform is an Eclipse Plug in that allows you to access the functionality of a previously installed MapForce Edition from within the Eclipse 3 0 and 3 1 Platform Installation Requirements To successfully install the MapForce Plug in for Eclipse 3 0 or 3 1 you need the following e The specific MapForce Edition you intend to use Enterprise Professional or Standard e The Eclipse 3 x package as well as e The appropriate Java Runtime Edition The MapForce Plug in for Eclipse supplies the following functionality e A fully featured visual data mapping tool for advanced data integration projects e Code generation capability in the Edition specific programming languages e MapForce user help under
208. MapForceControl Application MapForceControlDocument Document and MapForceControlPlaceHolder Project for more complex access to MapForce functionality However to open a document always use MapForceControlDocument OpenDocument or MapForceControlDocument NewDocument on the appropriate document control To open a project always use MapForceControlPlaceHolder OpenProject on a placeholder control embedding a MapForce project window See Examples on how to instantiate and access the necessary controls in different programming environments 2006 Altova GmbH Altova MapForce User Manual 530 MapForceControl Integration at Document Level 27 2 1 Use MapForceControl To integrate at document level instantiate a MapForceControl first Set the property InteqrationLevel to ICActivexXIntegrationOnDocumentLevel 1 Set the window size of the embedding window to 0x0 to hide any user interface behind the control You may use Appearance and BorderStyle to configure the appearance of the control s wrapper window Avoid using the method Open since this might lead to unexpected results Use the corresponding open methods of MapForceControlDocument and MapForceControlPlaceHolder instead See Query MapForce Commands for a description of how to integrate MapForce commands into your application Send commands to MapForce via the method Exec Query if a command is currently enabled or disabled using the method QueryStatus Altova MapForce User Ma
209. MarketingExpenses xml Console Out WriteLine Finished catch Exception e Console Out Write ERROR Console Out WriteLine e Message Console Out WriteLine e StackTrace System Environment Exit 1 C Mapping cpp int _tmain int argc TCHAR argv TCHAR envp tecout lt lt _T Mapping Application lt lt endl try Colnitialsze NULL MappingMainl MappingMainlObject MappingMainlObject Run 2006 Altova GmbH Altova MapForce User Manual 432 Code Generator Code generation mapping example _T C Projects Files XMLSpyExeFolder MapForceExamples ExpReport xml _T MarketingExpenses xml CoUninitialize tcout lt lt _T OK lt lt endl return 0 catch tcerr lt lt return 1 CAltovaException e _T Error lt lt e GetInfo c_str lt lt endl catch _com error amp e tcerr lt lt _T COM Error from lt lt TCHAR e Source lt lt tcerr lt lt TCHAR e Description lt lt endl return 1 catch std exception amp e cerr lt lt Exception lt lt e what lt lt endl return 1 catch tcerr lt lt TT Unknown error lt lt endl return 1 De lt lt end Altova MapForce User Manual 2006 Altova GmbH Code Generator Integrating MapForce code in your application 433 25 5 Integrating MapForce code in your application MapForc
210. NICODE andthe Unicode Logo are trademarks of Unicode Inc This software contains material that is 01334 13534 Dundas Software Lid all rights reserved The Sentry Spelling Checker Engine 2 2000 Winkertres Sofkware Inc STLpert 015353 2000 Boris Fomitchey 1334 Hewlett Packard ALTOVA Company 21536 57 Silicon Graphics Computer Systeme Inc 1337 Moscow Center For i SPARC Technology Scintilla Copyright 21355 2002 by Meil Hodgson lt n cilh scintilla org ATLA Copyright 21453 2005 by Terence Parr ewww ankr orgi All other names or trade marks are the property of their respective owners Altova MapForce User Manual 2006 Altova GmbH MapForce 2006 5 What is mapping Basically the contents of one component are mapped or transformed to another component An XML or text document a database or EDI file can be mapped to a different target XML document CSV text document EDI file or database The transformation is accomplished by an automatically generated XSLT 1 0 or 2 0 Stylesheet the built in MapForce engine or generated program code When creating an XSLT transformation a source schema is mapped to a target schema Thus elements attributes in the source schema are connected to other elements attributes in the target schema As an XML document instance is associated to and defined by a schema file you actually end up mapping two XML documents to each other Databases as well as EDI documents can also be used as da
211. Name Last Name Please note Although Standard user defined functions do not support complex input and output components they can be created in this type of function An error message appears when you try to preview the result of the mapping and prompts if you want to change the current Standard type user defined function into one of type Inline Standard user defined functions do not support e Complex input and output components i e XML schema nodes databases etc e Direct connection of filters to input components e Exist type functions on input components Exists Not exists Substitute missing is null is not null substitute null Code generation A standard user defined component generates code for a function call where inputs and outputs are passed as parameters At runtime the input parameter values are evaluated first then the function is called for each occurrence of the input data To change the user defined function type 1 Double click the user defined function to see its constituent components 2 Select the menu option Function Function settings and click the radio button of the type you want to change it to Standard or Inline Please note If the user defined function was originally of type standard with a priority context and was subsequently changed to one of type inline then the priority context is hidden and deactivated Changing the same function back to standard shows the priori
212. O E 4 5004 Creating the target schema component 2006 Altova GmbH Altova MapForce User Manual 304 MapForce and EDI UN EDIFACT to XML Schema mapping 1 Click the Insert XML Schema File icon and select Order xsd from the MapForceExamples directory SS 2 x Look ir oS MapForceE samples lt C Tutorial Articles xsd ma Altova Hierarchical xml fy CompleteP O xsd fayEmployees xsd E Altova Hierarchical xsd E Customer xsd a E Altova _SOLSML xsd md Customers xml r xsd E Article xsd T Customers xsd aay MarketingExpenses x Articles xml DailyExpenses xsd File name Order xsd Files of type fan supported Types ssd dtd srl Cancel 2 2 When prompted to supply an example file click No and select Order as the root of the target document Select root element x Namespace URI a rea 3 Click the Order entry and hit the key on the numeric keypad to view all the items 4 Click the expand icon at the lower right of the component window and resize the window Altova MapForce User Manual 2006 Altova GmbH MapForce and EDI UN EDIFACT to XML Schema mapping 305 El ORDERS a F Envelope gt E 4 Order E interchange he E 9 Header E UNB l Number 5 0S0 om Received FOOOT E Customer owe FOOO i Number E 435002 i ContactName on FOOD i CompanyName 7 EM
213. Offset wWlll 332 1 fad fa M111 3392 1 225397 74 2 111 81579227 10 3 3 111 B1i152427 7 6 1 4 222 976 4 7563 1 5222 ZZAW561 10 5 JET CO E T Gaia 4 The default settings are what we need at this point The text fragment is split into multiple text blocks of a single line each The associated container shows a preview of each of the text blocks Clicking the Next text block icon DI allows you to cycle through all the text fragments of which there are 6 2 Click the new container and sii it to Switch zdefault gt i l Switch Ea i aaa _ 111 i eee eae n the first triggered 21 1 111 332 1 2 21111 4157922 S L11 B1lS5S2427 eee 6 El ela Se T Sjeaege 2 A4N561 The initial state of the Switch container is shown above e An associated container default has been added e The content of the first record 1 6 is displayed in the default container 3 Click the Append condition icon in the Switch title bar to add a new condition 4 Double click in the field Content starts with and enter 111 Altova MapForce User Manual 2006 Altova GmbH FlexText Defining multiple conditions per container fragment 269 wlll 332 1 22 Content starts with 111 Output Foor the first ve D Mmlilil ddaslpaaadf afsay default This defines the first condition An associated container Content starts with 111 has been added above the default cont
214. PL Spy Programming Language 25 7 4 Global objects After a Schema file is analyzed by the code generator the objects in the table below exist in the Template Engine Name a Description O namespaces Namespace Namespace collection Collection of Namespace objects ae Class collection All the complextypes elements in a flat view The order is like the order while parsing through the types module string name of the source Schema without extension outputpath string The output path specified by the user or the default output path Altova MapForce User Manual 2006 Altova GmbH Code Generator The way to SPL Spy Programming Language 447 25 7 5 Using files create filename creates a new file the file has to be closed with the close instruction append filename appends items to a specific file the file has to be closed with the close instruction 2006 Altova GmbH Altova MapForce User Manual 448 Code Generator The way to SPL Spy Programming Language 25 7 6 Conditions adding conditions to your code if SPL allows you to use standard if instructions the syntax is as follows if condition instruction block else instruction block endif or without else if condition instruction block endif Please note that there are no round brackets enclosing the condition Conditions As in any other programming language conditions are constructed with logical and com
215. Path expression st ring Hello the expression evaluates as fn string Hello not aS xs string Hello Schema awareness The Altova XSLT 2 0 Engine is schema aware Whitespace in XML document By default the Altova XSLT 2 0 Engine strips all boundary whitespace from boundary whitespace only nodes in the source XML document The removal of this whitespace affects the values that the fn position fn last fn count and fn deep equal functions return For more details see Whitespace only Nodes in XML Document in the XPath 2 0 and XQuery 1 0 Functions section Note If a boundary whitespace only text node is required in the output then insert the required whitespace within one of the two adjoining child elements For example the XML fragment lt para gt This is lt b gt bold lt b gt lt i gt italic lt gt lt para gt when processed with the XSLT template lt xsl template match para gt lt xsl apply templates gt lt xsl template gt will produce This is bolditalic To get a space between bold and italic in the output insert a space character within either the lt b gt or lt i gt elements in the XML source For example lt para gt lhis is lt b gt bold lt b gt lt i gt i2talic lt gt lt para gt or lt para gt This is lt b gt bold amp x20 lt b gt lt i gt italic lt gt lt para gt or spara Ihis is lt b bold lt b5 lt 1 546752051 Calio gt lt Sara When such an XML frag
216. PhoneExt A Title ENEN K C EEE hal Delete Action Use Transactions 10 Click the Action on input data combo box and select the Update if entry 11 Click the combo box of the First row select equal and click OK to confirm Person table data is only updated if the First names of the source and database field are identical The action taken when this is true is actually defined by the mapping In this case the telephone extension is prefixed by 100 and placed in the PhoneExt field of the Person table 12 Click the Output tab to generate the pseudo SQL statements then click the Run SQL script button to execute the SQL statements This QL statements are only for preview and may not be executed in another To execute these statements use function Generate output fram menu Trans Connect to database using the following connection string Provider Microsott Jet OLEDB 4 0 Data Source C Program Files AttovaihaPr id UPDATE Ferson SET PhoneEsxt 100582 WHERE First vernon Altova MapForce User Manual 2006 Altova GmbH MapForce CSV and Text files Mapping Fixed Length Text files to adatabase 185 The telephone extension fields of all persons are PAA in the database Person Table eT E TO ernor Callaby 100562 Office Mans Further 100471 Accounts R Mlatise 100963 Accounting Firstbread 100621 Marketing M Sanna 100753 Art Director Landis 100951 Program Ml Record 4
217. Po a Customers4 nd4rtickes HEE ShortPO tiles A snippet of the code is shown below ColInitialize NULL 1 MappingMainl MappingMainlObject HappingHainit Inject Runi _Ti ShortPO eml _Tt Provider Microsoft Jet OLEDB 4 0 Data Source Customersd nd rticles mdb rig Colminitialize toout lt lt _T OK lt lt endl return catch CAltovaException amp j Please note that the path names in the generated source code have been deleted for the sake Altova MapForce User Manual 2006 Altova GmbH Code Generator Integrating MapForce code in your application 439 of clarity Looking at MappingMain1 Object Run All parameters passed to the run method except for the last one CompletePO xml are source files Please ensure that the last parameter is the target file In this example the source files are e XML file Short PO xml e Database file CustomerAndArticles mdb including the connection string the target file is e CompletePO xml To define your own source or target files e Directly edit the parameters passed to the run method of MappingMain1 Object To use an XML input stream as the XML data source e Navigate to the run method declaration in the code and configure the specific parameters there To add extra error handling code e Edit the code below the catch CAltovaException e code 2006 Altova GmbH Altova MapForce User Manual 440 Code Generator Co
218. Query document 587 F Fault webservice 360 Field custom CSV 177 186 delimiter 177 fixed length 179 keys in text files 174 File 389 encoding 177 186 Fill characters fixed length file 186 Fill character removing 179 stripping out 186 Filter complement 41 component tips 100 concatenate don t 100 filtering out records by date 98 map parent items 100 priority context 100 Filtering data 41 Find in result 27 output tab 27 XSLT Output tab 392 Fixed create new empty 186 custom field 186 input file 186 lenght files mapping 168 output file 186 Fixed length mapping 179 text file settings 186 Flat file mapping 168 Flat format mapping 179 FlexText Into 258 Tutorial 262 FLF fn fn fn fn fn fn fn f fn fn fn fn fn fn fn fn fn fn fn fn fn f fn fn store as 294 base uri in XPath 2 0 support in Altova Engines 591 COllection in XPath 2 0 support in Altova Engines 591 count in XPath 2 0 and whitespace 590 current date in XPath 2 0 support in Altova Engines 591 current dateTime in XPath 2 0 support in Altova Engines 591 current time in XPath 2 0 support in Altova Engines 591 data in XPath 2 0 support in Altova Engines 591 deep equal in XPath 2 0 and whitespace 590 document XSLT 2 0 function 586 element available XSLT 2
219. Standard setting when you select the Update if action e Necessary if the no of records in the source file might be different from the no of records in the target database e Helps keep the database synchronized no orphaned data in child tables e The Update if condition is satisfied when a corresponding key or any other field exists in the source XML file All child data of the parent table are deleted e Update if selects the parent table and thus the child tables related to it on which the Delete data in child tables works e lf the update condition on the parent is not satisfied i e no corresponding key field in source XML file exists then child data are not deleted e Existing database records that do not have a counterpart in the source file are not deleted from the database they are retained Ignore input child data Use this option when you want to update specific table data without affecting any of the child tables records of that table For example your mapping setup might consist of 3 source records and 2 target database records You would therefore need to e define an Update if condition to update the existing records e activate the Ignore input child data check box of the Update if column to ignore the related child records and e define an Insert Rest condition for any new records that have to be inserted Use Transactions The Use Transaction check box allows you to define w
220. String lt Query gt is the query placeholder or string you want to search for in the database SOAP ENWV Envelope umlns S04P ENV http schemas xmlsoap org soap er S0AP ENV Body mi get ferson umlnsim http r umm altora com Ws2zDB query wsdl Query xSLitywpe nsd string gt Stringt Query lr get Person gt SOAP ENV Body S08P ENV Envelope gt We want the webservice to deliver all person records that have the Ro string in either the First or Last name 4 Edit the String text and enter e g Ro mi get ferson umlnsi m http fw altora com Query xSLitype xsd string gt BRot Query gt 5 Select SOAP Send request to server to send the request to the server Altova MapForce User Manual 2006 Altova GmbH MapForce and Webservices Generating Java webservices with MapForce 355 tsoapeny Envelope xulns soapenv http schemas xulsoap org soap en tsoapenty Body gt mn getPersonkesponse xulns n0 http rmm altova com WS2DB Besult sospenciarraylype n0 Person xsi type soape Person xsSLitwpe n0 Person gt First ws Llitype ned string gt Martint First gt Last xsi type xsd string gt Ropest Last Title xsLiitype xed string gt Mr Title gt PhoneEAT xusilitype ned string gt 7504 PhoneEXT gt Email xsi type ysd string gt ur strings com Em lt Person Person xsSlitype n0 Person gt FLirst xSLi
221. T 1 0 Engine Altova XSLT 2 0 Engine and Altova XQuery 1 0 Engines Documentation about implementation specific behavior for each engine is in the section Engine Information in Appendix 1 of the product documentation should that engine be used in the product These three engines are also available in the AltovaXML package which can be downloaded from the Altova website free of charge Documentation for using the engines is available with the AltovaXML package 2006 Altova GmbH Altova MapForce User Manual 598 Appendices Technical Data 28 2 4 Unicode Support Unicode is the new 16 bit character set standard defined by the Unicode Consortium that provides a unique number for every character e no matter what the platform e no matter what the program e no matter what the language Fundamentally computers just deal with numbers They store letters and other characters by assigning a number for each one Before Unicode was invented there were hundreds of different encoding systems for assigning these numbers No single encoding could contain enough characters for example the European Union alone requires several different encodings to cover all its languages Even for a single language like English no single encoding was adequate for all the letters punctuation and technical symbols in common use These encoding systems used to conflict with one another That is two encodings used the same number for two different ch
222. T IFIMAX Ottice Primarykey 1 IS NULL OMAR Ottice Primary key i AS PrimaryKey FROM OK One or more rows INSERT INTO Office Foreignkey Desc EMail Established Name PrimaryRKey VALUES 2 Microtech established ts new office on Feb 30 nextotticememicrotech com 2001 03 0 gt OK 1 rows Altova MapForce User Manual 2006 Altova GmbH MapForce and Databases Mapping XML data to databases 121 7 3 4 Database action Update The first example deals with the simple task of updating existing Person records Mappings are created from the XML data source to the root table Person Files used in this example e Altova_Hierarchical xsd e altova cmpy xml e altova mdb Aim To update the person fields of the Person table 1 Insert the Altova_Hierarchical schema and assign altova cmpy xml as the input XML instance 2 Insert the MS Access database altova mdb into the mapping oe E Address EJ Altova E Department Office Person ie g pt L L s x I oJ ul kog pa I L pna I L 4 Phone E Address i5 4 Department Y Primarykey ka Lar nee Le nee nt iL ht i i beg La kan ho Te a i i a I Li Li T7 Lt Li fe PrimaryKey mForeignkey fEMail 1 oJ Ll oe Li L I J b g La gt a I Ln Li Li Li First ig jLast f PhoneExt
223. There are however two other expense items in the list one lodging and one meal expense item Each one of these items generates an empty parent expense item tag Altova MapForce User Manual 2006 Altova GmbH MapForce tutorial Mapping multiple source items to single target items 55 To avoid generating empty tags create a filter such as the one described previously in the tutorial under Filtering data 2006 Altova GmbH Altova MapForce User Manual 56 MapForce tutorial Mapping multiple source items to single target items 3 7 2 Duplicating input items We now need to duplicate the input items to be able to create mappings from a different source XML file To achieve this we will e add the second XML source file and e create mappings from it to the same inputs in the target XML file Duplicating input items 1 Right click the Employee entry in the target XML file 2 Select the menu option Duplicate input fH ExpReport combined Align Tree Left G Align Tree Right 1 Show Types Duplicate Input Remove Duplicate Database Table Actions Database Key Settings E 3 expense report jg 3 Company oo detailed gt Al Employee i SS CUITeNncy Title a Y Person oe Name i First l on Last aon Email oe Title DomesticD ailyRate pi Y Phone ae Y ForengnD ailyR ate Lo Email L Expense detail g Y expense item E 3 expense ite
224. This menu contains the complete main menu of MapForce if objCommand Label IDR_MAPFORCE InsertMenuStructure mainMenu Menultems 1 objCommand 0 0 false mainMenu Is the name of the menu object of the MDI Frame window created in the Visual Studio IDE InsertMenuStructure takes the MapForce menu from the IDR_ MAPFORCE command object and adds the MapForce menu structure to the already existing menu of the sample project No commands from the File Project or Window menu are added The new commands are instances of the class Cust omMenuItem which Is defined in CustomMenulItem cs This class has an additional member to save the MapForce command ID which is taken to execute the command using Exec on selecting the menu item This code from InsertMenuStructure creates the new command CustomMenultem newMenulItem new CustomMenultem if objCommand IsSeparator newMenultem Text else newMenultem Text strLabel newMenulItem m_MapForceCmdID int objCommand ID newMenulItem Click new EventHandler AltovaMenulItem_Click You can see that all commands get the same event handler AltovaMenulItem_Click which does the processing of the command private void AltovaMenulItem_Click object sender EventArgs e if sender GetType System Type GetType MapForceApplication CustomMenuItem CustomMenu ItemcustomItem CustomMenultem sender ProcessCommand customItem m_Map
225. Transactions Enables transaction processing when using a database as a target A dialog box opens when an error is encountered allowing you to choose how to proceed Transaction processing is enabled for all tables of the database component when you select this option JDBC specific Settings JDBC driver Displays the currently active driver for the database component The default driver is automatically entered when you define the database component You can change the driver entered here to suit your needs Please make sure that the syntax of 2006 Altova GmbH Altova MapForce User Manual 400 MapForce Reference Component the entry in the Database URL field conforms to the specific driver you choose Database URL URL of the currently selected database Make sure that this entry conforms to the JDBC driver syntax of the specific driver entered in the JDBC driver field User Enter the user name needed to access the database if required Password Enter the password needed to access the database if required ADO OLEDB specific settings Provider Displays the currently active provider for the database component The provider is automatically entered when you define the database component add Options Displays additional database options Altova MapForce User Manual 2006 Altova GmbH MapForce Reference Connection 401 24 6 Connection Auto Connect Matching Children Activates or de activates the Auto c
226. X12 source file therefore has to take this into account by adding an empty field separator for the first mandatory occurrence and a second one to separate the actual data This means that Mrs has to be entered for the data to adhere to the X12 specification You can find out the specific fields that have multiple entries by looking at the X12 Segment file supplied with MapForce in the MapForceEDI X12 folder Any segment that may contain multiple identical field entries e g 93 is shown as the field number with a mergedEntries attribute which defines how many multiples may occur in this case 2 Seqment name NZ info Additional Name Information gt Data ret FSs mergedEntries 2 gt Seqment gt Inserting the X12 file with only one separator causes the following warning to appear in the Messages window when the EDI component is inserted and the sample EDI file has been assigned 3 New Design Document Validation Successtul 0 errors 1 warrirng s E C Frogram Files4ltovash apF once 2006 apForceE samples Tutora Orders Custom s12 E Line 6 column 20 offset 011071 Extra content detected in We Mrs flntenchangel of 1 Groupll of 1 7 Message 1 of 1 LoopN1 1 of 0 200 N2 1 of 0 2 The Messages window supplies very specific help on the location and cause of a message Clicking the respective message displays the specific line in the component if a connector is missing or shows that
227. XHTML XML and XSL are trademarks registered in numerous countries of the World Wide Web Consortium W3C marks of the W3C are registered and held by its host institutions MIT INRIA and Keio Except as expressly stated above this Software License Agreement does not grant you any intellectual property rights in the Software Notifications of claimed copyright infringement should be sent to Altova s copyright agent as further provided on the Altova Web Site LIMITED TRANSFER RIGHTS Notwithstanding the foregoing you may transfer all your rights to use the Software to another person or legal entity provided that a you also transfer each of this Software License Agreement the Software and all other software or hardware bundled or pre installed with the Software including all copies updates and prior versions and all copies of font software converted into other formats to such person or entity b you retain no copies including 2006 Altova GmbH Altova MapForce User Manual 608 Appendices License Information backups and copies stored on a computer c the receiving party secures a personalized key code from Altova and d the receiving party accepts the terms and conditions of this Software License Agreement and any other terms and conditions upon which you legally purchased a license to the Software Notwithstanding the foregoing you may not transfer education pre release or not for resale copies of the Software 4 PRE RE
228. XQuery Engine 2006 Altova GmbH Altova MapForce User Manual 582 Appendices Engine information 28 1 1 XSLT 1 0 Engine Implementation Information The Altova XSLT 1 0 Engine is built into Altova s XMLSpy StyleVision Authentic and MapForce XML products It is also available in the free AltovaXML package The Altova XSLT 1 0 Engine implements and conforms to the World Wide Web Consortium s XSLT 1 0 Recommendation of 16 November 1999 and XPath 1 0 Recommendation of 16 November 1999 Limitations and implementation specific behavior are listed below Limitations e he xsl preserve space and xsl strip space elements are not supported e When the method attribute of xsl output is set to HTML or if HTML output is selected by default then special characters in the XML or XSLT file are inserted in the HTML document directly as special characters they are not inserted as HTML character references in the output For instance the character 160 the decimal character reference for a non breaking space is not inserted as amp nbsp in the HTML code but directly as a non breaking space Implementation s handling of whitespace only nodes in source XML document The XML data and consequently the XML Infoset that is passed to the Altova XSLT 1 0 Engine is stripped of boundary whitespace only text nodes A boundary whitespace only text node is a child whitespace only text node that occurs between two elements within an element o
229. Y Address Street gt I fa auto number ia start at tat is AT result feincrease gt t is gt is io HER Addresses z Customer D EE Addresses Number Altova MapForce User Manual 2006 Altova GmbH MapForce and Databases Mapping XML data to databases 131 7 3 5 Database action Delete The table action Delete if is used to selectively delete data from tables This is achieved by selecting specific items fields of the source and target components which are to be compared The specific table action is then executed depending on the outcome of this comparison Please note This table action should not be confused with the Delete data in child tables option available in the table action dialog box The Delete if table action only affects the table for which the action is defined no other tables are affected Aim e To delete the existing Person records in the database and e Insert new Person records from the input XML file 1 Insert the Altova_Hierarchical schema and assign altova cmpy extra xml as the input XML instance 2 Insert the MS Access database altova mdb into the mapping E Altova_Hierarchical E Address E Altova E Department E Office f Address JE Person E 1 Department oo PrimaryKey 4 ForeignKey P E 1 1 I Lr Lt L I I L I m ho E Person Y Primarykey ForeignKey EMail ee eee
230. Y Article m Number ff filter Aprede tow on trueb or falzel p gt it at 1 le se Priority context and user defined functions If a user defined function has been defined of type inline the default setting then a priority context cannot be defined on one of the parameters of the user defined function The user defined function can of course contain other Standard user defined functions which have priority contexts set on their parameters If the user defined function was originally of type standard with a priority context and was subsequently changed to one of type inline then the priority context is hidden and deactivated Changing the same function back to standard shows the priority context and enables it once again Please see Altova MapForce User Manual 2006 Altova GmbH MapForce How To Command line parameters 93 6 6 Command line parameters The command line parameter syntax for MapForce is shown below Please note that MapForce currently supports XERCES version 2 2 0 General syntax MapForce exe Filename BUILTIN XSLT XSLT2 XQuery Java CS CS VS2005 VS2003 VS2002 BORLAND MONO CPP CPP VC8 VC71 MSXML XERCES LIB DLL MFC NoMFC outputdir LOG logFileName e The square brackets denote optional e The round brackets denote a parameter group containing several choices e The pipe symbol denotes OR e g XSLT or
231. Y Phone ow A First oe Email expense item T at Y Email E expense item aan type poe 7 bool on false gt E daily expenses E Person on First 7 oe 3 Last 2 ow Title i A Y Phone ow Email C Marketing a expense item pie expense oderoyy on true rar ea eee 2 Click OK if you want to create Copy all connectors Altova MapForce User Manual 2006 Altova GmbH Copy all connections 81 i5 4 Person Y Phone 2 a First ie Email ner Y Title i Y Phone Email 2 expense item ee type expto ODate 7 expense pool on false gt Person oe First fi equal i ag Last sa en gt Title F result i 4 Phone All connectors to the target component and all source and target items with identical names are created Please note e When the existing target connections are deleted connectors from other source components or other functions are also deleted e This type of connection cannot be created between an item and the root element of a schema component e Individual connectors cannot be deleted or reconnected from the Copy all group once you have used this method Copy all connections and user defined functions When creating Copy all connections between a schema and a user defined function of type Inline the two components must be based
232. a MapForce User Manual 2006 Altova GmbH Appendices License Information 603 28 3 2 License Metering Your Altova product has a built in license metering module that helps you avoid any unintentional violation of the End User License Agreement Your product is licensed either as a single user or multi user installation and the license metering module makes sure that no more than the licensed number of users use the application concurrently This license metering technology uses your local area network LAN to communicate between instances of the application running on different computers Single license When the application starts up it sends a short broadcast datagram to find any other instance of the product running on another computer in the same network segment If it doesn t get any response it will open a port for listening to other instances of the application Other than that it will not attempt to communicate over a network If you are not connected to a LAN or are using dial up connections to connect to the Internet the application will not generate any network traffic at all Multi license If more than one instance of the application is used within the same LAN these instances will briefly communicate with each other on startup These instances exchange key codes in order to ensure that the number of concurrent licenses purchased is not accidentally violated This is the same kind of license metering technology that is c
233. a against unlicensed or illegal use of the Software and to improve customer service Activation is based on the exchange of license related data between your computer and the Altova license server You agree that Altova may use these measures and you agree to follow any applicable requirements c LiveUpdate Altova provides a new LiveUpdate notification service to you which is free of charge Altova may use your internal network and Internet connection for the purpose of transmitting license related data to an Altova operated LiveUpdate server to validate your license at appropriate intervals and determine if there is any update available for you d Use of Data The terms and conditions of the Privacy Policy are set out in full at http www altova com privacy and are incorporated by reference into this Software License Agreement By your acceptance of the terms of this Software License Agreement or use of the Software you authorize the collection use and disclosure of information collected by Altova for the purposes provided for in this Software License Agreement and or the Privacy Policy as revised from time to time European users understand and consent to the processing of personal information in the United States for the purposes described herein Altova has the right in its sole discretion to amend this provision of the Software License Agreement and or Privacy Policy at any time You are encouraged to review the terms of the Privacy Policy as
234. abase Ownrers Select 4 Deselect 4 Selected T ables l Ba Address Ba Altova Ba Department Insert Mow Cancel 8 Click Select All then click the Insert Now button to insert the database schema component altova E Address i Altova Department Office Person The database component appears in the mapping window You can now create mappings to a target schema XML document 2006 Altova GmbH Altova MapForce User Manual 64 MapForce tutorial Database to schema mapping 3 8 1 Mapping database data Inserting the target schema document 1 Click the Insert XML Schema File icon and select the MFCompany xsd schema 2 Click No when the prompt for a sample XML file appears 3 Select Company as the root element and expand all items You are now ready to map the database data to a schema XML document j mE Address j JE 4 Company p HE Altova K i 7 Address j Department E i Th Jf of i a i i ae a a T 1 a gt Office h Ferson ie a E 7 i i 2 i T i a I T7 Lt 1 E Y Person ae Manager E B j kasi n srn Programmer koa i re Degree N First Mo D i a i T7 Lt Lt 1 ka i i Li ow Title oo PhoneE xt Le id gt i koa i i J ut 1 m i Y Email gt fe Le Mapping database data to a schema do
235. abase supplies the data for the schema component and displays it in a tree view EDI EDIT Inserts an EDI document which can be used as the data source or as a target component MapForce currently supports the Electronic Data Interchange formats UN EDIFACT 0 4B as well as ANSI X12 version 5012 and allows you map data from these type of documents to from XML Schema CSV and text files as well as database components Please see the section on EDIFACT for more information Text file This opens the Insert Text Component dialog box where you can choose if you want to e Design a FlexText template based on a sample file e Open an existing FlexText template to map it to other target components e Insert a standard CSV or FLF text file Insert Text Component Altova MapForce provides different methods to process text files depending on ther complexity Please choose below Design graphically new structure based on a sample file Open existing Flex Text configuration file to map it with other sources bargets Use simple processing for standard CSW delimited and or FLF fixed length files Continue ob Constant Inserts a constant which is a function component that supplies fixed data to an input icon The data is entered into a dialog box when creating the component There is only one output icon on a constant function You can select the following types of data String Number and All other Filter Nodes Rows
236. ablished E 1 The company was es officegnanonul 1992 04 01 2 On March 1st 2000 nextoffiice nan 2001 03 01 2 hlicrotech Orglhart LDP iimarykey Dese EMail Established E 3 Microtechnology proc officegemicroter 1992 04 01 4 Microtech establishe nextofiicegemic 2001 03 01 Two new offices have been added to the Microtech OrgChart 8 Double click the Office table to see the effect in greater detail 6 Office Table _ PrimaryKey Foreignkey Desc EMail E 1 The company was establis officemnanonul 1 On March 1st 2000 Manoli nextofficemnan 2 Microtechnology products officem microter 2 Microtech established its r nextoficemmic The new offices have been added with primary keys of 3 and 4 respectively Both these new offices are related to the Altova table by their foreign key 2 which references the Microtech OrgChart record SELECT IF CMA Atoval Primaryhey Is MULL 0 MAA ARoval PrimarykKey i 1 As PrimaryKey FROM gt OK One or more rows INSERT INTO Altova Mame Primarykey E VALUES Microtech OrgChart PrimaryKey 6 gt OK 1 rows SELECT IF MAX Ottice Primarykey 1 lS NULL OMAR Ottice Primary key AS PrimaryKey FROM gt OK One or more rows INSERT INTO Office Foreignkey Desc EMail Established Mame PrimaryKey i VALUES 2 Microtechnology products are currently the bleeding edge of computer technology oft gt OK 1 rows SELEC
237. aceholder for MapForce Helper Windows seeeeeeeeereterersreerererererererreee 543 Altova MapForce User Manual Create a Custom ToolDaf vases cece orceetncetce ce cotcc acta ditacdialeusotensetcetesteacneceinehaiatencesane 543 Create More CUNINLS i Cee nT er enee merer eer tes cere eet nme here rere ee rere ere er ar 544 Create Event Handler to Update Button Rei INU eee ree rere nr er riirn rrr ee 545 VG STEAL PS Gace oeace ase A ocean E E E E E 546 Dal Command Table eccna 547 OG ol TENT o E ER 548 oe EUC IVECI ee EE EEE A e 549 2o EN N a E ER 550 i Gl 5 0 Me e AE E E EE E 551 Die Comp on a MENU s E AS 552 2130 C onnechon MENU cece sckc asec te seers ete eee ee uae orcas 553 For Focon Men ae an EA 554 Zc OUa MeT aa E E E 555 Dee NEN INC eaa E ES 556 Za Eoo M e AEE EA 557 DP l Window Meni ga oases sc eats aoc ENS 558 DIZ TACT ICG ies Sees ansteeeexat R A 559 27 3 13 Commands not in Main Menu 2 0 eee eseccsscccescccescccssccusccessceesceesecenecs 560 DIP Accessing MapForce APL arreire eee 561 Dic Dect REIFCNCE jesse oscccsitnsdnessscsepnsatentdincssietnssincalspsdecsvie veaseselentdincssietecsisalopebecssetnesissalosidinesiouacs 562 Dieded MapForceCommand sessenta E EE A Iie 563 Bees EEE E E A EATE E ONE E ATAA 563 Ta e E AA E A A E EAEE 563 TSS CDOT AION a E EE E E E EAA NoHo 563 SubCommand ica sos oeen see ec E aE R NE EEEN EEan 563 27 5 2 MapForceCommands ccccccccssssssssssseeeeccccccceeeeeeeeaaeaeaesseseseeee
238. ail c clovictemicrotech com First Clive Last Clovis PhoneExt 963 Title Processing sequence Department table Department table Update if condition true source and target keys are identical therefore e update each Department record where the keys are identical e if records exist in the database with no counterpart in the source file then these records are retained and remain unchanged in this example the Engineering table Department table Update if condition false source and target keys are not identical i e source keys exist which have no match in the target database the update if condition fails therefore e none of the Department records are updated Processing sequence Person table Person table Update if condition true source and target keys are identical therefore e update each Person record where the keys are identical e if records exist in the database with no counterpart in the source file then these records are retained and remain unchanged Person table Update if condition false source and target keys are not identical i e source keys exist which have no match in the target database the update if condition fails therefore e move on to the next Table Action column Insert Rest e insert the new Person records into the Person table if any exist In this case two new person records are added to the Admin department with the person primary keys of 30 and 31
239. ainer 5 Click the append icon again and enter 222 in the Content starts with field Content starts with 111 wll 332 1 22 aez starts with aM i Output For the first m Faje D a E o Content starts with 222 P A third container has been added Content starts with 222 Please note Clicking the Contents starts with combo box allows you to select the Contains option This allows you to specify a string which can occur anywhere in the text fragment 7 Click the Next text block icon Dl several times to see the effect 2006 Altova GmbH Altova MapForce User Manual 270 FlexText Defining multiple conditions per container fragment starts with 7 a a Output For the First m a4 D 1j222 976 4 1 222 9768 4 7563 1 69 Upon reaching record 4 of 6 container 222 opens up and displays its content 8 Continue clicking till you reach record 6 of 6 A single CR LF character is displayed in the default container Switch default gt a Output For the first m aJe D LBP lf a data fragment in the current block satisfies a condition then the complete data of that block is passed on to the associated container Data is not split up in any way it is just routed to the associated container or to the default container if it does not satisfy any of the defined conditions 9 Click the first two containers and change them to Store as value Click the last container and change i
240. al 516 The MapForce API Enumerations 26 3 2 ENUMDOMType Description Enumeration values to specify the DOM type used by generated C mapping code Possible values eDOMType_msxml4 eDOMType_xerces See also Code Generation Altova MapForce User Manual 2006 Altova GmbH The MapForce API Enumerations 517 26 3 3 ENUMLibType Description Enumeration values to specify the library type used by the generated C mapping code Possible values eLibType_ static eLibType_dll See also Code Generation 2006 Altova GmbH Altova MapForce User Manual 518 The MapForce API Enumerations 26 3 4 ENUMProgrammingLanguage Description Enumeration values to select a programming language Possible values eUndefinedLanguage 1 eJava 0 eCpp 1 eCSharp 2 eXSLT 3 eXSLT2 eXQuery 5 Altova MapForce User Manual 2006 Altova GmbH The MapForce API Enumerations 519 26 3 5 ENUMProjectltemType WDescription Enumeration the different kinds of project items that can be children of Project or folder like Projectltems Possible values eProjectltemType_Invalid 1 eProjectitemT ype _MappingFolder 0 eProjectltemT ype Mapping eProjectiItemT ype WebServiceFolder 2 eProjectltemType_ WebServiceRoot 3 eProjectiItemT ype WebServiceService 4 eProjectitemT ype WebServicePort 5 eProjectltemType_WebServiceOperatio 6 n eProjectltemType_ExternalFolder 7 eProjectltemType_Li
241. al Unicode MS that has been created by Agfa Monotype for Microsoft This font contains over 50 000 glyphs and covers the entire set of characters specified by the Unicode 2 1 standard It needs 23MB and is included with Microsoft Office 2000 We highly recommend that you install this font on your system and use it with the application if you are often editing documents in different writing systems This font is not installed with the Typical setting of the Microsoft Office setup program but you can choose the Custom Setup option to install this font In the Examples folder in your application folder you will also find anew XHTML file called Unicode UTF8 htm1 that contains the sentence When the world wants to talk it speaks Unicode in many different languages Wenn die Welt miteinander spricht spricht sie Unicode and writing systems St ion TFS Unicode CF o this line has been adopted from the 10th Unicode conference in 1997 and is a beautiful illustration of the importance of Unicode for the XML standard Opening this file will give you a quick impression on what is possible with Unicode and what writing systems are supported by the fonts available on your PC installation Right to Left Writing Systems Please note that even under Windows NT 4 0 any text from a right to left writing system Such as Hebrew or Arabic is not rendered correctly except in those countries that actually use right to left writing systems This is due to the
242. al outgassing pollu 1100 897 22 1 716235 Loz 21110 9832 22991 30 002 N a an inlii2n 121 44 n1 nn8 so0x 1 111 4157924 j H 2 1ii B152 4 427T a 222 076 4 75 4 222 22aU561 The default settings of the Split once container are visible fixed length horizontal and split line 1 The result of these default settings are also visible e The top container contains the first line of the text file highlighted in the Split once container e The lower container contains the rest of the text file Altova MapForce User Manual 2006 Altova GmbH FlexText Creating split conditions 265 19 3 Creating split conditions FlexText allows you to define so called split conditions that allow you to segment text fragments in various ways 1 Click the Mode combo box and select delimited line based 2 Double click the Separator field and enter General VIGEHErFAlL outgassing pollutant 8 1100 897 22 1 716235 Loxhb 2 1100 897 22 3 1110 9832 23 4 1120 1213 3 The text fragments in the respective containers have now changed Entering General and using delimited line based allows you to split off that section of text that contains the string General into the lower container The text fragment up to the separator is placed in the top container What we want to do now is work on the lower container to produce a CSV file containing the records with 1100 and up 3 Click the lower container and ch
243. all remaining lines to the end of the file fragment 1J111 B8152427 7 6 1200 Miscellaneous 2j224 970 4 75653 1 69 Air freight Mini Sl2e 244W561 10 5 LOO00 Gas CHromatograph Altova MapForce User Manual 2006 Altova GmbH FlexText FlexText Reference 283 19 6 3 Switch Using the Switch option allows you to define multiple Keywords or conditions for a single text fragment Each keyword you define has its own associated container which receives data only if the specific condition is satisfied i e true If none of the conditions are satisfied then the specific fragment is mapped to a default container Container default settings are Output For the first triggered condition The example below processes a Tomcat log file where the individual processes are to be separated out and made mappable When you first define a Switch container only the default container appears to the right of the Switch container All data is automatically passed on to it Mode delimited line based E4 Separator INFO Output For the first triggered condition l 22 2005 1 I D Initialisz ljug ee 2005 Lieeail cic ADOS 1 Initialisz ee Z005 1 otarting tarn Aona Aes Starting eo 005 1 AML walid The repeated split container using delimited line based separates all INFO sections out of the log file and passes them on to the Switch container 7 l 1 Click the append icon
244. allows you to extend the installed XSLT function libraries with your own custom functions This option is made available when you select XSLT as the output by clicking the XSLT icon or selecting Output XSLT 1 0 XSLT files appear as libraries and display all named templates as functions below the library name e Functions must be declared as Named Templates conforming to the XSLT 1 0 specification in the XSLT file e Ifthe imported XSLT file imports or includes other XSLT files then these XSLT files and functions will be imported as well e Each named template appears as a function below each library name e The amount of mappable input icons depends on the number of parameters used in the template call optional parameters are also supported e Updates to imported XSLT files occur at program start e Namespaces are supported Please note When writing named templates please make sure that the XPath statements used in the template are bound to the correct namespace s The namespace bindings of the mapping can be viewed by clicking the XSLT tab Please see the XSLT 1 0 implementation specific document for more information The files needed for the simple example shown below are available in the MapForceExamples directory e Name splitter xslt e Name splitter xml the XML instance file for Customer xsd e Customers xsd e CompletePO xsd Please see Aggregate functions for an additional example of using named templates to
245. alzel _ _ B a a I LE LA a eal Lt kog j koni i how Ye fa equal Tray cost ho Lo Destination lt gt Mileage gt Parking p Entertainment 9 Connect the Travel item in the source schema with the Travel item in the target schema document 10 Connect the Trav cost item with the Travel Cost item in the target schema document 5 bal hoa kop Lt wt LEP wt 1 J os Location EEE oo Hotel 0 ForeignAc koni L ee P B wt Lt wt LER wt LER LER be 4s Mea i EE lave p Smealtype I gt Travel Cost i i fi filter l i 4 Destination io Location enode row or truel gt Car Rental E Lodging 2 ebool prefalsely f 7 4 Al Travel on Misc Travel fi equal gt 2 4 Accommodati a E DomesticAc mres rav cost l TET HH resu Tp Destination gt eb 7 2 pe Domestic 11 Click the Output tab to see the result 2006 Altova GmbH Altova MapForce User Manual 44 MapForce tutorial Filtering data lt xml version 1 0 encading UTF 8 gt slompany mins si hit Away ves org 2001 XML Schema instance st schemes SEmployee Tithe Project Manager Tithe lt Mame Fred Landis Mame f Tel 123 456 78 Tel gt lt Email t landizienanoanull com Email sexpense item Currency USD Bill to Development 2 Date gt 2003 01 02 Date gt Pf eTr
246. ame V47993824_47939520 sxe call template name tokenize gt lt xehwith param name string select V4 9956824 47966944 gt sesh call template gt i ahesh variable gt Please note As soon as a named template is used in a mapping the XSLT file containing the named template is included in the generated XSLT code xsl include href and is called using the command xsl call template 7 Click the Output tab to see the result of the mapping lt rxml ersion 1 0 encading LITF 8 LompletePO mins xsi http iw ss org 001 MLS chema instance eCustomer i hlumber d lt Mumber lt FirstWame Fred John Firsttame i lt Lasthame Landis LastName flustomer lt Customer gt Oo Mm th E to ha Number 2 Mumber lt FirstWame Michelle 4nn marie F irsttame lt Lasttlame Butler Lasttame lt lustomer Customer gt i lt Mumber 3 lt humber lt Firsthame gt Ted Mac vFirstame gt LastName gt Little Lasthame gt To delete custom XSLT functions 1 Click the Add Libraries button 2 Click to the specific XSLT library name in the Libraries tab 3 Click the Delete button then click OK to confirm 2006 Altova GmbH Altova MapForce User Manual Chapter 13 Adding custom XSLT 2 0 functions 240 Adding custom XSLT 2 0 functions 13 Adding custom XSLT 2 0 functions MapForce also allows you to import XSLT 2 0 functions that occur in an XSLT 2 0 document in the f
247. ame root level The content of each table is limited to the fields it contains We can however use MapForce to extract related database data even though relationships have not been explicitly defined Having defined mappings switching to the Output tab allows you to preview the result of your mappings immediately Database data cannot be previewed if the target language is XSLT a message will appear and the database component will be greyed out Altova MapForce User Manual 2006 Altova GmbH MapForce and Databases Using MapForce to create database relationships 155 In this example we want to retrieve the Altova office names as well as the departments that exist in each office e Compare the Office foreign key to the Altova primary key using the equal component If both keys are the same then e Pass on the contents of Office Name to the node row parameter of the filter component and e Place the on true result in the Office Name item in the target schema document E altova no relation El Altova _Hierarchica gt E Altova a resulti ff filter P mere bool orl falsel i bo M Lt Jt Lt lo al baal PrimarnyKey m Foreignkey ip Desc EMail Established bs E Y Address Fax gt lt Prima ip Name i Y Foreig B i se en ee Lt Lt Lt wt Lt Li The result of the above mapping is shown below both Altova office names appear under the Office element zFxml
248. ame method as before to insert the second XML instance file 1 Click the Insert Schema XML instance icon 2 Select the mf ExpReport xsdi file from the Open dialog box click Yes and select the mf ExpReport2 xml file as the XML instance file 3 Click the expense report entry hit the key on the numeric keypad to view all items and resize the component if necessary For the sake of clarity the new component has been placed between the two existing ones in the following graphics Loa Lp 3 m CashAdvance b E Employee 2 a Y Title i Mame a Tel i Email sret Y DomesticD ailyF 3 seve Y ForeignDailyRa cette Expense detail A Y expense item mi i m C Meal m Lodging Ha i Travel P feeen means L kara H rof E sp epart E expense report detailed oe currency 15 tY Person First sale Last Y Title 3 Phone oo Email we d bool Fee Fee ee I p wt T p boa sss Tray cost ae Y Destination ow Y Mileage ac Y Parking E Entertainment fa 3 Misc ac Y description ar ya ee kaa bed I Lt Le Li hal ha lara _ P 2 See E I ELJ IL I ut Li Lt Li ut bad bs ol Le Le Le 2 b Currency l gt Date a Travel i l Travel Cost iol baal mer he Oe I 1s Lt LJ LJ Li T Y expense item ae type 3 See expto Fo Se I LJ 1
249. an be reused to display different files one after another This object is a complete ActiveX control CLSID DFBBOS71 DAFE 4502 BB66 0S8CEB DF5255 ProgID Altova MapForceControlDocument Properties The following properties are defined ReadOnly IsModified ZoomLevel Path Appearance Borderstyle Access to MapForceAPI Document Appearance Property Appearance as short Dispatch Id 520 Description A value not equal to 0 displays a client edge around the document control Default value is 0 BorderStyle Property BorderStyle as short Dispatch Id 504 2006 Altova GmbH Altova MapForce User Manual 572 MapForceControl Object Reference Description A value of 1 displays the control with a thin border Default value is 0 Document Property Document as Document Dispatch Id 3 Description The Document property gives access to the Document object of the MapForce automation server API This interface provides additional functionalities which can be used with the document loaded in the control The property is read only IsModified Property 1sModified as boolean read only Dispatch Id 1006 Description IsModified Is true if the document content has changed since the last open reload or save operation It is false otherwise Path Property Path as string Dispatch Id 1005 Description Sets or gets the full path name of the document loaded into the control ReadO
250. an o IsFractionDigis boolean IsWhiteSpace_foocolean o IsPattern boolean S A 2006 Altova GmbH Altova MapForce User Manual 458 Code Generator The way to SPL Spy Programming Language IsEnumeration boolean Enumeration Enumeration collection Holds a collection of Enumeration objects if this facet is of type enumeration Enumeration Abstraction of an enumeration entry inside a facet Name Type Description Index integer a RSS O the index of this enumeration value starting with 1 Value string Holds an enumeration value Altova MapForce User Manual 2006 Altova GmbH Chapter 26 The MapForce API 460 The MapForce API 26 The MapForce API The COM based API of MapForce enables clients to easily access the functionality of MapForce As a result it is now possible to automate a wide range of tasks MapForce follows the common specifications for automation servers set out by Microsoft It is possible to access the methods and properties of the MapForce API from common development environments such as those using C C and VisualBasic and with scripting languages like JavaScript and VBScript The following guidelines should be considered in your client code e Do not hold references to objects in memory longer than you need them If a user interacts between two calls of your client then there is no guarantee that these references are still valid e Be aware that if your client code crashes i
251. ange it to Split once Mode ted length Orientation horizontal Split line 1 Splitbase head General outgassing poll 2 1100 897 22 1 716235 L 3 1110 9852 22991 50 002 4 1120 1213 33 01 008 50 2006 Altova GmbH Altova MapForce User Manual 266 FlexText Creating split conditions Two new containers are created The default settings can remain as they are because we now want to split off the first line of this text fragment and ignore it The remaining fragment in the lower container will be made into a CSV file 4 Click the top container and change it to Ignore Mode Hed length Onentation hornzontal Split line 1 Split base head 1100 897 22 1 716235 L 9 1110 9832 22991 30 002 4 1120 1213 33 01 008 50 Split once be 1 1100 697 22 1 71 2 1110 9832 22991 3 1120 1213 33 01 1 The text fragment and thus mapping item of this container has now been made unavailable for mapping in MapForce 5 Click the lower container icon and change it to Store as CSV Split once Mode Hed length Onentation horizontal Split line 1 Split base head Telii00 697 22 1 71 S LL10 9832 22991 w120 1213 33 01 Record separator Field separator Quote character Escape character First row contains held names no Field Type string AL i 2 3 1100 jeg 1110 5832 1120 lala The container now shows the text fragment in a tabular form The def
252. anism with the provided information The following text describes how to deal with errors raised from the MapForce API in different development environments VisualBasic A common way to handle errors in VisualBasic is to define an error handler This error handler can be set with the On Error statement Usually the handler displays an error message and does some cleanup to avoid spare references and any kind of resource leaks VisualBasic fills its own Err object with the information from the LErrorInfo interface Example Sub Validate place variable declarations here set error handler On Error GoTo ErrorHandler if generation fails program execution continues at ErrorHandler objMapForce ActiveDocument GenerateXSLT additional code comes here exit Exit Sub RrrorHandler MsqgBox Error amp Err Number vbOb Jecthrror amp Chr 13 amp Description amp Err Description End Sub JavaScript The Microsoft implementation of JavaScript JScript provides a try catch mechanism to deal with errors raised from COM calls It is very similar to the VisualBasic approach in that you also declare an error object containing the necessary information Example Function Generate please insert variable declarations here try objMapForce ActiveDocument GeneratexSLT catch Error 2006 Altova GmbH Altova MapForce User Manual 470 The MapForce API Overview sError
253. apForceOverviewWnd MapForceControllLib MapForceControlPlaceHolderClass type MapForceControlLib MapForceControlPlaceHolderClass m_MapForceOverview axM apForceControlOverview GetOcx type AssignMultiDocCtrl MapForceControlLib MapForceControlClass axMapForc eControl GetoOcx gt m_MapForceOverview Show The MapForceOverviewWnd is created and shown here In addition a special method of the Placeholder control is called in order to connect the MapForcecontrol to it AssignMultiDocCtri1 takes the MapForceControl as parameter and registers a reference to it in the Placeholder control Retrieving Command Information The MapForceControl gives access to all commands of MapForce through its CommandsStructure property The example project uses the MapForceCommands and MapForceCommand interfaces to dynamically build a menu in the MDI Frame window which contains most of the MapForce commands The code to add the commands is placed in the MD Main method of the MapForceApplication Class in the file MDIMain cs public MDIMain 2006 Altova GmbH Altova MapForce User Manual 538 MapForceControl Integration at Document Level MFLib MapForceCommands objCommands objCommands axMapForceControl CommandsStructure long nCount objCommands Count torilong idx O idx lt mCount idxt MFLib MapForceCommandobjCommand objCommand objCommands int idx We are looking for the Menu with the name IDR_MAPFORCE
254. aracters or different numbers for the same character Any given computer especially servers needs to support many different encodings yet whenever data is passed between different encodings or platforms that data always runs the risk of corruption Unicode is changing all that Unicode provides a unique number for every character no matter what the platform no matter what the program and no matter what the language The Unicode Standard has been adopted by such industry leaders as Apple HP IBM JustSystem Microsoft Oracle SAP Sun Base and many others Unicode is required by modern standards such as XML Java ECMAScript JavaScript LDAP CORBA 3 0 WML etc and is the official way to implement ISO IEC 10646 It is supported in many operating systems all modern browsers and many other products The emergence of the Unicode Standard and the availability of tools supporting it are among the most significant recent global software technology trends Incorporating Unicode into client server or multi tiered applications and web sites offers significant cost savings over the use of legacy character sets Unicode enables a single software product or a single web site to be targeted across multiple platforms languages and countries without re engineering It allows data to be transported through many different systems without corruption Windows NT4 0 2000 XP Altova s XML products provide full Unicode support To edit an XML docum
255. are NOT used if the specific command line parameters are not supplied during command line execution of the generated EXE file e g mapping exe In this case the default or data supplied by the connected item is used c Command Prompt Co tmp userdef ined funct ions mapping Mapping Application WARNING Mo parameters givent SYNTAX Mapping exe in Hind ind Hote If you want to use spaces as values write them inbetween double quote OK Co tmpsuserdefined functions gt mapping TrueWal 2 Mapping Application OK 2006 Altova GmbH Altova MapForce User Manual 98 MapForce How To Filtering database data by date 6 8 Filtering database data by date The example below shows how you can use the filter component to filter out database records according to a specific date The Established field is defined as a Date Time field in the database e The comparison date is entered into a Constant component and is of type string If the date record is greater than 1995 03 03 only then are the respective Office data passed on to the target file by the filter component E altova a mE Address 3 HE Altova l Department 3 Fizz Office m PrimaryKey int i0 0 gt m Foreignkey int i0 0 gt ip Desc nvarcharl 55 EMail nvarchar 255 ie Established datetime f Fax nvarchar 255 gt ie Name nvarcharl 55 ir Phone ryvarcharl 55 GE Address He Department SHE Altova 7995 03 03 gt
256. are currently not available To use a function in Mapping window 1 First select the programming language you intend to generate code for by clicking one of the output icons in the title bar XSLT XSLT2 XQ Java C or C The functions associated with that language are now visible in the Libraries window The expand and contract icons show or hide the functions of that library Click the function name and drag it into the Mapping window Use drag and drop to connect the input and output parameters to the various icons Ohm Note that placing the mouse pointer over the result xxx expression in the library pane displays a ToolTip describing the function in greater detail Function tooltips Explanatory text visible in the libraries pane on individual functions can now be toggled on off Altova MapForce User Manual 2006 Altova GmbH MapForce overview Functions and libraries 17 by clicking the Show tips icon in the title bar Placing the mouse pointer over a function header displays the information on that function To add new function libraries MapForce allows you to create and integrate your own function libraries please see the sections Adding custom function libraries Adding custom XSLT 1 0 functions Adding custom XSLT 2 0 functions and User defined functions for more information Please note custom functions libraries can be defined for Java C and C as well as for XSLT Extendable functi
257. as specified Altova MapForce User Manual 2006 Altova GmbH The MapForce API Object Reference 491 2006 Altova GmbH Altova MapForce User Manual 492 The MapForce API Object Reference 26 2 6 ErrorMarker Properties and Methods Properties to navigate the object model Application Parent Access to message information Application Property Application as Agplication read only Description Retrieves the application s top level object Errors 1900 The object is no longer valid 1901 Invalid address for the return parameter was specified DocumentFileName Property Document FileName as String read only Description Retrieves the name of the mapping file that the error marker is associated with Errors 1900 The object is no longer valid 1901 Invalid address for the return parameter was specified ErrorLevel Property BrrorLevel as ENUMCodeGenErrorLevel read only Description Retrieves the severity of the error Errors 1900 The object is no longer valid 1901 Invalid address for the return parameter was specified Highlight Method Highlight Description Highlights the item that the error marker is associated with If the corresponding document is not open it will be opened Errors 1900 The object is no longer valid 1901 Invalid address for the return parameter was specified 1008 The marker points to a location that is no longer valid Altova MapForce User Manual
258. assumed no support for other encoding styles encodingStyle attribute is ignored in messages SOAP 4 1 1 e href to external resources are currently not supported SOAP 5 4 1 e references are only supported to independent elements Linear access supported partial arrays sparse arrays are currently not supported not supported not supported not validated passed on to underlying framework non namespace entries are invalid WSDL and are therefore not supported WSDL and XML 1 0 Altova MapForce User Manual 2006 Altova GmbH MapForce and Webservices Creating webservice projects from WSDL files 349 21 2 Creating webservice projects from WSDL files Aim of the webservice project To create a webservice that allows a user to e Search for a specific set of persons in an MS Access database on a server using a SOAP Request The query is defined entered at run time on the client and is then sent to the server e Retrieve the database records as a SOAP Response taking the form of an XML document sent back to the client containing all persons conforming to the query Please note The mapping process used to generate the webservice does not depend on the target programming language it is identical when generating Java or C webservices The differences only arise when you compile and or deploy the webservice on the webserver Creating a webservice project 1 Select the menu option File New 2 Click the
259. asti gt EEJOutput getPersonsocap0ut Jpart query e Elpatt Result y A nl Person Y First fi eua a Title Pel xa ih Her PhoneEXT noderow on true a proderow onte y e y O Emai EET The quey value gt a E lt Fault getPersonSoapError value2 result ElG2part Fault values El Y ShontDesc i LongDesc Long descriptiorr The example above shows how exceptions are defined in mappings The exception should be triggered when the Soaplnput equals badquery e The equal component checks to see if query equals badquery and the bool result is passed on to the filter component e When the condition is satisfied i e True the on true parameter of the filter component activates the GetPersonSoapFault exception and the mapping process is stopped Note that you can also connect the exception to the on false parameter if that is what you need e Two sets of error text are supplied by the SoapFault message Please note lt is very important to note the filter placement in the example e Both parameters of the filter component on true and on false must be mapped One of them needs to be mapped to the fault component and the other to the target component that receives the filtered source data If this is not the case the fault component will never be triggered e The exception and target components must be directly connected to the filter component Functions or other components
260. at you have purchased Software that is introduced as separate product is not included in SMP Maintenance releases updates and upgrades may or may not include additional features In addition Altova will provide Priority Technical Support to you for the duration of the Support Period Priority Technical Support is provided via a Web based support form only and Altova will make commercially reasonable efforts to respond via e mail to all requests within forty eight 48 hours during Altova s business hours MO FR 8am UTC 10pm UTC Austrian and US holidays excluded and to make reasonable efforts to provide work arounds to errors reported in the Software During the Support Period you may also report any Software problem or error to Altova If Altova determines that a reported reproducible material error in the Software exists and significantly impairs the usability and utility of the Software Altova agrees to use reasonable commercial efforts to correct or provide a usable work around solution in an upcoming maintenance release or update which is made available at certain times at Altova s sole discretion If Altova in its discretion requests written verification of an error or malfunction discovered by you or requests supporting example files that exhibit the Software problem you shall promptly provide such verification or files by email telecopy or overnight mail setting forth in reasonable detail the respects in which the Software fails
261. atch err WScript Echo Can t access or create MapForce Application Mt open an existing mapping adapt this to your needs ob jMapForce OpenDocument objFSO GetAbsolutePathName Test mfd jf en access toe mapping to Nave access to the code generation metneds var objDoc objMapForce ActiveDocument ff set the code generation output properties and call the code generation methods Ly ees adapt the ootput directories to your needs try code generation uses some of these options var objOptions obJ MapForce Options i Heo g nerate XLI 2006 Altova GmbH Altova MapForce User Manual 464 The MapForce API Overview objOptions XSLTDefaultOutputDirectory C test TestCOMServer XSLT objDoc GenerateXSLT aa generate Java Code objOptions CodeDefaultOutputDirectory C test TestCOMServer Java ob jDoc GenerateJavaCode generate CPP Code use same cpp code options as the last time objOptions CodeDefaultOutputDirectory C test TestCOMServer CPP objDoc GenerateCppCode fo Se generate C Code use options C code options as the last time objOptions CodeDefaultOutputDirectory C test TestCOMServer CHash catch ob jDoc GenerateCHashCode err ERROR while generating XSL or program code err hide MapForce to allow it to shut down objMapForce Visible false Sat A ee E Sno G22 l SSS 6S SS Altova MapForce U
262. ate gt xueLitemplate name Total gt nEli param name string gt ueLivalue at select sumltstring Product Price gt xelitemplate gt ueli stylesheet 1 Click the Add Libraries button and select the Libraries tab of the Options dialog box 2 Click the Add button and select the Summing nodes xslt file from the MapforceExamples Tutorial folder 3 Drag in the Total function from the newly created Summing nodes library and create the mappings as shown below Altova MapForce User Manual 2006 Altova GmbH Aggregate functions summing nodes in XSLT1 and 2 245 5 4 5 4 Input gt EE gt E gt Output s E Y Products string result wo Total E Product g t Product Amount 4 Amount 4 Price ow Price 4 Click the Output tab to preview the mapping result lt Yximl version 1 0 encading LITF e r stpt mins xais http Saws ws org 2001 AML Schema instance xsi noa lt Total 25 lt T otal gt lt Product Name Product4 lt Mame o sAmount 1 O mount lt Price S lt Price lt Product 5 lt Product i lt Name ProductB hMame E mount 5 lt 4maunt i lt Price gt 20 lt Price gt lt Product lt lutput The two Price fields of both products have been added and placed into the Total field To sum the nodes in XSLT 2 0 e Change the stylesheet declaration in the template to version 2 0 Txuml version 1 0 encoding UTF a 7 gt
263. ater less a fi concat logical and 7 alue EI logical not g alue El result logical or E not equal values E I yt B Add Libraries Mapping Output Messages q Seer enttee et a CompletePO mfd Mapping validation successful 0 errorfs 0 warning s Once the integration package has been installed you will be able to use MapForce in the Visual Studio NET environment Altova MapForce User Manual 2006 Altova GmbH MapForce plug in for MS Visual Studio _NET Opening MapForce files in MS VS NET 363 22 1 Opening MapForce files in MS VS NET To open a new MapForce mapping file 1 Select the menu option File New 2 Click the MapForce Files entry in Categories New File Categories Templates General isual Studio installed templates E web visual C Bey New MapForce Mapping Script MapForce Files aMLSpy Editor Files Creates anew MapForce mapping 3 Double click the New MapForce Mapping item in the Templates window An empty mapping file is opened 7 MFD File1 mfd Microsoft Visual Studio Fie Edit View Debug Insert Component Connection Function Output 1 amp q En _ MFD File1 mfd Start Page ls vi a L T cn Be a E T X 4 2 a5 x Happing Output Messages a a To enable the Libraries window 1 Select the menu item View MapForce Library Window 2006 Altova GmbH Altova MapForce User
264. ater Both MapForce and XMLSpy generate complete project and solution workspace files for Visual C 6 0 Visual C 7 1 Visual Studio NET 2003 and 2005 directly sin and vcproj files are generated in addition to the dsw dsp files for Visual Studio 6 0 Please note When building C code for Visual Studio 2005 and using a Xerces library precompiled for Visual C 6 0 a compiler setting has to be changed in all projects of the solution 1 Select all projects in the Solution Explorer 2 Project Properties Configuration Properties C C Language 3 Select All Configurations 4 Change Treat wchar_t as Built in Type to No Zc wchar_t C The generated C code uses the NET XML classes System Xml and can be used from any NET capable programming language e g VB NET Managed C J or any of the several languages that target the NET platform Project files can be generated for Visual Studio NET 2003 2005 and Borland C Builder Java The generated Java output is written against the industry standard Java API for XML Parsing JAXP and includes a JBuilder project file and an ANT build file Generated output in MapForce Generated output Location MapForce Standard libraries Altova folder m Schema wrapper libraries Schema name folder v Database wrapper libraries Database name folder T EDI wrapper libraries EDI name folder m Application Mapping application complete app T Compiling and executing perfor
265. ation at Document Level 529 27 2 Integration at Document Level Integration at document level gives you freedom over instantiation and placement of the following parts of the MapForce user interface Editing windows for MapForce mappings MapForce overview window MapForce library window MapForce validation window MapForce project window If necessary a replacement for the menus and toolbars of MapForce must be provided by your application You will need to instantiate and access multiple ActiveX controls depending on which user interface parts you want to re use All these controls are contained in the MapForceControl OCX e Use MapForceControl to set the integration level and access application wide functionality e Use MapForceControlDocument to create any number of editor windows It may be sufficient to create only one window and re use it for different mapping files depending on your needs e Optionally Use MapForceControlPlaceholder to embed MapForce overview library validation and project windows e Access run time information about commands menus and toolbars available in MapForceControl to seamlessly integrate these commands into your application s menus and toolbars See Use MapForceCommands for more information If you want to automate some behaviour of MapForce use the properties methods and events described for the MapForceControl MapForceControl Document and MapForceControlPlaceHolder Consider using
266. ault settings can be retained Configuring the CSV file If you want to change the field names click the field in the table and then change the entry in the Name field Columns can also be appended inserted and deleted in this container please see Store as CSV for more information We can now continue with defining the remaining text fragment Altova MapForce User Manual 2006 Altova GmbH FlexText Defining multiple conditions per container fragment 267 19 4 Defining multiple conditions per container fragment FlexText allows you to define multiple conditions per text fragment using the Switch container An associated container is automatically allocated to each condition that you define The current state of the tutorial at this point is that lower text fragment of the first Split once container has been defined e A Split once container splits off the first line into an Ignore container e The remaining segment is defined stored as a CSV file Split once Mode delimited line based Separator General Split base head outgassing pollutant 1100 897 22 1 716235 L0x Split once Mode fed length Orientation horizontal Split line 1 Split base head 1 Click the top container icon and change it to Repeated split 2006 Altova GmbH Altova MapForce User Manual 268 FlexText Defining multiple conditions per container fragment amp Block s M ode ted length Onentation horizontal
267. avel Travel Cost 337 ga sfexpense tem lt expense item Currency USD Bill to 4 ccounting i Date 2003 07 07 Date Pf eTravel Travel Cost 1014 22 sfexpense tem sexpense item Currency USD Bill to Marketing Date gt 2003 02 02 Date ff eTravel Travel Cost 2000 sfexpense tem Employee lt flompany gt moa mh E Ww hI Please note The on false parameter of the filter component outputs the complement node set that is mapped by the result parameter In this example it would mean all non travel expense items The number of expense items have been reduced to three Checking against the supplied mf ExpReport xml file reveals that only the Travel records remain the Lodging and Meal records have been filtered out Altova MapForce User Manual 2006 Altova GmbH MapForce tutorial Generating XSLT 1 0 and 2 0 code 45 3 5 Generating XSLT 1 0 and 2 0 code MapForce generates two flavors of XSLT code l 2 3 Select the menu item File Generate code in XSLT 1 0 or XSLT 2 0 Select the folder you want to place the generated XSLT file in and click OK A message appears showing that the generation was successful Navigate to the designated folder and you will find the XSLT with the file name MapToExpReport Target xslt To transform the personal expense report to the company expense report Having installed either XMLSpy or Authentic Desktop you can easily transform the source to the
268. bH Altova MapForce User Manual 170 MapForce CSV and Text files Mapping CSV files to XML bi Text import export x Input Output File fram Files ValtovaM apForce2 005M apForceE samples T utorahAlora_ cev cew Input file Output file Cancel Input fle encoding itthe endian byte order lu code UTF 8 a Big endian byte order CY Settings Field delimiter Text enclosed in fe coy C Tab Semicolon Comma Space Custom c Hot f fe r Fixed First row contains field names Field Field4 Fields string string string So Wucallabyienanoanull com Office Manager Further 47 tuthernanonull com Accounts Receivabl Matize J63 lmatisegnanonull com Accounting Manage Firsthbread B21 firstbreadi nanonull com Marketing Manager E Sanna Po s sannacenanonull cam Art Director a i Ze 2 Click the Input file button and select the CSV file e g Altova_csv csv The file contents are now visible in the Preview window Please note that the Preview window only displays the first 20 rows of the text file 3 Click into the Field1 header and change the text e g First name Do the same for all the other fields e g Last name Tel extension Email and Position Tel extension Email Position string string string So Wicallabyicenanonull com Office Manat 471 fturthereinanonall comn Accounts Re Lmatiseginanonull com Accounting t B21 firsthreadminan
269. base feature matrix MF set save point SAVE TRANSACTION MF rollback to save point ROLLBACK MF used init Statements Having defined relationships between tables using the Sybase sp_primarykey and sp_foreignkey procedures it is additionally necessary to use ALTER TABLE to add a constraint to the table describing the foreign key relationship to have the primary foreign relationships appear in MapForce Altova MapForce User Manual 2006 Altova GmbH MapForce and Databases Database feature matrix 153 7 5 6 Database info IBM DB2 IBM DB2 supported own authentication uses local windows user accounts see own authentication not supported by MapForce Trusted authentication Connection y y y n y y via ODBC MF used init Statements none MF used final Statements none support for DB schemas identity support MF read back identity value y y identity_val_local sub select support y y JOIN support UPPER olol JIT Wi ow m Ololo J a DB object name qualification MF upper function SQL exec multiple stat in one command separator special error handling ee retrieve parameter types n special issues when using SQL Execution mr V O fe Flat transactions supported Start flat transaction via execution of SQL command Nested transactions supported n y n y n n not supported by DB2 y S set tra
270. bility of XPath 2 0 functions unparsed text The href attribute accepts i relative paths for files in the base uri folder and ii absolute paths with or without the file protocol Altova MapForce User Manual 2006 Altova GmbH Appendices Engine information 587 28 1 3 XQuery 1 0 Engine Implementation Information The Altova XQuery 1 0 Engine is built into Altova s XMLSpy and MapForce XML products It is also available in the free AltovaXML package This section provides information about implementation defined aspects of behavior Standards conformance The Altova XQuery 1 0 Engine conforms to the World Wide Web Consortium s W3C s XQuery 1 0 Candidate Recommendation of 8 June 2006 The XQuery standard gives implementations discretion about how to implement many features Given below is a list explaining how the Altova XQuery 1 0 Engine implements these features Schema awareness The Altova XQuery 1 0 Engine is schema aware Encoding The UTF 8 and UTF 16 character encodings are supported Namespaces The following namespace URIs and their associated bindings are pre defined Namespace Name Prefix Namespace URI XML Schema types http www w3 org 2001 XMLSchema Schema instance http www w3 org 2001 XMLSchema instance Built in functions http www w3 org 2005 xpath functions Local functions http www w3 org 2005 xquery local functions The following points should be noted e The Altova XQuery 1 0 Engine
271. bined gt a E expense repart gt E Y Company oe detailed T5 Employee oe Title i ane Name ho i i laal r baad i SS CUIreNcy a Y Person y First Last on Title ee Phone i Email y Expense detaill g expense item p E E expense item be Lal ho kara ho ba Leal pA Email I i Y DomesticD ailyRate baad baal A la ai i Y ForergnD ailyR ate m karai To i i i i i a i Le Lt oJ Li Le Lt L to al be Te a i D ee i T Lt Lt Lt Jt Li Li Lt Jt Lt L h i i t i i i i i i gt b i i i wt LER LER LER Lt wt Lt Li Make sure that the Auto connect child items icon is deactivated before you create the following mappings Create the following mappings between the two components e Expense report to Company Person to Employee Last to Name Title to Title Phone to Tel Email to Email expense item to expense item Travel to Travel and 2006 Altova GmbH Altova MapForce User Manual 54 MapForce tutorial Mapping multiple source items to single target items e Trav cost to Travel Cost The mapping is shown below E mi EspReport E Y expense report detailed oon Currency a Y Person lt First sates Last Y Title wow Phone oe Email g Y expense item H koai kog kog kosi r
272. bjProject Item Q0 objFolderl CreateFolder New Folder 2 objFolder2 new Enumerator objFolderl item an alternative to Item 0 add two different mappings to folder structure objFolderl AddFile strSamplePath DB Altova_SQLXML mfd objMapForce Documents OpenDocument strSamplePath InspectionReport mfd objFolder2 AddActiveFile override code generation settings for this folder objFolder2 CodeGenSettings_UseDefault false objFolder2 CodeGenSettings_OutputFolder strSamplePath Samp leCutput objFolder2 CodeGenSettings_Language 1 fi Cte insert Web service project based on a wsdl file from the installed examples objProject InsertWebService strSamplePath TimeService TimeService wsdl http www Nanonull com TimeService TimeService TimeServiceSoap true objProject Save if objProject Saved WScript Echo problem occurred when saving project dump project tree strGlobalText PrintProjectTree new Enumerator ob jProject WScript Echo strGlobalText catch err ERROR while creating new project err 2006 Altova GmbH Altova MapForce User Manual 468 The MapForce API Overview _ Generate code for a project s sub tree Mix default code generation parameters and overloaded parameters _ fun
273. bold and italic elements are both of type xsd string they have not been defined as recursive in this example i e neither bold nor italic are of type TextT ype e bold and italic elements can appear any number of times in any sequence within para e any number of text nodes can appear within the para element interspersed by any number of bold and italic elements Source XML instance A portion of the XML file used in this section is shown below Our area of concern is the mixed content element para along with it s child nodes bold and italic Please note that the para element also contains a Processing Instruction sort alpha ascending as well as Comment text Company details which can also be mapped see mixed content settings lt Yxml Yersian 1 0 e OTF 8 7 l edited with MiLSpy v2005 sp2 U http iw altova com by Mr Mobody 4itova GmbH gt OrgChart emina sie htta AAW w3 Org 200 MMLSchema instance xetnohlamespaceschemaLocation Tut OrgCchart xsd gt sLompanyLaga hret nanonull gif l lt Name Organization Chart Mame lt OTfice gt i Mame Manonull Inc lt hMame gt Desc para The company was established insbold gt Yerenossbold in 1995 Manonull eelas nangelectronic technologies tor italic muti core proacessors lt talic February 1999 savy the unveiling of the first prototype lt bold Nano grid bold The company hopes to expand its operations stalic ottshore talic to drive down operational
274. brarzFolder 8 eProjectitemT ype ResourceFolder 9 eProjectitemType_VirtualFolder 10 See also Project Iten Kind 2006 Altova GmbH Altova MapForce User Manual 520 The MapForce API Enumerations 26 3 6 ENUMProjectType Description Enumeration values to select a project type for generated C mapping code Possible values eVisualStudioProject eVisualStudio2003Project eBorlandProject eMonoMakefile eVisualStudio2005Project Hol ou ue oil RWNM OO See also Code Generation Altova MapForce User Manual 2006 Altova GmbH The MapForce API Enumerations 521 26 3 7 ENUMViewMode Description Enumeration values to select a MapForce view Possible values eMapForceView 0 eXSLView eOutputView 2 2006 Altova GmbH Altova MapForce User Manual Chapter 27 MapForceControl 524 MapForceControl 27 MapForceControl MapForceControl is a control that provides a means of integration of the MapForce user interface and the functionality described in this section into most kinds of applications ActiveX technology was chosen so as to allow integration using any of a wide variety of languages this enables C C VisualBasic or HTML to be used for integration All components are full OLE Controls which makes integration as simple as possible Two different levels of integration are provided thus enabling the integration to be adapted to a wide range of needs For a successful integration you have
275. bsolute value is less than 0 000001 or greater than 1 000 000 Otherwise decimal or integer notation is used Precision of xs decimal The precision refers to the number of digits in the number and a minimum of 18 digits is required by the specification For division operations that produce a result of type xs decimal the precision is 19 digits after the decimal point with no rounding Implicit timezone When two date time Or dateTime values need to be compared the timezone of the values being compared need to be known When the timezone is not explicitly given in such a value the implicit timezone is used The implicit timezone is taken from the system clock and its value can be checked with the fn implicit timezone function Collations Only the Unicode codepoint collation is supported No other collations can be used String comparisons including for the fn max and fn min functions are based on this collation Namespace axis The namespace axis is deprecated in XPath 2 0 Use of the namespace axis is however supported To access namespace information with XPath 2 0 mechanisms use the fn in scope prefixes fn namespace uri and fn namespace uri for prefix functions Static typing extensions The optional static type checking feature is not Supported Functions Support The table below lists in alohabetical order the implementation specific behavior of certain functions The following general points should be noted
276. cal functions math functions string functions l4 4 bk bl Overview Validation EE USET First Last Add Libraries Ready Click the Home button za to return to the mapping window The three functions have now been combined into a single function called First_Last User defined functions of type Inline are displayed with a dashed outline 2006 Altova GmbH Altova MapForce User Manual 198 User defined functions E mf ExpReport gt E Y expense report exp an detailled i SEEE Currency F i Person o First_Last J Y First i Last Y Title cH result Connect the First and Last items to the input parameters of the user defined function and the result parameter to the Name item Dragging on the function name in the Libraries pane and dropping it in the mapping window allows you to use it elsewhere Please note Double clicking a user defined function displays the individual components in a tab of that name User defined functions can be defined to contain complex inputs outputs XML nodes etc as well as multiple output components Please see Standard user defined function and Complex user defined function for more information To delete a user defined function from a library 1 Double click the specific user defined function in the Libraries window The user defined function is visible in its tab 2 Click the Erase button in the title bar to delete the function user
277. cation instance that is visible is said to be controlled by the user and possibly by clients connected via the automation interface It will only shut down due to an explicit user request To shut down an application instance set its visibility to false and clear all references to this Altova MapForce User Manual 2006 Altova GmbH The MapForce API Object Reference 477 instance within your program The application instance will shut down automatically when no further COM clients are holding references to it Errors 1000 The application object is no longer valid 1001 Invalid address for the return parameter was specified WindowHandle Property WindowHandle as long read only Description Retrieve the application s Window Handle Errors 1000 The application object is no longer valid 1001 Invalid address for the return parameter was specified 2006 Altova GmbH Altova MapForce User Manual 478 The MapForce API Object Reference 26 2 2 MapForceView Properties and Methods Properties to navigate the object model Apolication Parent View activation and view properties Active ShowltemTypes ShowLibraryInFunctionHeader HighlightMyConnections HighlightMyConnectionsRecursivly Adding items InsertXMLFile Insert xMLSchema Insert XMLSchemaWithSample Active Property Active as Boolean Description Use this property to query if the mapping view is the active view or set this view to be t
278. cccccccssssssesssseseseeeeceeeeeeeeeeeaaas 597 285 24 Unicode SUP DOUG oi csereeesessacanscateesstatecaqvushecustensacaatnetoearsbosseaesuatucasnaneccemmeaicee 598 Windows NI 4 0 2000 XP sicsiessvovstavsvanzrenssanevasevasazenteeieiaaszasazenestneessesisaneaseeiees 598 Riohito Lei WIN S yster einnar rrea AA EE eee netst 599 Ba ee E e I T TA E I T E 600 2o Ligene Mit OG AIOM sesparenk eA EAE 601 28 3 1 Electronic Software Distribution cccccccccccccccceeeseseesssseesseeeceeeeeeeeeeeeaaas 602 25 32 License IMCS le seicrorsioirey nier eE A EA 603 Dor COPE a E setateauisssdeceoeteuc aeaaieesnectacasaeee 604 28 3 4 Altova End User License Agreement 2 0 0 0 ccccccccssssssesseeseeeeeceeceeeeeeeeaaas 605 Index Altova MapForce User Manual Chapter 1 MapForce 2006 MapForce 2006 3 1 MapForce 2006 MapForce 2006 Enterprise Edition is a visual data mapping tool for advanced data integration projects MapForce can generate custom mapping code in XSLT 1 0 and 2 0 XQuery Java C and C and supports Schema to Schema mapping Database to Schema XML mapping XML Schema to Database mapping Database to Database mapping EDI mapping UN EDIFACT and ANSI X12 to from XML Schema and database mapping Flat file mapping CSV and Text files as source and target e On the fly transformation and preview of database UN EDIFACT and ANSI X12 data without code generation or compilation e Accessing MapForce user interface
279. ce API Object Reference Errors 1000 The application object is no longer valid 1001 Invalid address for the return parameter was specified Parent Property Parent as Agplication read only Description The parent object according to the object model Errors 1000 The application object is no longer valid 1001 Invalid address for the return parameter was specified Project Property Project as Project read only Description Returns the MapForce project currently open If no project is open retuns mull Errors 1000 The application object is no longer valid 1001 Invalid address for the return parameter was specified Quit Method Quit Description Disconnects from MapForce to allow the application to shutdown Calling this method is optional since MapForce keeps track of all external COM connections and automatically recognizes a disconnection For more information on automatic shutdown see the Visible property Errors 1000 The application object is no longer valid 1001 Invalid address for the return parameter was specified Visible Property Visible as Boolean Description True if MapForce is displayed on the screen though it might be covered by other applications or be iconized False if MapForce is hidden The default value for MapForce when automatically started due to a request from the automation server MapForce Application Is false In all other cases the property is initialized to tre An appli
280. ce Reference View 407 24 9 View Show Annotations fa Displays XML schema annotations as well as EDI info in the component window If the Show Types icon is also active then both sets of info are show in grid form Show Types er Displays the schema datatypes for each element or attribute If the Show Annotations icon is also active then both sets of info are show in grid form Gi Show library in function header _ Displays the library name in parenthesis in the function title IMFO Show Tips L Displays a tooltip containing explanatory text when the mouse pointer is placed over a function p Show selected component connectors Switches between showing e all mapping connectors or e those connectors relating to the currently selected components Show connectors from source to target oe Switches between showing e connectors that are directly connected to the currently selected component or e connectors linked to the currently selected component originating from source and terminating at the target components Zoom Opens the Zoom dialog box You can enter the zoom factor numerically or drag the slider to change the zoom factor interactively Status Bar Switches the Status Bar visible below the Messages window on or off Library Window Switches the Library window containing all library functions on or off Messages Switches the Validation outpu
281. ce User Manual 16 MapForce overview Functions and libraries 2 3 Functions and libraries The Libraries pane displays the available libraries for the currently selected programming language as well as the individual functions of each library Functions can be directly dragged into the Mapping tab Once you do this they become function components Libraries a3 logical functions equal result a equal b egual or greal result a gt b egual or less result a lt b greater result a gt b less result a lt b math functions string functions xlt Lg xpath functions lang result lanaf string xl Add Libraries The standard core lang xpath2 edifact and xslt libraries are always loaded when you start MapForce and do not need to be added by the user The Core library is a collection of functions that can be used to produce all types of output XSLT XQuery Java C C The other libraries XSLT XSLT2 XPath2 Lang etc contain functions associated with each separate type of output Please note The XPath 2 0 library and its functions are common to both XSLT 2 0 and XQuery languages Selecting XSLT enables the core and XSLT functions XPath 1 0 and XSLT 1 0 functions XSLT2 enables the core XPath 2 0 and XSLT 2 0 functions XQ uery enables the core and XPath 2 0 functions XPath 2 0 restrictions Several XPath 2 0 functions dealing with sequences
282. ce User Manual 86 MapForce How To Mapping multiple tables to one XML file name in the schema i e Address is mapped to the row child element of the Address element amp Altova SOLXML gt ah Elz Address gt El 7 altova m PrimarpKey gt El lt altova fr ForeignKey A Address i i El row oe PrimarpKey i Lt Jt be ol r baal i re Lt lt be al io ad io a ka LE _t I m Lee S kagi Paa h r oe a Elz Altova 7 PrimaryKey ka Pa B y Altova E TOW oe Y Primarykey a bol ho Leer J bal si E Department E F row gE Department 4 Primarykey ePrimaryKey l m Foreignkey kaa r r E ar E p E ay E ae y agy y ay ag Prg f ho kra loal on es Lan e Please note that the above example DB_Altova_SQLXML mfd does not preserve the table relationships as mappings are created from several different root tables Altova MapForce User Manual 2006 Altova GmbH MapForce How To Mappings and root element of target documents 87 6 2 Mappings and root element of target documents Root element of target XML files When creating a mapping to the root element of the target Schema XML file please make sure that only one element or record is passed on to the target XML as an XML document may only have one root element Use the filter component to limit the mapped data to a sin
283. ces MapForce allows you to create webservices using an existing WSDL file designed in XMLSpy for example map data to from WSDL operations and generate program code in Java or C that implement the webservice All that remains is to compile the generated code and deploy the webservice to your specific webserver MapForce supports WSDL projects made up of individual mappings each of which represent a webservice operation Generating code for the entire WSDL project produces a complete webservice server Code can also be generated for individual operations mappings however Please note that this document does not discuss the various installation or configuration specifics of the necessary webserver software Please consult the documentation supplied with the software packages or have your IT department set up the software for you Prerequisites for generating and deploying Java webservices e g e Apache Jakarta Tomcat http akarta apache org tomcat index html e Apache Axis http ws apache org axis a SOAP framework running within Tomcat requires Java SDK 1 3 or later e A Java 2 Software Development Kit htto java sun com j2se e Apache ANT http ant apache org e MapForce Enterprise edition Prerequisites for generating C webservices e Visual Studio NET 2003 2005 e Microsoft Internet Information Services IIS verson 5 0 or later e MapForce Enterprise edition The MapForce project file and all other files
284. character ID at the beginning of the segment A group of related elements comprise a segment tag or segment ID ANSI X12 Segments of a transaction can be defined as mandatory or conditional optional Element An individual data field within a segment An element can be thought of as a field i e it contains one type of data a name or an address for example Elements can be further subdivided into composite elements consisting of component elements or subelements Separators Elements are delimited by separator characters In UN EDIFACT these are either default characters or defined in an optional UNA control segment Default characters colon component element separator plus data element separator apostrophe segment terminator Message envelope These are special Service segments ANSI X12 control segments known as the envelope header and envelope trailer pair In EDIFACT these are defined as UNH and UNT segments If several transactions of the same type are sent to the same recipient they can be grouped into a Group Envelope defined by a UNG UNE segment pair These messages thus have the same Group ID Interchange envelope These are a collection of Group envelopes and or messages for the same recipient 2006 Altova GmbH Altova MapForce User Manual 302 MapForce and EDI UN EDIFACT to XML Schema mapping 20 2 UN EDIFACT to XML Schema mapping The object of this exercise is to show how map data from UN
285. cle Create User defined Function Settings Function name Lookup rticle Library name Juser Inline recommended Allows complex parameters filters and multiple outputs Standard function Allows recursive calle A tab only containing only one item an output function is displayed 2006 Altova GmbH Altova MapForce User Manual 202 User defined functions Standard user defined function Libraries user Lookup rticle HE core logical functions math functions sting functions EMT result lang EE UZET Lookup rticle This is the working area used to define the user defined function A new library has been created in the Libraries pane with the name user and the function name LookupArticle 3 Click the Insert Schema XML file icon E7 to insert the Articles schema and select the XML file of the same name to act as the data source 4 Click the Insert input component icon to insert an input component 5 Enter the name of the input parameter ArticleNr in this case and click OK Create Input A a xX f Simple type integer string etc Datatype stririg a Comples type tree structure Structure Choose Foot Choose Cancel This component acts as a data input to the user defined function and supplies the input icon of the user defined function 6 Insert an equal component by dragging it from the core library logical functions group 7 In
286. click Next 2 Select the altova mdb database available in the MapForceExamples Tutorial folder and click Next 3 Select the Person table by clicking the corresponding check box in the Database Tables list box Create Schema Microsoft Jet Connection Access altora Ss Database Tables T able C Views O System Ba Altova Bs Department L me Uffice As Person Select All Deselect All Database Owners Select 4 DeselectAll Selected T ables Owner Table Ee Person Insert Mow Cancel Click the Insert Now button to create the database component Click the expand icon to see the table contents Drag the concat function from the libraries window into the Design tab Select the menu option Insert Constant click the Number radio button and enter 100 as the new telephone extension prefix Create the mapping as shown in the graphic below oo 2006 Altova GmbH Altova MapForce User Manual 184 MapForce CSV and Text files Mapping Fixed Length Text files to a database Person ih concat g value z result Balle Database Table Actions Person All input data are compared to the DE table data using the operators defined here IF all comparisons are true then the specitic action i executed Acton on input data Update if Append Actor fa Foreignkep E Cancel fa Primarykeyp Insert Action fa EH ail m First equal m Last m
287. clipse MapForce Editor View and Perspectives 375 2006 Altova GmbH Altova MapForce User Manual 376 MapForce plug in for Eclipse Importing MapForce examples folder into Navigator 23 4 Importing MapForce examples folder into Navigator To Import the MapForce Examples folder into the Navigator 1 Right click in the Navigator tab and click Import 2 Select File system then click Next 3 Click the Browse button to the right of the From directory text box and select the MapForceExamples directory in your MapForce folder 4 Activate the MapForceExamples check box This activates all files in the various subdirectories in the window at right File system Import resources From the local File system ai H 4 MapForceExamples PES altova_Hierarchical_DB mfd Altova Hierarchical xml rep Altova Hierarchical xsd eed Altova_SOLYML xsd HA i altova mdb altowa cmp xml Filter Types Select All Deselect All Into Folder MapForce Browse Options LI Oyerwrite existing resources without warning Create complete folder structure Create selected folders only Back Wexk gt Cancel 5 If not automatically supplied click the Browse button next to the Into folder text box to select the target folder then click Finish The selected folder structure and files will be copied into the Eclipse workspace 6 Double click a file in Navigator to open it Al
288. com Gr altowa T Mest Error A Previous Error Umeschalt F 12 ow fim cle pa gt Execute The build window displays a successful message when complete e Select the menu option Debug Start to execute the selected application Finish Umsch alt FS Running Attach Explorer Filesystems i Continue E Files ystems Pause Q E CiTempiMarketingExpense com AD Run to Cursor F4 altova gt Step Over FS Q maptorce E Step Irto F7 os ExpReport Step Out AlttUmechalt FF ta GoTo Called Method Strat AltOben 449 GoTo Calling Method Strg Alt Unten L Toggle Breakpoint Umschalt F2 S Add Breakpoint Strg Umschalt Fe Sh Add Watch Strgt UmechaltF HTTP Monitor g Debugger Window Strg 5 In both cases MappingApplication or MappingConsole the MarketingExpenses xml target file is created MappingApplication Altova MapForce User Manual 2006 Altova GmbH Code Generator Generating program code 423 So Mapforce Application THIS APPLICATION WAS GENERATED BY MAPFORCE 2004 http Away alto comimnaptorce Please check the input and output files and press the Start button Source instance of ExpReport xsd ciProjectsiF lesa MLS pyExeF older MapForceExamples ExpReport xml Instance of MarketingExpenses xsd IMarketingExpenses xm Loading C Projects Files 2NLSpyExeFolder MapForceExanples ExpReport xml saving MarketingExpenses xnl Finished MappingConsole T
289. cs cs E Altova FLF txt mR alp MapForceFlex Text mFt lak altowa no relation mdb z ExpRepu He alp new txt met FEW EDI Article xsd ow ExpRep fF alp test mFp OD EDIFACT Nanonull zip FEW ExpRep 4 altova mdb Ej ExpReport combined sps FR Flex tut File name Flex tutorial txt Files of type AI files x Cancel 5 Select the Flex tutorial txt file in the MapforceExamples Tutorial folder and confirm by clicking Open 8 1100 897 22 1 716235 LOx 5 9 1110 9632 22991 30 002 N0xER 10 1120 1213 33 01 008 50 The text file contents are now visible my Clicking the Node Text in Design view icon icon displays the active container contents in the Sample Text pane Activating Auto collapse unselected node text E displays the content in the active container all other containers which contain content are collapsed 2006 Altova GmbH Altova MapForce User Manual 264 FlexText FlexText Tutorial Container ship Mega O Microtome p Miscellaneous BE hir freight Mini Bb 00 cas Chromatograph 6 Click the container icon at the top right and select Split once from the pop up menu Two new containers appear next to the Split once container Mode ted length miii1 332 1 22 Onentation horizontal Split line 1 Split base head 1 Tey See eee cle ore or ee ech fe 2 111 81579227 10 3 400 Mi 3 111 B152427 7 6 1200 Mis 4i222 976 4 7563 1 69 ir 5 222 Z2Z80561 10 5 10000 6 YIisener
290. csv file supplies the Header records and all mapped fields to the Header item in the schema target file The filter component is used to filter out the H records The Rows item supplies these filtered records to the Header item in the schema file The second Orders csv file supplies the Detail records and all mapped fields by filtering out the Detail records that match the OrderNo key of the Header record This is achieved by e Comparing the OrderNo field of the Header record with the same field of the Detail records using the equal function the priority context is set on the a parameter for enhanced performance e Using the Logical and function to only supply those Detail records containing the same OrderNo field as the Header record The Rows item supplies these filtered records to the Header and Detail items in the schema file through the on true parameter of the filter function Clicking the Output tab produces the XML file displayed below Each Header record contains its data and all associated Detail records that have the same Order No lt xml version 1 0 encading LITF 8 gt Order xmins xsi http Shaw ss org 2001 AML Schema instance xsi schemaLocation lt Header lt Record ypesH Record ype OrderNord 11 lt 0rderho Total Vveight 332 1 Totalveight lt TotalUnitCost 22537 7 TotallnitCost Currency lt Shipping details Container ship Shipping details lt Detail i lt RecordTypesD Reco
291. ct the on false icon of the filter component with the expense item element of the second target schema document 2006 Altova GmbH Altova MapForce User Manual 48 MapForce tutorial Multiple target schemas documents E ExpReport T arget Preview a E Company Root element E Employee Title E E Name ho r a be si fy ExpReport T arget E Company Root element 4 Employee Title E he Name baal ia al i LI J ru J LI i YE mail DomesticDailyRate ForeignD ailyR ate i Email DomesticD ailyRate _ ForeignD ailyRate i Expense detail E expense item bes af bo al Li I L koni kog be af r i iw LI LI Li iw LI Lt bo al La _ it eu ru I it LI i oon 7 Expense detail E expense item on SS Currency ew E Currency om 5 Bilko Bilko Date gt Date E Travel 2 E Travel aA Ji fiter i I Travel Cost Frode ion eriuel i ODestination bool ornfalsel i oo 3 CarRental A message appears stating that you are now working with multiple target schemas documents 2 Click OK to confirm a Employee Employee E Title s 3 Title Name Name 2 oa Y Email An Preview icon is now visible in the title bar of each target schema component Clicking the Preview icon defines which of the target schema data is to be displayed whe
292. ction GenerateCodeForNewProject since the Web service project contains only initial mappings we generate code only for our custom folder code generation parameters from project are used for Folderl whereas Folder2 provides overwritten values objFolder objProject Item 0 objFolderl GenerateCode ite CEREAL COLE Cee CeCe ee OO SE CELE EP EL CELE LeeLee ee Cees CreateGlobalObjects objMapForce Visible true LoadSampleProject CreateNewProject GenerateCodeForNewProject uncomment to shut down application when script ends objMapForce Visible false Altova MapForce User Manual 2006 Altova GmbH The MapForce API Overview 469 26 1 4 Error handling The MapForce API returns errors in two different ways Every API method returns an HRESULT This return value informs the caller about any malfunctions during the execution of the method lf the call was successful the return value is equal to S_OK C C programmers generally use HRESULT to detect errors VisualBasic scripting languages and other high level development environments do not give the programmer access to the returning HRESULT of a COM call They use the second error raising mechanism supported by the MapForce API the IErrorInfo interface If an error occurs the API creates a new object that implements the TErrorInfo interface The development environment takes this interface and fills its own error handling mech
293. ctiveFile as ProjectIten Description Adds the currently active document to this project item if it is a valid child Otherwise the document is added to the Mapping Folder of the project s root Errors 1700 The object is no longer valid 1701 The file name is empty Invalid address for the return parameter was specified 1703 No active document is available 1704 Active documents needs to be given a path name before it can be added to the project 1705 Mapping could not be assigned to project The file does not exist or is not a MapForce mapping Maybe the file is already assigned to the target folder AddFile Method AddFile i_strFileName as String as ProjectIten Description Adds the specified document to this project item if it is a valid child Otherwise the document is added to the Mapping Folder of the project s root Errors 1700 The object is no longer valid 1701 The file name is empty Invalid address for the return parameter was specified 1705 Mapping could not be assigned to project The file does not exist or is not a MapForce mapping Maybe the file is already assigned to the target folder Application Property Application as Agplication read only Description Retrieves the top level application object Errors 1700 The object is no longer valid 1701 Invalid address for the return parameter was specified CodeGenSettings_ Language Property codeGenSettings_Language as ENUMProgrammingLanqua
294. ctly the same XML file that was produced in the above example E Orders inline key oy Field gt amp Field E i oo Field4 gt b Z Field5 Field6 i me Field s i ee Detail key 1 fF cans Field a Fieldi l oo Field11 i Field1 E Field 3 i Field14 gt Detail key2 N m Field16 gt b 5 Fieldi 7 aa Field18 gt t amp Field19 L Ee Field20 gt om Field gt ne Field 2 FEE HI ead key l Tut headerD etal G Order E 4 Header sae Record Type i ee Y O0rderNo H F Totaly eight 7 oa Y TotalUnitCost Currency i a Shipping details A Detail om Record ype 7 a Y OrderNo Producto Unitweight E i UnitNo UnitCost ow Unit description E Detail 2 oo RecordT ype 7 PR Y DrderNo ProductNo Uniteight UnitNo 7 Lasen 4 UnitCost oe CEU nit description aa kon bead pal s kon baal La a a kon eal r egi hh Eh i i Se i i i ae i i E Li wt Lt Lt Li i Lt Lt Lt wt Lt Lt Lt Jt Lt Lt Altova MapForce User Manual 2006 Altova GmbH MapForce CSV and Text files CSV file options 177 8 4 CSV file options Right click the Altova_csv component and select Component Settings to open the dialog box CSV Text import export options When defining field formats in this dialog box
295. cument in MapForce Activate the Auto connect child items icon If not already active 2 Click the Person table item in the database component and connect it to the Person item in MFCompany This creates connectors for all items of the same name in both components e a mE Address i n E Company i mH Altova E 4 Address l Department i l Office b Person s ho Se E Lt T7 ae a al it as Eaa C kag Le iw Lt Lt E Y Person cots Manager ot i Li r gr ka Programmer I Degree i faa Y First kaa kag ka ow Title PhoneE xt hanna E mail Te a a iw Lt LJ 1 Lt 4 Save the MapForce file PersonDB for example 5 Click the Output tab to see the result preview of this mapping The MapForce engine generates results on the fly without you having to generate or compile code Altova MapForce User Manual 2006 Altova GmbH MapForce tutorial Database to schema mapping 65 Generating Java code and the resulting XML file 1 Select the menu option File Generate code in Java 2 Select the directory you want to place the Java files in and click OK The Java Code generation completed message appears when successful 3 Compile the generated code and execute it The following MFCompany xml file is created lt Ysml Yersian 1 0 encoding LITF 3a Company smin xsi http iy ww org 2001 AML Scheme instance
296. cursive calls Inline user defined functions Support Complex input and output components i e XML schema nodes databases etc Multiple output components within a function Direct connection of filters to input components Exist type functions on input component e g exists not exists substitute missing is null is not null substitute null O Find rticle POArtN Y SinglePrice Amount 4 Price Inline user defined functions do not support e The setting of a priority context on a parameter e Recursive calls to user defined functions Code generation In essence an inline user defined component implements the constituent components of the user defined function instead of generating a function call All parameters are evaluated and purged If the user defined function is defined as inlined filters and exists like functions can be used because MapForce generates code that works exactly as the function s constituent components 2006 Altova GmbH Altova MapForce User Manual 200 User defined functions Inline vs Standard user defined functions Standard user defined function support e Only simple input components e Only a single output component e Recursive calls to user defined functions where the exit condition must be supplied e g use an If Else condition where one branch or value exits the recursion e Setting a priority context on a parameter M LookupPerzon HE Office_ Name fresult HE First
297. d first and then set the priority context on the connector to that table Please see Priority Context for a more concrete example To define a priority context e Right click an input icon and select Priority Context from the pop up menu lf the option is not available mapping the remaining input icons of that component will make it accessible 2006 Altova GmbH Altova MapForce User Manual 102 MapForce How To Node testing 6 11 Node testing The node testing functions allow you to test for the existence of nodes in the XML instance files Elements or attributes defined as optional in the XML Schema may or may not appear in the XML instance file Use these functions to perform the specific node test and base further processing on the result Exists Returns true if the node exists else returns false The HasMarketingExpenses mfd file in the MapForceExamples folder contains the small example shown below If an expense item exists in the source XML then the hasExpenses attribute is set to true in the target XML Schema file E ExpReport El expense report x BA e detailed fi concat concal e m SUNEN fy HasExperses l gt E resulti AE marketing expen pyalue3 gt ie Y Person oats total sum E Person Sin First E hasE xpenses i FullName Y Title Title 7 Phone i Y Email E expense ilem Jj exists ee ty
298. d function 201 sum 244 user defined 196 user defined changing type 196 user defined look up function 201 visual builder 196 functions importing user defined 196 mapping to 37 see under XSLT 2 0 functions 586 XPath 2 0 and XQuery 1 0 590 G Generate C code 424 C code 426 code 415 code example 430 code from schema 412 Java code 27 417 Java code JBuilder 418 Java code Sun ONE Studio 420 multiple target Java 50 multiple target XSLT 50 XQuery code 192 XSLT 27 generator function 139 Global customization EDIFACT 328 X12 340 Global objects in SPL 446 gradient background 440 Gradients in background 497 guid 139 H Help 409 Hierarchy from text files 174 table 114 HighlightMyConnections 478 HighlightMyConnectionsRecursively 479 Hotkeys Output window zoom factor 254 How to 84 HRESULT and error handling 469 HTML integration of MapForce 542 543 544 545 HTML example of MapForceControl integration 526 527 528 IBM DB2 database info 153 Ignore 288 Implementation 2006 Altova GmbH 622 Index Implementation function 228 implementation specific behavior of XSLT 2 0 functions 586 Implicit datatype 240 implicit timezone and XPath 2 0 functions 590 Import user def functions 196 Include XSLT 234 XSLT 2 0 240 Inline 196 Inline Standard user defined functions 199 Inline customization
299. d split oo All 222 Order No LJ 1 Li Li B E T The left component shows the initial structure before adding the new Node The right component shows how the component structure has changed All 111 is now a parent item and a new child item Store has been added below it 2006 Altova GmbH Altova MapForce User Manual 288 FlexText FlexText Reference 19 6 5 Ignore Allows you to suppress the output of a specific text fragment What this means is that the container and any data it may contain will not be made available as a mappable item in the FlexText component in MapForce Mode delimited floating 1 Separator General Splitonce MEE a CSY gt Split base head Y Mode fixed length Orientation horizontal Record separat Split line Split base head EA Field separator E alp ignore mft Sample Text 1 111 332 1 22537 7 5 Container ship Mega 2 111 481579227 10 3 400 Microtome BE 3 111 B152427 7 6 1200 Miscellaneous BF In the example shown above the active container has been set to Ignore The Sample text that it contains will therefore not appear as a mappable item in MapForce The text template when inserted into MapForce has the structure shown below There is no mappable item between the two Split once items i ignore e E 4 Split once 5 E 4 Split once gt EC CS gt i aot Field gt i Field 1 gt 5 o
300. d variables so they can be reused The Altova XQuery 1 0 Engine supports modules that are stored in a single external XQuery file Such a module file must contain a module declaration in its prolog which associates a target namespace Here is an example module module namespace libns urn module library declare variable Slibns company Altova declare function libns webaddress http www altova com All functions and variables declared in the module belong to the namespace associated with the module The module is used by importing it into an XQuery file with the import module statement in the query prolog The import module statement only imports functions and variables declared directly in the library module file As follows import module namespace modlib urn module library at modulefilename xq it Smodlib company Altova then modlib webaddress else error No match found External functions External functions are not supported i e in those expressions using the external keyword as in declare function hoo Sparam as xs integer as xs string external Collations The default collation is the Unicode codepoint collation No other collation is currently supported Comparisons including the n max function are based on this collation Altova MapForce User Manual 2006 Altova GmbH Appendices Engine information 589 Character normalization No character normalization form is supported
301. d with QueryStatus Count Property count as long Description Number of MapForceCommand objects on this level of the collection Item Property Item n as long aS MapForceCommand Description Gets the command with the index n in this collection Index is 1 based Altova MapForce User Manual 2006 Altova GmbH MapForceControl Object Reference 565 27 5 3 MapForceControl Properties IntegrationhLevel Appearance Application Borderstyle CommandshList CommandsStructure deprecated EnableUserPrompts MainMenu ReadOnly Toolbars Methods Open Exec WUServoetatlus Events OnDocumentOpened OnProjectOpened OnUpdateCmdUL OnCloseFditinqwindow This object is a complete ActiveX control and should only be visible if the MapForce library is used in the Application Level mode CLSID AS66389 9 5 759 4450 416 FOlTOUCCZ ZC ProgID Altova MapForceControl Properties The following properties are defined IntegrationLevel ReadOnly EnableUserPrompts Appearance Borderstyle Command related properties CommandsList MainMenu Toolbars CommandsStructure deprecated Access to MapForceAPI Application Appearance Property Appearance as short Dispatch Id 520 Description A value not equal to 0 displays a client edge around the control Default value is 0 2006 Altova GmbH Altova MapForce User Manual 566 MapForceControl Object Reference Application Property Ap
302. date output 254 XML instance absolute path 47 input 397 output 397 XML Parser about 596 XML to database mapping 111 XPath summing multiple nodes 244 XPath 2 0 functions general information about 590 implementation information 590 see under fn for specific functions 590 XPath functions support see under fn for individual functions 591 XPath2 library 16 XQuery 2006 Altova GmbH 630 Index XQuery adding custom functions 242 AltovaX Query engine 192 and databases 106 functions 16 generate code 192 XQuery 1 0 Engine information about 587 XQuery 1 0 functions general information about 590 implementation information 590 see under fn for specific functions 590 XQuery processor in Altova products 597 xs QName also see QName 591 xsd date time 312 xsl preserve space 582 xslI strip space 582 XSLT adding custom functions 234 boolean values 88 code generation 484 converter for customized EDI 322 generate multiple target 50 options 498 standard library 16 template namespace 234 XSLT 1 0 Engine limitations and implementation specific behavior 582 XSLT 1 0 2 0 generate tutorial 45 XSLT 2 0 adding custom functions 240 XSLT 2 0 Engine general information about 584 information about 584 XSLT 2 0 functions implementation specific behavior of 586 see under fn for specific functions 586 XSLT 2 0 stylesheet namespace declarations in 584 XSLT processo
303. de generator ODLIOING sissien Eea E E eA ES ENT 440 25 7 The way to SPL Spy Programming Language ccssseeseseeeeeeeeeeeeeeeeeeeaaeaaeeeeees 442 Altova MapForce User Manual 253 Code Blocks serene A A NE 443 2T LOES A A nis seoss ee sorias eecsansacons 444 RIT VDS e E E E oases 445 25 14 Global Objects seieriga a Oaea i 446 DD MISTI TANS a E astuareeeesseh as esas ecaneriancenee 447 PT mma G6 01601 0 01S meen eee E eR eee ne Rene ee eee 448 Dstt AOCCACIL aeaeeccacctaveceansesegecacosaceenee san csueeiceec cous aosane sa soe sonten sete vacsensa ce ecetaeieeoss 449 25 78 Adding text to leS sesoses ee EREE nEn 450 S O OE e A E Pe ee eee 451 Subroutine GOCIAVGTION sacsesssacecceietsaseccsaessacsanesacesenaceeioscansscesnasedevensseeseesseesiees 451 Subrouline TV OCOMON seers reen in E Er nre TOET Er EAE 452 A I N E N EEE E E A 453 25 7 10 Built m TYPOS eters cece a eNe ai A aiaia sepse 455 N AES OE AE A E EA E E EEE E E A 455 C e E ciate esis eae 455 MOEI eee a E E ete 456 P a ant austin oe ih ance sane ceca erected tase easiness ese de 457 Lnumerat O Ree aE ERE EEA Re SO E EOE Oe ans eT mE 458 26 The MapForce API 460 O OVN A T ee e ee 461 20A ODECE MOGE loeis ES 462 20 12 Example C ode Genmeraton sses nenna eE Nan Ee EEEa 463 20 14 93 Example Project SUPPOM sercicsnterccsbssndeieustavesptassledenataracsbuaplesexeinncsalased ineine 465 DOME Eror AIG E E S 469 202 ODject Kerent S sirni n EA 471 2a A O a
304. de generator options 25 6 Code generator options The menu option Tools Options lets you specify general as well as specific MapForce settings Generation tab This tab lets you define the settings for C and C programming languages C e Microsoft Visual Studio 2005 NET 2003 or Visual C 6 0 project file e generate code using either MSXML 4 or Xerces XML library note that MapForce currently supports Xerces Version 2 2 or higher e generate static libraries or Dynamic link libraries e generate code with or without MFC support C Select the type of project file you want to generate e Microsoft Visual studio 2005 2003 or 2002 project file e Borland C Builder project e Mono makefile Options eee xi Libraries General Generation C Settings f Microsoft Visual Studio 2005 Microsoft Visual Studio NET 2003 IW Microsoft Visual C 6 0 f MSAML 4 amp ML Library C weres amp ML Library Static Library LIB CH Settings Microsoft Visual Studio 2005 f Microsoft Visual Studio NET 2003 Microsoft Visual Studio NET 2002 Borland CHBuilder Project Mono Makefile Dynamic Link Library DLL Compatibility Mode i MEC Support Enable code compatibility ta 2005R 3 Cancel Compatibility Mode Schema code xsd files generated in versions after version V2005R3 is generated in a slightly different fashion to previous versions This could lead to t
305. de in your application 25 5 1 MapForce code in Java applications This example assumes that you are using Borland JBuilder as your Java environment Having generated the Java code in MapForce and defined a folder named output as the output folder 1 Navigate to the output Mapping folder and open the Mapping jpx project file 2 Double click the MappingConsole java file Mapping jp cae lt Project Source i com altoyvs i com altoyva db cas com altoyva functions i corm altova types i com altoyva xml Com Mmaptorce ED Completero i CustomersAndArticles HD Shorteo Te mapforce png ca MappingApplication java a MappingConsole java nines da MappingF rame java Mappinghlaini java a Com maptorce CompletePo ce com maptorce Customersand Articles fi Com maptorce ShortPo A snippet of the code is shown below try fi System out printlin Mapping Application TraceTargetConsole tte new TraceTargetCconsoleli Class forName sun jdbe adbe JdbcodbeDriver MappingMainl MappingMainlOGbhject new MappingMainl i MappingMainlOhject registerTraceTarget tte MappingMainlOhject runtl TSahortPo xml java sql DriverMNanager getCaonnectionl Jdbcr odbc DRIVER Microsott Access Driver mdb DBO sCustomersand rticles mdb FF Fr f giki n CompletePo xml SYStem out printin Finished catch Exception ej d Please note that the path names in the generated source code have been del
306. document loaded This property is only used in the Application level integration mode Toolbars Property Toolbars as MapForceCommands read only Dispatch Id 1005 Description This property returns a list of all toolbar descriptions that describe all toolbars available with MapForceControl For more information see C Sample Methods The following methods are defined Open Exec UUervyotalus Exec Method amp xec nCmdID as long as boolean Dispatch Id 6 Description Exec Calls the MapForce command with the ID ncmdID If the command can be executed the method returns true See alSO CommandsStructure to get a list of all available commands and QueryStatus to retrieve the status of any command Open Method Open strFilePath as string as boolean Dispatch Id 5 Description The result of the method depends on the extension passed in the argument strFilePath If the file extension is mfd a new document is opened If the file extension is mfp the corresponding project is opened If a different file extension is passed into the method the control tries to load the file as a new component into the active document Do not use this method to load documents or projects when using the control in document level integration mode Instead use MapForceControlDocument OpenDocument and MapForceControlPlaceHolder OpenProject QueryStatus Method QueryStatus nCmdID as long as long Dispatch Id 7 Altova MapForce
307. e Errors 1400 The application object is no longer valid 1401 Invalid address for the return parameter was specified See also Code Generation CppSettings GenerateVC6ProjectFile Property cppSettings_GenerateVC6ProjectFile as Boolean Description Specifies if VisualC 6 0 project files should be generated by Document GenerateCppCode Errors 1400 The application object is no longer valid 1401 Invalid address for the return parameter was specified See also Code Generation CppSettings GenerateVSProjectFile Property cSharpSettings_GenerateVSProjectFile as ENUMProjectType Description Specifies which version of VisualStudio project files should be generated by Document GensrarelppUoue Only eVisualStudio2003Project and eVisualStudio2005Project are valid selections Errors 2006 Altova GmbH Altova MapForce User Manual 496 The MapForce API Object Reference 1400 The application object is no longer valid 1401 Invalid address for the return parameter was specified See also Code Generation CppSettings LibraryType Property cppSettings_LibraryType as ENUMLibType Description Specifies the library type used by Document GenerateCppCode Errors 1400 The application object is no longer valid 1401 Invalid address for the return parameter was specified See also Code Generation CppSettings UseMFC Property cppSettings_UseMFC as Boolean Description Specifies if MFC support should be used by
308. e MapforceExamples Tutorial folder and consists of Summing nodes mfd mapping input xml input XML file input xsd and output xsd source and target schema files Summing nodes xslt xslt file containing a named template to sum the individual nodes The screenshot below shows the XML input file The aim of the example is to sum the Price fields of any number of products in this case products A and B sml vwersion 1 0 encoding UTF s ts J k Input xulns xsi http fa ws org 2001 SAMLochema Products gt Product gt Wame gt ProductaAc Wame gt Amount lLO lt Amount Price gt S lt Price gt lt r Product Product Name gt ProductBe Name gt Amount gt 52 amount Price gt 7O0 Price lt Product lt r Products gt f Input gt iji a 4 5 6 T 3 The screenshot below shows the XSLT stylesheet which uses the named template Total and a single parameter string What the template does is work through the XML input file and sum all the values obtained by the XPath expression Product Price in the document tubl version 1 0 encodings UTF 85 7T 451 stylesheet version 1 0 ymlns xsl http rrm w3 org ls xeLi output method xml version 1 0 encoding UTF s j xeLitemplate match F gt uel for each select _ gt xeLicall template name Total gt xuesLiwith param name string selects y gt xsl call template gt xsl for each gt xelitempl
309. e SOAP ENWV Envelope umlns S04P ENV http fschemas xmlsoap org soap er S0AP ENV Body m get ferson umlnsim http spam altora com Ws2DeB query wsdl Query xSLitype nusdistring gt Stringt Query ru get Person gt SOAP ENV Body S08P ENV Envelope gt We want the webservice to deliver all person records that have the Ro string in either the First or Last name Edit the String text and enter e g Ro u get ferson umlnsim http fw altora com Query xSLitype xsd string gt BRot fQuery gt Select SOAP Send request to server to send the request to the server The SOAP Response document is returned by the webservice and contains four persons from the Access database 2006 Altova GmbH Altova MapForce User Manual 360 MapForce and Webservices Webservice Faults 21 5 Webservice Faults MapForce provides support for the definition of WSDL Faults WSDL defines one or more messages as faults and the service throws them if it encounters a problem You can define the condition that will throw an error When the condition is satisfied a user defined message appears and the mapping process is stopped To insert a WSDL Fault component e Select the menu option Insert Exception or click the Exception icon Ol in the icon bar e Select one of the Faults defined in WSDL file Local customization getFersonSoaplnput getPerzon oapOutput EInput getPersol gt C L
310. e That an ISA and IEA pair exist on the interchange level That if either GS or GE exist the other ID also exists That there is at least one ST SE pair on the message level That ISA I01 and ISA I03 exist If they do not contain data 00 is inserted That ISA I02 and ISA I04 exist If they do not contain data ten blanks are inserted That both ISA I05 segments exist If they do not contain data ZZ is inserted That ISA I08 exists If it does not contain data the current date in EDI format is inserted Altova MapForce User Manual 2006 Altova GmbH MapForce and EDI UN EDIFACT and ANSI X12 as target components 319 That ISA IO9 exists If it does not contain data the current time in EDI format is inserted That ISA I65 exists If it does not contain data U is inserted That ISA I11 exists If it does not contain data the interchange control version number from the user defined settings is inserted See Settings Interchange control version number That ISA I12 exists That ISA I13 exists If it does not contain data the request acknowledgment setting is used See Settings Request acknowledgement That ISA I14 exists If it does not contain data P is inserted That ISA I15 exists If it does not contain data the sub element separator from the user defined settings is inserted See Settings Subelement separator That IEA I16 exists If it does not contain data the number of function groups in the intercha
311. e 177 mapping 169 output file 177 store as 289 Custom fill character Fixed 186 function 16 lilbrary 16 XQuery functions 242 XSLT 2 0 functions 240 XSLT functions 234 Custom library adding 222 Customization EDIFACT global 328 EDIFACT inline 332 EDIFACT local 330 X12 global 340 X12 inline 343 X12 local 341 X12 set up 338 Customize ANSI X12 transactions 336 EDIFACT 325 2006 Altova GmbH 618 Index D Data filtering 41 Database and multiple sources 397 change DB 397 complete mapping 159 component 12 create relationship 154 feature matrix 142 filters and queries 162 IBM DB2 info 153 insert 64 invalid connection 99 JDBC setup 107 Key settings 134 mapping data Java 64 mapping from XML 111 mapping large DBs 158 mapping to 110 MS Access info 143 MS SQL Server 145 MySQL info 149 null functions 164 Oracle info 147 partial mapping 160 query optimization 162 support 106 Sybase info 151 table actions 135 XQuery 106 Database action delete 131 insert 116 update 121 update and delete child 126 Database relationships preserve discard 140 Database support 61 Datatype explicit implicit 240 datatypes field 177 in XPath 2 0 and XQuery 1 0 590 date filtering DB date records 98 xsd date 312 XSLT 2 0 constructor 240 Datetime mapping using functions 312 DB filtering date records 98 deep equal function
312. e Any replacement Software will be warranted for the remainder of the original warranty period or thirty 30 days whichever is longer This limited warranty does not apply to Evaluation and or Pre release Software b No Other Warranties and Disclaimer THE FOREGOING LIMITED WARRANTY AND REMEDIES STATE THE SOLE AND EXCLUSIVE REMEDIES FOR ALTOVA OR ITS SUPPLIER S BREACH OF WARRANTY ALTOVA AND ITS SUPPLIERS DO NOT AND CANNOT WARRANT THE PERFORMANCE OR RESULTS YOU MAY OBTAIN BY USING THE SOFTWARE EXCEPT FOR THE FOREGOING LIMITED WARRANTY AND FOR ANY WARRANTY CONDITION REPRESENTATION OR TERM TO THE EXTENT WHICH THE SAME CANNOT OR MAY NOT BE EXCLUDED OR LIMITED BY LAW APPLICABLE TO YOU IN YOUR JURISDICTION ALTOVA AND ITS SUPPLIERS MAKE NO WARRANTIES CONDITIONS REPRESENTATIONS OR TERMS EXPRESS OR IMPLIED WHETHER BY STATUTE COMMON LAW CUSTOM USAGE OR OTHERWISE AS TO ANY OTHER MATTERS TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW ALTOVA AND ITS SUPPLIERS DISCLAIM ALL OTHER WARRANTIES AND CONDITIONS EITHER EXPRESS OR IMPLIED INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE SATISFACTORY QUALITY INFORMATIONAL CONTENT OR ACCURACY QUIET ENJOYMENT TITLE AND NON INFRINGEMENT WITH REGARD TO THE SOFTWARE AND THE PROVISION OF OR FAILURE TO PROVIDE SUPPORT SERVICES THIS LIMITED WARRANTY GIVES YOU SPECIFIC LEGAL RIGHTS YOU MAY HAVE OTHERS WHICH VARY FROM STATE JURISDICTION TO STATE JUR
313. e result subs E ExpReport El expense report expense repc detailed con currency total sum E Person 2 aA C First Sie Title i Phone Y Email zc 4 expense item type gt Moa o o Mapping 4 Algorithm 4 Output Add Libraries After you load the document you can try using menu commands Note that context menus are also available If you like you can also load additional documents Save any modifications using the File Save command 2006 Altova GmbH Altova MapForce User Manual 542 MapForceControl Integration at Document Level HTML This example shows an integration of the MapForce control at document level into a HTML page The following topics are covered e Instantiate a MapForceControl ActiveX control object in HTML code e Instantiate a MapForceControlDocument ActiveX control to allow editing a MapForce mapping e Instantiate one MapForceControlPlaceHolder for a MapForce project window e Instantiate one MapForceControlPlaceHolder ActiveX control to alternatively host one of the MapForce helper windows e Create a customer toolbar for some heavy used MapForce commands e Add some more buttons and sample automation code e Use event handlers to update command buttons This example is available in its entirety in the file MapForceActiveX_ApplicationLevel htm within the MapForceExamples ActiveX HTML folder of your MapForce installation Instantiate th
314. e 4 Amount gt Price M Show annotations Show types Cancel The CompletePO component is inserted into the user defined function Please note the output icon to the left of the component name This shows that the component is used as a complex output component Altova MapForce User Manual 2006 Altova GmbH User defined functions Complex user defined function XML node as output 213 H CompletePa sree Y SinglePrice 3 aa Y Amount gt i Price 7 Insert the Articles schema XML file into the user defined function and assign the Articles xml as the XML instance 8 Insert the rest of the components as shown in the screenshot below namely a second simple input component filter equal and multiply components and connect them as shown me POA tM Pdetaut POAthYE e CompletePo A 4 Article Y Number ija Articles gt spool jon falseL gt SinglePrice F Y Article L i gt Amount Y Number Gay m Price Please note e The Articles component receives its data from the Articles xml instance file within the user defined function e The input component input 1 supplies the ShortPO article number data to which the Articles Number is compared e The filter component filters out the records where both numbers are identical and passes them on to the CompletePO output component 9 Click the Home icon zal to return to the mapping 10 Drag the
315. e 567 MapForceCommand ob jCommand objCommand objCommands int idx We are looking for the Menu with the name IDR_MAPFORCE This menu should contain the complete main menu of MapForce if objCommand Label IDR_MAPFORCE read menu structure here if objCommand Label ALL_COMMANDS read all commands here EnableUserPrompts Property EnableUserPrompts as boolean Dispatch Id 1006 Description Setting this property to false disables user prompts in the control The default value is true IntegrationLevel Property IntegrationLevel aS ICActiveXIntegrationLevel Dispatch Id 1000 Description The IntegrationLevel property determines the operation mode of the control See also Integration at the application level and Integration at document level for more information Note It is important to set this property immediately after the creation of the MapForceControl object MainMenu Property MainMenu as MapForceCommand read only Dispatch Id 1003 Description This property gives access to the description of the MapForceControl main menu For more information see C Sample ReadOnly Property ReadOnly as boolean Dispatch Id 2 2006 Altova GmbH Altova MapForce User Manual 568 MapForceControl Object Reference Description Using this property you can turn on and off the read only mode of the control If ReadOnly is true it is not possible to modify any
316. e In general when a function expects a sequence of one item as an argument anda sequence of more than one item is submitted then an error is returned e All string comparisons are done using the Unicode codepoint collation Results that are QNames are serialized in the form prefix localname Funetionname notes OO 2006 Altova GmbH Altova MapForce User Manual 592 Appendices Engine information Dase Uri e If external entities are used in the source XML document and if a node in the external entity is specified as the input node argument of the base uri function it is still the base URI of the including XML document that is used not the base URI of the external entity e The use of the xml base attribute in the source XML document is not supported This means that the base URI of a node in the XML document cannot be altered using the xm1 base attribute collection e The collection function is a mapping of form string nodes Currently called available collections and left empty by the external environment The function therefore returns either i the empty sequence when called with no argument or with an empty sequence or ii an error when called with a non empty argument e See note on whitespace in the General Information section cContd FunetionName Notes current date gt The current date and time is taken from the system clock current dateT1 The timezone is taken from the implicit timez
317. e Manonull Inc lt CompanyName SAddress lt Street 119 Cakstreet Suite 4676 lt Street aCity gt Yereno City f P 2921 3 2IP sitate CAs ftate gt e Address lt flustomer gt lt Linetems Lineltem oP Articles lt Number 42 Mumber lt Name Pizza Pepperoni Mame lt SinglePrice gt f 2 lt SinglePrice 2 mounted lt mount lt Price 2 lt Price gt fof TaxeO 646 lt Taxe i sl4rticles sjLineltem D M oh E Ww ha 2006 Altova GmbH Altova MapForce User Manual 312 MapForce and EDI UN EDIFACT and ANSI X12 as target components 20 3 UN EDIFACT and ANSI X12 as target components The XML_To_X12_Order mfd file available in the MapForceExamples folder maps an XML file to an ANSI X12 EDI file The resulting EDI output file can be validated against the X12 specification by clicking the Validate output file icon The following sections describe e the settings common to both EDI formats e the validation rules and automatic data completion settings used for each of the specific EDI formats Please note If it is important to retain the element item sequence present in the source component please make sure you create connectors using the Source Driven mixed content option see the section on Source driven and mixed content mapping for more information E Order E Header Number on Received E 7 Customer 3 3 pami Humber 2 7 4 ContactName
318. e MapForceControl The HTML oBJEcT tag is used to create an instance of the MapForceControl The Classid is that of MapForceControl Width and height are set to 0 since we use this control as manager control without use for its user interface The integration level is specified as a parameter within the OBJECT tag lt OBJECT id ob jMapForcexX Classid clsidtA386378H9 5759 4456 Al6 FOLI60CC22C1 width 0 height 0 VIEWASTEXT gt lt PARAM NAME IntegrationLevel VALUE 1 gt lt OBJECT gt Create Editor window The HTML OBJECT tag is used to embed a document editing window The additional custom parameter specifies that the control is to be initialized with a new empty mapping lt OBJECT id objDocl Classid clsid DFBB0871 DAFE 4502 BB66 08CEB7DF5255 width 600 height 500 VIEWASTEXT gt lt PARAM NAME NewDocument gt lt OBJECT gt Create Project Window The HTML oBJEcT tag is used to create a MapForceControlPlaceHolder window The first additional custom parameter defines the placeholder to show the MapForce project window The second parameter loads one of the example projects delivered coming with your MapForce installation lt OBJECT id objProjectWindow Classid elsid FDEC3B04 05F2 427d 988C FUSASS5SDE5S3C2 width 200 height 200 VIEWASTEXT gt Altova MapForce User Manual 2006 Altova GmbH MapForceControl Integration at Document Level 543 lt PARAM name PlaceholderWindowID value
319. e Software AS IS and will not receive any maintenance releases or updates However Altova at its option and in its sole discretion on a case by case basis may decide to offer maintenance releases to you as a courtesy but these maintenance releases will not include any new features in excess of the feature set at the time of your purchase of the Software In addition Altova will provide free technical support to you for thirty 30 days after the date of your purchase the Support Period for the purposes of this paragraph a and Altova in its sole discretion on a case by case basis may also provide free courtesy technical support during your thirty 30 day evaluation period Technical support is provided via a Web based support form only and there is no guaranteed response time b If you have purchased SMP then solely for the duration of its delineated Support Period you are eligible to receive the version of the Software edition that you have licensed and all maintenance releases and updates for that edition that are released during your Support Period For the duration of your SMP s Support Period you will also be eligible to receive upgrades to the comparable edition of the next version of the Software that succeeds the Software edition that you have licensed for applicable upgrades released during your Support Period The specific upgrade edition that you are eligible to receive based on your Support Period is further detailed in the SMP th
320. e Tel if Il Len Phone s First name l l E Department gt H Last name l oo Name bs 7 Tel Extension l l 5 Person gt e i Email l EMail hs p Position D Y First E l Padis Last i jee PhoneE xt Ler F it Li kon Clicking the Output tab produces the result you see below which may not be what you expect we only see output for the first office 1 Microtech Partners Inc Level support Ferrao Byrd 1324 0ttoaw In order to be able to iterate through all offices and have the output appear in the CSV file it is necessary to connect Office to Rows What this means is for each Office item of the source XML create a Row in the target CSV file MapForce allows you to specify the field or item which is to act as the root iterator for the output using the Rows item Mapping the Office item to the Rows item results in all individual Offices and mapped items being output E Tut company E My CS file p P jo A Rows ffice name gt E Y Office i ES i sree Department name gt Name is M Street 5 The Office items are output in the source file sequence Altova MapForce User Manual 2006 Altova GmbH MapForce CSV and Text files Mapping XML to CSV or fixed length text files 173 Microtech Inc Lewel 1 support Major Ave 1 Vancouver 558s33 Microtech Partners Inc Level support Perroa Brd Lse4 0tta E Tut compar
321. e XSLT onclick BtnGenerate objDocl 0 gt lt input type button id GenerateJava value Generate Java onclick BtnGenerate objDocl 1 gt lt input type button id GenerateCpp value Generate C onclick BtnGenerate ob jDocl 2 gt lt input type button id GenerateCSharp value Generate C onclick BtnGenerate objDocl 3 gt lt p gt The corresponding JavaScript looks like this lt SCRIPT ID Javahandlers LANGUAGE javascript gt open a document in the specified document control window function BtnOpenMEFile objDocCtrl do not use MapForcex Application OpenDocument to open a document since then MapForceControl wouldn t know a control window to show the document in Instead var pos objMapForcex BaseHref indexOf ActiveX 1f pos gt 7 path objMapForceX BaseHref substr 7 pos 7 oe remove file protocol objDocCtrl OpenDocument path MarketingExpenses mfd objDocCtrl setActive else alert Unable to locate MarketingExpenses mfd at objMapForcexX BaseHref _ open a new empty document in the specified document control window function BtnNewFile objDocCtrl ob DocCtrl OpenDocument obJDocCtrl setActive Altova MapForce User Manual 2006 Altova GmbH MapForceControl Integration at Document Level 545
322. e component settings dialog box of a database component Altova MapForce User Manual 2006 Altova GmbH MapForce Reference Component 399 Component Settings E x Generic Database Settings DataSre WE elem Ulser Catalog Jaltova Password Use Transactions JDBC specitic Settings JBEC driver sur idbe odbe IdbeO dbeD river Database UAL Jidbc odbc DRIVER Microsoft Access Driver m 400 OLEDB speciic Settings Provider Microsoft J eL OLEDB 4 0 add Options Cancel Please note The database settings defined in this dialog box only affect the Output tab the preview or the generated application they do not override the original database settings selections made when inserting the database component i e connection string selected tables owners views etc Modifications made here i e changing the table name in the DataSc field only affect the SQL code in the Output tab and the generated program code e opening the MFD file accesses the original database component settings e the generated application and the pseudo SQL code in the Output window use the modified settings of the component Generic Database settings DataSrc displays the data source name Catalog displays the name of the specific database User Enter the user name needed to access the database if required Password Enter the password needed to access the database if required Use
323. e executed code is that which appears in the Output XML instance for Code Generation field of the Component settings dialog box if the target is an XML Schema document Generate code in C Generates the C code in the selected directory The file name created by the executed code is that which appears in the Output XML instance for Code Generation field of the Component seitings dialog box if the target is an XML Schema document Mapping settings Altova MapForce User Manual 2006 Altova GmbH MapForce Reference File 391 Mapping Settings a x Mapping Output Output Encoding Unicode UTF 8 id Application Name Mapping Java Settings Base Package Mame com mapforce WebService Operation Settings wSDL Detinitions Bi Service http aww altova com w S2DB query wedi Port ws UE SoapPort Operatiors http Am altova coma S206 query wedlig Cancel The global MapForce settings are defined here Mapping Output Output encoding defines the output encoding for the files produced by the XSLT 1 0 2 0 XQuery and Java transformation Application Name defines both the XSLT1 0 2 0 file name prefix Java C or C application name for the transformation files Java settings Base Package Name defines the base package name for the Java output Webservice Operation settings Clicking the Browse button allows you to select the WSDL file which forms the basis of the webservice
324. e generated code can be integrated or adapted to your specific application even though the result of code generation is a complete and fully functioning application The mapping project visible below DB_CompletePO mfd is available in the MapforceExamples folder Please also see the section Generating program code for information on how the generated code is produced This section describes how to e Modify the source and target files of a mapping project e Use an XML input stream as a data source and e Where to add your own error handling code E ShortPO gt G Y ShortPO gt oo Y CustomerMr i Pnode row m E Lineltems bool E CompletePO E Lineltem P gt E CompletePO ArticleNr i gt E Customer gt Number 2 FirstName LastName pt d aroa z a mE Addresses z i E Articles i EER i i i State imjName i AA she i 2 4 Lineltems fr SinglePrice oe H 47 Lineltem E 7 Article FirstName LastName oE Addresses m CustomerHr m City fp State rp Street a fa multiply ZIP value LE eT nia This example consists of two source and one target files e ShortPO xml as a source XML file e CustomersAndArticles mdb as a source database and e CompletePO xml as the target XML file 2006 Altova GmbH Altova MapForce User Manual 434 Code Generator Integrating MapForce co
325. e gt sr Element gt Include hret Admin Segment gt Include href EDSD Segment gt Include hret UNCL Codelist gt We fo n n fo N be PRERERrPREFERPRE FE onan kwh Oo Hessaqe gt HMessagelType ORDERsS lt HMessagqelType gt io Altova MapForce User Manual 2006 Altova GmbH MapForce and EDI Customizing an EDIFACT message 331 Previewing the new field in MapForce 1 Select the menu option Insert EDI or click the Insert EDI ae Icon 2 Click the EDIFACT Nanonull tab and select the ORDERS message 3 Click the Cancel button to skip the selection of the source EDI file for the moment The ORDERS component is now visible in the mapping window 4 Navigate to Envelope Interchange Group Message SG2 SG5 CTA 056 to see the new X1000 element w ORDERS HEC SG2 NAD Name and address 2 HEC NAD NAME AND ADDRESS 2 HE O LOC PLACE LOCATION IDENTIFICATION bE MCFD FINANCIAL INSTITUTION INFORMATION E 5G3 AFF Reference E Q SG4 DOC Document message details i HE 40 5G5 CTA Contact information o HA OQCTA CONTACT INFORMATION oe F 3139 CONTACT FUNCTION CODE 3 8 C056 DEPARTMENT OR EMPLOYEE DETAILS ee ere Department or employee name code i oo F3412 Department or employee name 1000 New Element Please note The Elements Composite C056 section must be inserted before the Include element due to the definition of the EDIConfig xsd file in the Map
326. e items General info Cost Destination lar Rental Sir Travel Whisc Travel 2003 01 02 Eill to Development Cur Usb Total NaN Date Gost Destination lar Rental Sir Travel Wisc Travel Date 2003 07 07 Eill to Accounting Curr ee Total NaN Cost Destination _ar Kental Date 2003 02 02 Ell to Marketing add DomesticD allyR ate add Cash4dyance Tel Emai 23 4560 78 Elands nanonull com Foreign daly rate add Fr Foreign cash advance add Ci Travel Accommo daton Entertammen 54 86 add Destination add Lar Rental add Air Travel add Accommodation add Misc Travel 1014 22 add Destination add Lar Rental add Air ravel add Accommodation add Misc Travel 2000 add Destination add Car A ental Cost Client add Aceoarmmodstion The expense report can now be completed with extra information relating to Accommodation Entertainment and Misc costs if necessary Please note The Total field automatically sums up all Cost fields of each record Once a number exists in all these fields the Total field becomes live and the NaN Not a Number entry disappears Subsequent changing of any of the Cost fields automatically adjusts the Total field Altova MapForce User Manual 2006 Altova GmbH MapForce tutorial Multiple target schemas documents 47 3 6 Multiple target schemas documents This section deals with creating a second target schema document into
327. e message description text Purchase Order Browse EDI collections a x EDIFACT EDIFACT Nanonull X12 12 Nanonull B60 Purchase Order Cancel Fou didn t find EDI collection you were looking for click this button to view what other collections are currently available from Altova Download additional EDI collections Please note Altova MapForce User Manual 2006 Altova GmbH MapForce and EDI Customizing an ANSI X12 transaction 339 MapForce searches through all sibling subfolders under the MapforceEDI directory and scans for a file called EDI Collection The folder name containing an EDI Collection appears as a tab in the dialog box The listbox shows the current content of the collection file which in our example only contains a Purchase Order entry The goal of this section is to redefine the N2 Additional Name Information segment by adding the X1000 field to make it available to individual transactions N2 currently consists of one field F93 Name There are several ways the customization can be achieved e Globally by customizing the X12 segment file All segments in all transactions that use N2 will contain reference the new element e Locally by customizing the 850 config file All segments in the current transaction that use N2 will contain the new element e Inline by customizing the 850 config file Only the customized segment N2 in the current transaction will contain th
328. e new element EDI Collection The Collection file contains a list of all transactions in the current directory It is used to provide a list of the available transactions when inserting an X12 file into MapForce The following example contains only one transaction namely Purchase Order 850 config The configuration file for Purchase order transaction files This file contains all groups and segment definitions used in purchase order transactions Changes made to this file can define local or inline customizations X12 Segment This file defines the Segment Composite and Field names of the X12 files and is used when parsing the file Changes made to this file are global customizations and apply to all segments and transactions 2006 Altova GmbH Altova MapForce User Manual 340 MapForce and EDI Customizing an ANSI X12 transaction 20 6 3 Global customization e Changes only have to be made to the X12 Segment file to be able to access the new X1000 field globally e All segments in all transaction that use N2 will contain reference the new element Redefinition in X12 Segment file Open the X12 Segment file and navigate to Config Elements Segment name N2 info Additional Name Information Seqment name N2Z info Additional Name Information gt Data ref F9S mergedEntries 2 Seqment gt Insert the following line under F93 lt Data name X 1000 type string maxLength 35 minOccu
329. e on any compatible computers up to ten 10 times the Permitted Number of users provided that only the Permitted Number of users actually use the Software at the same time The Permitted Number of concurrent users shall be delineated at such time as you elect to purchase the Software licenses d Backup and Archival Copies You may make one backup and one archival copy of the Software provided your backup and archival copies are not installed or used on any computer and further provided that all such copies shall bear the original and unmodified copyright patent and other intellectual property markings that appear on or in the Software You may not transfer the rights to a backup or archival copy unless you transfer all rights in the Software as provided under Section 3 e Home Use You as the primary user of the computer on which the Software is installed may also install the Software on one of your home computers for your use However the Software may not be used on your home computer at the same time as the Software is being used on the primary computer f Key Codes Upgrades and Updates Prior to your purchase and as part of the registration for the thirty 30 day evaluation period as applicable you will receive an evaluation key code You will receive a purchase key code when you elect to purchase the Software The purchase key code will enable you to activate the Software beyond the initial evaluation period You may not re license
330. e project nature ID com altova mapforceeclipseplugin MapForceNature MapForce Eclipse projects have this nature automatically assigned To use the MapForce project builder in other Eclipse projects see Adding MapForce nature to existing Eclipse Project for more information To create a new MapForce Eclipse Project 1 Click the Navigator tab to make it active 2 Right click in the Navigator window and select New Project 3 Expand the MapForce Eclipse Project entry and select MapForce Eclipse then click Next New Project Select a wizard Wizards H E cvs co Java pForce Eclipse Projec om Simple D Project 4 Enter the project name e g MapForce and change any of the other project settings to suit your environment then click Finish Note the default setting in the Additional Builders group use JTD builder Altova MapForce User Manual 2006 Altova GmbH MapForce plug in for Eclipse MapForce code generation 381 New MapForce Project i x Specify Name and Code Language of Project Create new MaoForce Ecliose Proiect Project name MapForce Project contents M Use default Directory C eclipses workspacelMapForce Browse Builder For MapForce mappings and projects I add MapForce builder to project Additional Builders For Code Generated by MapForce use no additional builders use JOT builder C use Following nature org eclipse jdt core javanatu
331. e received from Altova and to abide by the terms of the license agreement for any such later versions of the Pre release Software 5 LIMITED WARRANTY AND LIMITATION OF LIABILITY a Limited Warranty and Customer Remedies Altova warrants to the person or entity that first purchases a license for use of the Software pursuant to the terms of this Software License Agreement that 1 the Software will perform substantially in accordance with any accompanying Documentation for a period of ninety 90 days from the date of receipt and 11 any support services provided by Altova shall be substantially as described in Section 6 of this agreement Some states and jurisdictions do not allow limitations on duration of an implied warranty so the above limitation may not apply to you To the extent allowed by applicable law implied warranties on the Software if any are limited to ninety 90 days Altova s and its suppliers entire liability and your exclusive remedy shall be at Altova s option either 1 return of the price paid if any or 11 repair or replacement of the Software that does not meet Altova s Limited Warranty and which is returned to Altova with a copy of your receipt This Limited Warranty is void if failure of the Software has resulted from accident abuse misapplication Altova MapForce User Manual 2006 Altova GmbH Appendices License Information 609 abnormal use Trojan horse virus or any other malicious external cod
332. e shown in the Messages window of MapForce Errors 1500 The object is no longer valid 1501 Invalid address for the return parameter was specified 1706 Error during code generation InsertWebService Method InsertWebService i_strWSDLFile as String i_strService as String i_strPort as String i_bGenerateMappings as Boolean as Projectiten Description Inserts a new Web service project into the project s Web service folder If i_bGenerateMappings is true initial mapping documents for all ports get generated automatically Errors 1500 The object is no longer valid 1501 WSDL file can not be found or is invalid Service or port names are invalid Invalid address for the return parameter was specified 1503 Operation not supported by current edition Item Property Item i_nItemIndex as Integer as ProjectItem read only Description Returns the child at 1_nItemIndex position of the project s root The index is zero based The largest valid index is Count 1 For an alternative to visit all children see _NewEnum Errors 1500 The object is no longer valid 2006 Altova GmbH Altova MapForce User Manual 504 The MapForce API Object Reference Examples JScript code snippet enumerate children using Count and Item for nitemIndex 0 nItemIndex lt objProject Count nItemIndex objProjectItem objProject Item nItemIndex do someth
333. e used as source components in this mapping lt xml version 1 0 encading LITF 8 gt lt CompletePO xmins xsi http Sv v3 org 2001 ML Schema instance Customer lt Mumber 3 lt Mumber gt lt FirstWame gt Ted F irstName gt lt LastNamesLittle Lasthame Address lt flustamer Lineltems i lt Lineltem sArticle gt PoP GP chumber 3 lt Number lt hame Pants lt Mame gt PoP SinglePrice 34 lt SinglePrice gt A mount S 4mount PoP OE lt Price 170 lt Price gt ob sArticles Lineltem Lineltem PoP Articles Linetem Lin tems CompletePo gt FAIC The resultant XML file can be saved by clicking the Save icon and validated against the referenced schema by clicking the validate icon in the icon bar HN Database as target SQL pseudo code is displayed when a database component is the target The complete select statement all Select Insert Update or Delete statements is displayed for you to preview Altova MapForce User Manual 2006 Altova GmbH MapForce engine 255 before executing the SQL statement P This SGiL statements are only for preview and may not be executed in another SiL Giuer To execute these statements use function Generate output fram menu Transformation Connect to database using the follaying connection string Provider Microasott Jet OLEDE 4 0 Data Sources Program Files AtovaiMAPPORCEZO04 f 1 2 3 5 G
334. e values in the first record of the text file as the column headers visible in the preview window The column headers then appear as the item names when the Text component is displayed in the mapping Text enclosed in Text files exported from legacy systems sometimes enclose text values in quotes to distinguish them from numeric values Select this option if the text file contains strings which include the Field delimiter that you have currently defined The same delimiter character can then occur within a string without affecting the text file segmentation partitioning E g your fields strings contain a comma character but you are also using this character as the default CSV delimiter Append field Insert field Remove field Allows you to append insert or remove fields in the preview window which defines the structure of the CSV file Next Previous Clicking one of these buttons moves the currently active column left or right in the preview window Altova MapForce User Manual 2006 Altova GmbH MapForce CSV and Text files Mapping Fixed Length Text files to a database 179 8 5 Mapping Fixed Length Text files to a database This example maps a simple text file to a MS Access database The source text file is one continuous string with no carriage returns or line feeds All the files used in the following examples are available in the MapForceExamples Tutorial folder 1 Select the menu option Insert Te
335. eControl 564 MapForceControl documentation of 524 example of integration at application level 526 527 528 2006 Altova GmbH 624 Index MapForceControl examples of integration at document level 534 in MapForceControl 565 integration at application level 525 integration at document level 529 530 531 532 533 integration using C 534 535 537 539 540 integration using HTML 542 543 544 545 integration using Visual Basic 546 object reference 562 MapForceControlDocument in MapForceControl 571 MapForceControlPlaceHolder in MapForceControl 576 MapForceView 478 485 application 478 Mapping boolean values 88 child elements 22 connnector 21 creating source driven 71 CSV files 169 data to databases 110 database data Java 64 DB loading errors 99 flat file format 168 inserting XML file 479 inserting XML Schema file 479 no of connections 21 properties 22 schema items 34 source driven mixed content 68 standard mapping 77 target driven 77 text files 179 to Rows item 172 tutorial 30 type driven 80 validate result 25 validation 25 MappingApplication 418 420 MappingConsole 418 420 Memory out of exceptions 429 Memory requirements 595 Menu connection 401 edit 392 file 389 function 403 help 409 insert 393 output 406 tools 408 view 407 Merged entries 337 Method Reserve name 429 MFC support fo C 496
336. eataaceontotesessecccouseataiestsiec 485 JavaSettings BASEP ACKACEN GME wwvinvivesvinsbescintaicextuses Re E 485 MIGDE OF CCV tease eo ete pe ep ee 485 NOE a R 486 OutputSettings_ApplicationName sesseeeeeeseeeeeeseeerrrrseerrrrrreerrrrrrerrrrrsssee 486 OUD S CHINES CODING ariaren aie erin EE E AERES 486 Pen a cst sirs are ees oa creator do espa ate ease cies aan researc 486 Altova MapForce User Manual SAV EE a aasitoatuseatesas suas ese neta 487 VS RAN MEIA N EEE aed das sae ests tere ade eee see eet ec dd nent eee eee 487 QVCO a nota xacocosa aati ostans E 487 A 6 DOCE gue eres ne ee ene eee ere ee eee ea 488 FDC OTIGI A E A EP A E E E 488 TO E hen uenece eee eee ened 488 COMED ose te ects dee ease dese set ss pesca sec wend decode senate de E 488 Do seateas ts eeseneceancesesecngas soassese E senna cpasseoseeee 488 IAW DOC TIGHT arsena e E E EEE EEN E E 489 OPED IO CHIICH Loi sas sees srohnagseasiese se cana easton aeoheasavacntsecocamnagesaetonnteodsagaeeneiaies 489 PATE WOT OCU ICME aseri a EE 489 OR ea E COUN Cos Gc ee eee ee ee ree ee eee eee eee ee 490 APP COT OM er E A A EA 490 COME seen E e 490 D e T E ET teseeese sone teoest sete esoeesoe 490 POO a E E uns 490 2020 BONKE secre I a E EEE 492 Applicat Ossis se E NNE EE NE 492 D cu umem FileName xirrsesi nee E TENONS 492 aaa a E EREA EAE AEE T TE E T 492 TLC T E EA E E E O N E EA 492 Sra O ON EE T EE EE EA 493 T A E E EEEE E ease acesueeseaeeeeaae 493 POr ea E E e E
337. ecessary Click Next to continue Click the Yes radio button to test the database connection and click Next You can change the Login parameters if the test was not successful by clicking the Change Login button and trying again Click Next to continue Enter the Net Service Name in the field of the same name this can be any name you want This is the name you will enter in the Database field of the Oracle login dialog box in MapForce Click Next to continue This completes the Net Service Name configuration Click Next to close the dialog box Altova MapForce User Manual 2006 Altova GmbH Chapter 25 Code Generator 412 Code Generator 25 Code Generator MapForce includes a built in code generator which can automatically generate Java C or C class files from XML Schema definitions text files databases and UN EDIFACT and ASC X12 files Mapping is not limited to simple one to one relationships MapForce allows you to mix multiple sources and multiple targets to map any combination of different data sources ina mixed environment The result of the code generation is fully featured and complete software code which performs the mapping for you You may insert the generated code into your own application or extend it with your own functionality XML is not a full programming language in that it cannot be compiled or executed as a stand alone binary executable file rather XML documents must be bound to an external softwa
338. ecific to the MapForce view Errors 1200 The application object is no longer valid 1201 Invalid address for the return parameter was specified 2006 Altova GmbH Altova MapForce User Manual 486 The MapForce API Object Reference Name Property Name as String Description Name of the document file without file path Errors 1200 The application object is no longer valid 1201 Invalid address for the return parameter was specified OutputSettings ApplicationName Property outpuSettings_ApplicationName as String Description Sets or retrieves the application name available in the Document Seitings dialog Errors 1200 The application object is no longer valid 1201 Invalid address for the return parameter was specified See also Code Generation OutputSettings Encoding Property outputSettings_Encoding as String Description Sets or retrieves the output encoding available in the Document Settings dialog Errors 1200 The application object is no longer valid 1201 Invalid address for the return parameter was specified See also Code Generation Parent Property Parent as Agplication read only Description The parent object according to the object model Errors 1200 The application object is no longer valid 1201 Invalid address for the return parameter was specified Path Property Path as String Altova MapForce User Manual 2006 Altova GmbH The MapForce API Object Reference 487
339. ected component originating from source and terminating at the target components Connector context menu Connect Matching Children Delete Target Driven Standard Copy all Copy child items Source Driven Mixed content Connection Settings Connect matching children Opens the Connect Matching Children dialog box allowing you to change the connection settings and connect the items when confirming with OK Delete Deletes the selected connector Target Driven Standard Changes the connector type to Standard mapping please see Source driven mixed content vs standard mapping for more information Copy all Changes the connector type to Copy all and connects all child items of the same name ina graphically optimized fashion please see Copy all connections for more information Source Driven mixed content Changes the connector type to source driven mixed content please see Source driven and Altova MapForce User Manual 2006 Altova GmbH MapForce overview Mapping between components 23 mixed content mapping for more information Connection settings Opens the Connections Settings dialog in which you can define the specific mixed content settings as well as the connector annotation settings please see the Connection section in the Reference section Connect matching Children dialog box This command allows you to create multiple connectors between items of the same name in both the sou
340. ectly or disclose any of the foregoing except to the extent you may be expressly permitted to decompile under applicable law in the European Union if it is essential to do so in order to achieve operability of the Software with another software program and you have first requested Altova to provide the information necessary to achieve such operability and Altova has not made such information available Altova has the right to impose reasonable conditions and to request a reasonable fee before providing such information Any information supplied by Altova or obtained by you as permitted hereunder may only be used by you for the purpose Altova MapForce User Manual 2006 Altova GmbH Appendices License Information 607 described herein and may not be disclosed to any third party or used to create any software which is substantially similar to the expression of the Software Requests for information from users in the European Union with respect to the above should be directed to the Altova Customer Support Department 1 Other Restrictions You may not loan rent lease sublicense distribute or otherwise transfer all or any portion of the Software to third parties except to the limited extent set forth in Section 3 or otherwise expressly provided You may not copy the Software except as expressly set forth above and any copies that you are permitted to make pursuant to this Software License Agreement must contain the same copyright pate
341. ed ActiveDocument Property ActiveDocument aS Document read only Description Retrieves the active document If no document is open mulis returned Errors 1600 The object is no longer valid 1601 Invalid address for the return parameter was specified 2006 Altova GmbH Altova MapForce User Manual 490 The MapForce API Object Reference 26 2 5 ErrorMarkers Properties and Methods Properties to navigate the object model Application Parent lterating through the collection Count Iten Application Property Application as Agplication read only Description Retrieves the application s top level object Errors 1800 The object is no longer valid 1801 Invalid address for the return parameter was specified Count Property Count as Integer read only Description Retrieves the number of error markers in the collection Errors 1800 The object is no longer valid 1801 Invalid address for the return parameter was specified Item Property Item nIndex as Integer as ErrorMarker readonly Description Retrieves the error marker at nIndex from the collection Indices start with 1 Errors 1800 The object is no longer valid 1801 Invalid address for the return parameter was specified Parent Property Parent aS Application read only Description Retrieves the application s top level object Errors 1800 The object is no longer valid 1801 Invalid address for the return parameter w
342. eeeeeeeeeeeeeaaas 564 Conni sae hee eee cere eee eee 564 TOE Hececiesec cc cctia eyes son cans ea acu are ceiacdaacis dances sassesiene ses oi es quan cola eng etesceescas vee 564 213 Map orce Conto ieee iautennauattndessomieaetieeaaesnineteanauetees 565 PODO CS E E E E E E E O O E oatys 565 Appearance E E E E EE EE E E E E 565 Application E E E E E E E E 566 BorderStyle EEE E E A E E E E A E E A 566 Commands isteneni e eE E EEE EE E E EEN EEEE EENE 566 CommandsStructure deprecated T E E T T E E E E E 566 EnableUserPrompts E PAE EAA A E E E AATA E EA AAE 567 IntegrationLevel A Risers bau E A E A E sauesieaacusacaanewntonten 567 MamnM ef he tices cee toc es reie e EEE ETE EEEE EEEE E EEEE 567 ReadOnly EEEE EE A A E E EEE E E ET 567 TOODA S eera E TEE E E E N E EEE 568 ALO ee E AEE EAE AAE AA 568 EXCO ee E EEA EE E Ea E EEEE aE 568 Open E E E E E E E E senaennespecsuiecnan 568 QueryStatus E E E E E E A eld 568 Altova MapForce User Manual ee a eee ee ene ee ne eT ee OES 569 OmDociimiemt pe me dese seentesvancintasarrncssaneus peiie iaaa ri Na 569 OmClOSEE Citi s Window sercssctentsatonesnanteecvenanchcdeeiseqconeqessesersnsedganesiecnsennanenemesonenaute 569 OmProjectO pened eesis rsio aonan naaa 569 OnUpdateCmdUI E EEE E S E TE EE 570 27 5 4 MapForceControlDocument ccccccececcccececeeeeeeeaaeseeesseeeeeeeeeeeeeeeeeeeeaaas 571 PODO O S r E E E E E T E A T 571 Appearance sentene toe ec T O A 571 Border
343. eference Helo 409 24 11 Help Allows access to the Table of Contents and Index of the MapForce documentation as well as Altova web site links The Registration option opens the Altova Licensing Manager which contains the licensing information for all of Altova products 2006 Altova GmbH Altova MapForce User Manual 410 MapForce Reference Oracle client installation 24 12 Oracle client installation The instructions below describe the setting up of a new connection to an existing Oracle database somewhere on the local network The Local net service name configuration wizard follows the same sequence when installing the Net Service during the initial installation of the Oracle client 1 Oe ae ND 10 11 Select the menu option Programs Oracle OraHome92 Configuration and migration tools Net Configuration Assistant This opens the Oracle Net Configuration Assistant Click the Local Net Service Name configuration radio button and click Next Click Add to add a new net service name and click Next Select the installed Oracle version e g Oracle 8i or later and click Next Enter the Service Name of the database you want to connect to e g TestDB and click Next The database s service name is normally its global database name Select the network protocol used to access the database e g TCP and click Next Enter the Host name of the computer on which the database is installed and enter the port number if n
344. efined in schematypes h of generated C code which start with CSchemaType The resulting header file should look like this ifndef HELLOWORLDLIBRARY_GREETINGS_H_ INCLUDED define HELLOWORLDLIBRARY_GREETINGS_H_ INCLUDED tat MSC VER gt 19000 pragma once endif _MSC_VER gt 1000 using namespace altova namespace helloworldlibrary Altova MapForce User Manual 2006 Altova GmbH Adding custom libraries Writing your libraries 231 class ALTOVA_DECLSPECIFIER Greetings PUBLICI static CSchemaString HelloFunctionResponse const CSchemaBoolean amp rGreetingType Ly namespace HelloWorldLibrary endif HELLOWORLDLIBRARY_GREETINGS_H_INCLUDED In the cpp file 1 The first lines need to be the includes for StdAfx h and the definitions from the Altova base library please copy these lines from the sample code supplied below 2 The Altova path is correct for your source files because they will be copied to a separate project in the resulting code that will be found at targetdir libraryname n g The next line is the include for your header file you created above Add the implementations for your functions Please remember that the implementations need to be in the correct namespace you specified in the header file and in the implementations element of the mff The sample cpp file would look like this include include include include include include Wot OA x Alto
345. ei aship Meqa 41579227 i d Miscellaneous i The second container holds the remaining data and is made into another Split once container This creates two more containers one of which will be the second CSV Clicking the Split once container shows the current contents iade delimited lne based Separator 1100 Gplit base head E Record separator Field separator Head det mft sample Text Be 2 8 hie 5 Se Hailes 4 eles Mabie freight Mini Ro 2joe2e0 424WU561 10 5 10000 Gas Chromatoagraph Ai ceneral outgassing pollutants 5j 1100 897 22 1 716235 L0x 6 1110 9832 22991 30 002 No0x 5 7W1120 1213 33 01 008 50 The delimited line based function using 1100 as the separator is used to split the remaining data into two sections e All records up to the first occurrence of 1100 io to the first container which is made non mappable by defining it as Ignore e The second container is then defined as CSV The default settings have not been changed Clicking the CSV container shows the contents in tabular form Altova MapForce User Manual 2006 Altova GmbH FlexText FlexText Reference 291 Split once b Mode delimited line based Separator 1100 Record separator Split base head Field separator Quote character Escape character First row contains field names no 4 Fey Head det mft ample Text me Field 2 string 0 Field 1 Field 2 Field 3 Field
346. ema is the basis of the XML document you want to have generated by the transformation The target schema document can of course differ dramatically from the source schema This is where the mapping process comes in you can map any item in the source schema database to any other item element attribute in the target schema The source data then appears at the position defined by your mapping in the target document You can also define multiple output schemas MapForce then generates XSLT XQuery or program code for each target schema You can then selectively preview the different output schemas in the Output preview window please see the section XSLT and Output previews for more information Please note It is not necessary to associate an XML Instance document to a target schema If you do so then the XML instance document is ignored and does not affect the transformation in any way Clicking the root element of a schema and hitting the key on the numeric keypad expands all the schema items To create a Database component source target The database structure is the basis of the component and is displayed it in a tree view 1 2 3 Click the Insert Database icon Select the source database type by clicking on one of the radio buttons e g Microsoft Access and click Next Click Browse to select navigate and select an Access database e g Tutorial altova mdb and then click Next Select the database tables
347. ema structures if this is an Inline user defined function Create Input d x Mame Articles Type C Simple type integer string etc Datatype string ba Structure Choose Root FO hose Cancel Insert Output Inserts an Output component into a user defined function In a user defined function tab the dialog box shown below is displayed This type of input component allows you to define e simple outputs if this is a Standard user defined function complex outputs e g schema structures if this is an Inline user defined function Altova MapForce User Manual 2006 Altova GmbH MapForce Reference Function 405 Create Output CompletePU sting O 2006 Altova GmbH Altova MapForce User Manual 406 MapForce Reference Output 24 8 Output The XSLT XSLT2 XQuery Java C or C options allow you to define the target language you want your code to be in Note that the MapForce engine presents a preview of the mapping result when you click the Output tab Please see the MapForce engine section for more information Validate Output XML file Validates the resultant XML file against the referenced schema Save Output XML File Saves the currently visible data in the Output tab Run SQL script Executes the pseudo SQL select statements visible in the Output window when the target component is a database Altova MapForce User Manual 2006 Altova GmbH MapFor
348. ementation 2006 Altova GmbH Altova MapForce User Manual 230 Adding custom libraries Writing your libraries settings shown above 6 Add your functions as public static and remember to only use the Schema simpleTypes supplied by the Altova dll The sample code should look like this using System using Altova Types namespace HelloWorldLibrary public class Greetings public Greetings public static SchemaString HelloFunction SchemaBoolean GreetingType if GreetingType Value return new SchemaString Hello World return new SchemaString Hello User 7 The last step is to compile the code The path where the compiled dll is located must match the reference setting in the implementation element How to write a C library Create the header and cpp files using the exact name at the same location you defined in the implementation element for the whole library Header file 1 Write using namespace altova 2 Add the namespace you specified in the implementation element 3 Add the class you specified in the implementation element of the mff with the functions you specified in the mff 4 Please remember to write ALTOVA _DECLSPECIFIER in front of the class name this ensures that your classes will compile correctly whether you use dynamic or static linkage in subsequent generated code 5 Remember to use only the schema simpleTypes as input parameters and return values d
349. enerate output fram menu Transformation Connect to database using the follaving connection string Provider Micrasott Jet OLEDE 4 0 Data Sources Program Files AtovaiMAPPORCE ZO04 f SELECT IIFIMAS Anoval Primarykey 5 NULL OMA Atoval Primary Key AS Prima INSERT INTO A tova Name PrimaryKey VALUES Microtech OrgChart PrimaryKey 9 Click the Run SQL Script icon in the function bar to run the script and insert the table data into the database If the script was successful a confirmation message appears Click OK to confirm 10 Open the Altova database in Access to see the effect 2006 Altova GmbH Altova MapForce User Manual 118 MapForce and Databases Mapping XML data to databases Es Altova Table Primarykey Name E 1 Organization Chart 2 Microtech OrgChart A new Microtech OrgChart record has been added to the Altova table with the new PrimaryKey 2 The data for this record originated in the input XML instance 11 Switch back to MapForce mo Mm n E tw ha You will now see a record of what happened when the SQL script was processed li The following QL statements were executed during Generate output function Every single result is written right to the gt string These statements are only for previews and may not be executed in another SL Guery tonl The database was connected using the following connection string Provider Microsott Jet OLEDB 4 0
350. ent you will also need a font that supports the Unicode characters being used by that document Windows NT typically includes support for all common single byte writing systems in its Arial Times and Courier New fonts and will additionally include all required fonts for the writing system in your own country i e if you install the Japanese version of Windows NT you will automatically have fonts that support the Katakana Hiragana and Kanji writing systems as well as the input methods and dictionaries to enter Kanji and to switch between Katakana and Hiragana If you wish to edit any document from a foreign writing system you may want to install additional Windows NT components for that writing system or purchase special Unicode fonts for these writing systems such fonts are available from all leading type vendors Please note that most fonts only contain a very specific subset of the entire Unicode range and are therefore typically targeted at the corresponding writing system Consequently you may encounter XML documents that contain unprintable characters because the font you have Altova MapForce User Manual 2006 Altova GmbH Appendices Technical Data 599 selected does not contain the required glyphs Therefore it can sometimes be very useful to have a font that covers the entire Unicode range especially when editing XML documents from all over the world The most universal font we have encountered is a typeface called Ari
351. ent table combined with each of the possible table actions defined for related child tables The Delete data in child Altova MapForce User Manual 2006 Altova GmbH MapForce and Databases Mapping XML datato databases 127 tables option is active in all but one of these examples You can continue to use the mapping from the previous section for this section Database Table Actions Altova All input data are compared to the DE table data using the operators defined here C IF all comparisons are true then the specific action i executed wE Append Action Insert Action Acton on input data fm Primarykey xmins m ipo XSI m schemaLocation m Name Delete data in child tables gnore input child data E Office Fl Delete Action i Use Transactions Files used to illustrate this example e Altova_hierarchical xsd e Altova cmpy extra xml e Altova mdb Update if on parent table Insert all on child table Parent table Department J o o Table action Update if compare PrimaryKey Delete data in child tables Aa f ooo o O Ignore input child data MO ooo o child table Person A ooo o Table action Insert all _ compare PrimaryKey S o Delete data in child tables J ooo o O Ignore input chid data EP Result e Updates parent table data Department records e Deletes child data of those tables which satisfy the Update if condition Person records Reta
352. er and you will find two XSLT files with the file names Altova MapForce User Manual 2006 Altova GmbH MapForce tutorial Multiple target schemas documents 51 MapToExpReport Target xslt and MapToExpReport Target2 xslt 4 Having installed either XMLSpy or Authentic Desktop assign either of these two XSLT files to the mf ExpReport xml file and start the transformation process 5 Assign the supplied stylesheet ExpReport Target sps to the file and click the Authentic tab Company expense Report Travel EMPLOYEES Title Hame Tel Emal Project Manager Fred Landis 143 456 768 flandis nanonull com Fred Landis Domestic daily rate add aDomesticDailyRate Foreign daily rate Domestic cash advance add a Cashadvance Foreign cash advance Expense items General info Travel Accommodation Entertainmen Date fee Domestic Foreign Cost REE na C 121 2 Chi ast l ent addat Eil to Sales addaTravel l l Location addaLlocation add aForeigndce Weal add aE Total NaN Ope add a Note add a 2003 Date 0303 add aE add aE Eill to Sales add aTravel add aAccommodation add a E Cur DON Total NaN Extra expense inte add adescription To generate program code for multiple target schemas Select the menu item File Generate code in XQuery Java C or C 2 Select the folder you want to place the generated files in and click OK A message appears showing that the generation was successful 3 Naviga
353. es and Methods Properties to navigate the object model Apolication Parent Project tree navigation Count item Newknum Project item properties Kind Name WSDLFile only available to Web service project items QualifiedName only available to Web service project items Project tree manipulation AddActiveFile only available to folder items AddrF ile only available to folder items CreateFolder only available to folder items CreateMappingForPro ject only available to Web service operations Remove Document access Open only available to mapping items and Web service operations Code generation CodeGenSettings UseDefault CodeGenSettings OutputFolder CodeGenSettings Lanquage GenerateCode GenerateCodekx GenerateCodelIn GenerateCode InEx For examples of how to use the properties and methods listed above see Example Project support Note that in order to use these properties and methods you will need to have the Enterprise or Professional edition of MapForce installed on your computer For operations with Web services the Enterprise edition is required _NewEnum Property NewEnum aS IUnknown read only Description This property supports language specific standard enumeration Errors 1700 The object is no longer valid Examples See Project Ita or Project NewEnum 2006 Altova GmbH Altova MapForce User Manual 508 The MapForce API Object Reference AddActiveFile Method AddA
354. es only have to be made to the 850 config file at the specified location to be able to access the new X1000 field locally e Only the redefined segment N2 in the current transaction will contain reference the new X1000 field e n other words the segment is redefined locally to contain the new field X1000 Local customization segment redefinition in 850 Config file Open the 850 Config file and navigate to Config Group Message Group name LoopN1 or search for LoopN1 T3 5 sCroup name LoopNl maxOceurs 200 minOecurs 0 gt 74 sSegmnent ref N1l gt 75 EE Seqment ref NZ minOecurs 0 maxOccurs 2 f gt TE Seqment ref INZ min ccurs 0 maxOccurs unbounded gt TT sSeguent ref N3 min ccurs 0 maxOccurs 2 r gt 7s Seqment ref N4 mintecurs 0 maxOccurs unbounded Replace the Segment ref N2 line with the following lines lt Segment name N2 info Additional Name Information gt lt Data ref F93 mergedEntries 2 gt lt Data name X1000 type string maxLength 35 minOccurs 0 info New Element gt lt Segment gt TE Group name LoopNl maxOceurs 400 min ccurs 0 gt 74 lt Seqment ref NL gt 75 Gi gt lt Seggment name NZ info Additional Mame Information 76 Data reft F9S mergedEntries 2 gt TT Data name HLOOO0 type string maxLength 35 min ce 78 ei Seqment gt 7a tfeqment reft INZ mindecurs 0 waxOceurs
355. eseesesesssssssssssssssssesssssssssssssssssseseseeeesseeeeees 271 190 TCX OX RG ei Ce cerisiers aE Ean arean ren 273 PeT Rp aE E a E A A 274 UDO SOC OMCS e E E E E E E E 279 a OWN E E E 283 Dod Node AR Aaaa E aa 287 D oa Dooe a E E ee reer ee 288 1960 Store as CSV separated ores casa cehet Greece san seaanascanssaanenatet Geeeusesassrneraucanesnnnesecer 289 19 6 7 Store as FLIP delimited ee ccescecceescescecsscscesssceceusucescuscescesaeeeees 294 DS SUORS VANS E accaneteeevaceteckdansteuecessesacceseceyececeeetes 296 20 MapForce and EDI 300 20 1 EDIFACTTemminoloty screener re Eiana 301 20 2 UN EDIFACT to XML Schema mapping seessssssssssssssssseeeererssssssssssssssseeererreessssssss 302 Altova MapForce User Manual 20 3 UN EDIFACT and ANSI X12 as target components eee eeeee 20 3 1 UN EDIFACT target validation cccccccssssseseseeeeeeeeeeees 20 3 2 ANSI X12 target validation ccc ccccccccccccccccceeeeeeeeeeeeeeeeeeeeess 20 3 3 Legal values and qualifiers ccccccccecccceeceeeeeeaeeeeeseeeseeeeeeeeees 20 4 Converting customized EDI configuration files ccceeeceeeeeeeeeeeeeeeeeeees 20 5 Customizing an EDIFACT message 2 00 ccccccccssssssseeesseseeeeceeeeeseeeeeeaas 20 5 1 EDIFACT customization Set Up cccccccccccceceecssessssseeeeeeeeeeeees 202 Global CUS OMNI AOU En E E E 20 3 3 TiOCAl CUSTOMIZATION sessie Eea EE 20 5 4 Inline customization
356. esheet used to view the mapping result in Authentic view Tut ExpReport msource mfd The mapping file for this example Please note The files used in this section are also available in the MapForceExamples Tutorial folder Altova MapForce User Manual 2006 Altova GmbH MapForce tutorial Mapping multiple source items to single target items 53 3 7 1 Creating the mappings The method described below is a recapitulation of how to set up the mapping environment 1 Click the Insert XML Schema File icon 2 Select the mf ExpReport xsdi file from the Open dialog box and select the mf ExpReport xml file as the XML instance file 3 Click the expense report entry hit the key on the numeric keypad to view all the items resize the component if necessary 4 Click the Insert XML Schema File icon 5 Select the ExpReport combined xsd file from the Open dialog box You are now prompted for a sample XML file for this schema 6 Click No and select Company as the root element of the target document select raat EMS a l Namespace URI CashAdvance http my company corm Http fry company com Date http 4 my company com Location http my company corm Restaurant http my company com Cancel The target schema component now appears in the mapping tab 7 Click the Company entry hit the key on the numeric keypad to view all the items and resize the window if necessary mf ExpRepart ExpReport com
357. esignated evaluation period Upon such expiration date your license will expire unless otherwise extended Access to any files created with the Evaluation Software is entirely at your risk You acknowledge that Altova has not promised or guaranteed to you that Pre release Software will be announced or made available to anyone in the future that Altova has no express or implied obligation to you to announce or introduce the Pre release Software and that Altova may not introduce a product similar to or compatible with the Pre release Software Accordingly you acknowledge that any research or development that you perform regarding the Pre release Software or any product associated with the Pre release Software is done entirely at your own risk During the term of this Software License Agreement if requested by Altova you will provide feedback to Altova regarding testing and use of the Pre release Software including error or bug reports If you have been provided the Pre release Software pursuant to a separate written agreement your use of the Software is governed by such agreement You may not sublicense lease loan rent distribute or otherwise transfer the Pre release Software Upon receipt of a later unreleased version of the Pre release Software or release by Altova of a publicly released commercial version of the Software whether as a stand alone product or as part of a larger product you agree to return or destroy all earlier Pre release Softwar
358. essage 3 Click the Cancel button to skip the selection of the source EDI file for the moment The ORDERS component is now visible in the mapping window 4 Navigate to Envelope Interchange Group Message SG2 SG5 CTA 056 to see the new X1000 element Altova MapForce User Manual 2006 Altova GmbH MapForce and EDI Customizing an EDIFACT message 329 w ORDERS ee MAD Name and address 4214 NAD NAME AND ADDRESS l OLOC PLACE LOCATION IDENTIFICATION l i ESC FID FINANCIAL INSTITUTION INFORMATION 44 5G3 RFF Reference 2 Ha SGA DOC Document message details 2 4 5G5 CTA Contact information 2 HA OQCTA CONTACT INFORMATION oe F 3139 CONTACT FUNCTION CODE a C056 DEPARTMENT OR EMPLOYEE DETAILS on F313 Department or employee name code oo F3412 Department or employee name i 1000 New Element 2006 Altova GmbH Altova MapForce User Manual 330 MapForce and EDI Customizing an EDIFACT message 20 5 3 Local customization e Changes only have to be made to the ORDERS config file at the specified location to be able to access the new X1000 field locally e All segments in the Orders message that use composite C056 will contain reference the new element Local customization composite redefinition in ORDERS Config file Open the ORDERS Config file in XMLSpy or in you preferred editor and navigate to Config Message element tubl version 1 0 encoding UTF g t gt H Config xml
359. essional edition is required ActiveProject Enterprise or Professional edition is required MapForce code generation HighlightSerializedvarker Examples The following examples show how the automation interface of MapForce can be accessed from different programming environments in different languages SSS SS eee egin VBA example create a new instance of lt SPY MAP gt Dim objMapForce As Application Set objMapForce CreateObject MapForce Application SSS SSS SSS cnd Example H 233335333 45s e a a pogin Veocript Ska le S25 4444 5544 54 4 access a running or create a new instance of MapForce works With scripte running an che Windows scripting host Set objMapForce GetObject MapForce Application ara ey Sere en 6 ole 6 eS T See ame oie Gegin d Ct OROG See eee eee Access a running or create a new instance of lt MapForce works with scripts executed in the Windows scripting host try objMapForce WScript GetObject MapForce Application unhide application if it is a new instance objMapForce Visible true catch err WScript Echo Can t access or create MapForce Application if SSeS See SG Snel le Hoses eee eae Altova MapForce User Manual 2006 Altova GmbH The MapForce API Object Reference 473 Events This object supports the following events OnDocumentOpened OnPro ectOpened OnDocumentOpened Event On
360. et Of xsl transform element as shown in the following listing lt xsl stylesheet version 2 0 xmins xsl http www w3 org 1999 XSL Transform xmins xs http www w3 org 2001 XMLSchema xmlns fn http www w3 org 2005 xpath functions lt xsl stylesheet gt The following points should be noted e The Altova XSLT 2 0 Engine uses the XPath 2 0 and XQuery 1 0 Functions namespace listed in the table above as its default functions namespace So you can use XPath 2 0 and XSLT 2 0 functions in your stylesheet without any prefix If you declare the XPath 2 0 Functions namespace in your stylesheet with a prefix then you can Altova MapForce User Manual 2006 Altova GmbH Appendices Engine information 585 additionally use the prefix assigned in the declaration e When using type constructors and types from the XML Schema namespace the prefix used in the namespace declaration must be used when calling the type constructor for example xs date e With the CRs of 8 June 2006 the untypedAtomic and duration datatypes dayTimeDuration and yearMonthDuration which were formerly in the XPath Datatypes namespace typically prefixed xat have been moved to the XML Schema namespace e Some XPath 2 0 functions have the same name as XML Schema datatypes For example for the XPath functions fn string and fn boolean there exist XML Schema datatypes with the same local names xs string and xs boolean So if you were to use the X
361. eted for the sake of clarity Looking at MappingMain1 Object run All parameters passed to the run method except for the last one CompletePO xml are source files Please ensure that the last parameter is the target file In this example the source files are e XML file Short PO xml Altova MapForce User Manual 2006 Altova GmbH Code Generator Integrating MapForce code in your application 435 e Database file CustomerAndArticles mdb including the connection string The two empty parameters following the initial database parameter are intended for the Username and Password in clear text for those databases where this data is necessary the target file is e CompletePO xml To define your own source or target files Directly edit the parameters passed to the run method of MappingMain1 Object To use an XML input stream as the XML data source Navigate to the run method declaration in the code and configure the specific parameters there To add extra error handling code e Edit the code below the catch Exception e code 2006 Altova GmbH Altova MapForce User Manual 436 Code Generator Integrating MapForce code in your application 25 5 2 MapForce code in C applications Having generated the C code in MapForce and defined a folder named output as the output folder 1 Navigate to the output Mapping folder and open the Mapping sIn file E output m Altova APS Altova
362. ets the content of the MapForceControlDocument object to a new empty document Please use the Path property to set path and filename Otherwise the control can t save the document using SaveDocument Open Method open st rFileName as string as boolean Dispatch Id 1001 2006 Altova GmbH Altova MapForce User Manual 574 MapForceControl Object Reference Description Open loads the file strFileName as the new document into the control OpenDocument deprecated Method OpenDocument strFileName as string as boolean deprecated Description OpenDocument loads the file strFileName as the new document into the control QueryStatus Method QueryStatus nCmdID as long as long Dispatch Id 9 Description QueryStatus returns the enabled disabled and checked unchecked status of the command specified by ncmdID The status is returned as a bit mask Bit Value Name Meaning 0 1 Supported Set if the command is supported 1 2 Enabled Set if the command is enabled can be executed 2 4 Checked Set if the command is checked This means that if QueryStatus returns 0 the command ID is not recognized as a valid MapForce command If QueryStatus returns a value of 1 or 5 the command is disabled The client should call the QueryStatus method of the document control if there is currently an active document available in the application Reload Method Reload as boolean Dispatch Id 1002 Description Reload updates
363. event handler should not be accessed The corresponding open event is Application OnDocumentOpened OnModifiedFlagChanged Event OnModifiedFlagChanged i_bIsModified as Boolean Description This event is triggered when a document s modification status changes 2006 Altova GmbH Altova MapForce User Manual 482 The MapForce API Object Reference Activate Method Activate Description Makes this document the active document Errors 1200 The application object is no longer valid Application Property Application as Agplication read only Description Retrieves the application s top level object Errors 1200 The application object is no longer valid 1201 Invalid address for the return parameter was specified Close Method close Description Closes the document without saving Errors 1200 The application object is no longer valid 1201 Invalid address for the return parameter was specified FullName Property FullName as String Description Path and name of the document file Errors 1200 The application object is no longer valid 1201 Invalid address for the return parameter was specified GenerateCHashCode Method GenerateCHashCode Description Generate C code that will perform the mapping Uses the properties defined in Application Options to configure code generation Errors 1200 The application object is no longer valid Altova MapForce User Manual 2006 Alt
364. eves the qualified name of a Web service item Altova MapForce User Manual 2006 Altova GmbH The MapForce API Object Reference 513 Errors 1700 The object is no longer valid 1701 Invalid address for the return parameter was specified 1702 The project item is not a part of a Web service Remove Method Remove Description Remove this project item and all its children from the project tree Errors 1700 The object is no longer valid WSDLFile Property WSDLFile as String read only Description Retrieves the file name of the WSDL file defining the Web service that hosts the current project item Errors 1700 The object is no longer valid 1701 Invalid address for the return parameter was specified 1702 The project item is not a part of a Web service 2006 Altova GmbH Altova MapForce User Manual 514 The MapForce API Enumerations 26 3 Enumerations This is a list of all enumerations used by the MapForce API If your scripting environment does not support enumerations use the number values instead Altova MapForce User Manual 2006 Altova GmbH The MapForce API Enumerations 515 26 3 1 ENUMCodeGenErrorLevel Description Enumeration values to identify severity of code generation messages Possible values eCodeGenErrorLevel_ Information eCodeGenErrorLevel_ Warning eCodeGenErrorLevel_ Error 0 1 2 eCodeGenErrorLevel_ Undefined 3 2006 Altova GmbH Altova MapForce User Manu
365. ext XML file etc In this case the file encoding automatically defaults to UTF 8 You can define the field type field names formatting etc and click OK to create a text file target Clicking the Output tab then allows you to save this text file by clicking the Save generated output as icon including its mapped contents Entering a name in this text box without using a file extension assigns this name to the 2006 Altova GmbH Altova MapForce User Manual 178 MapForce CSV and Text files CSV file options component Output file Select the target file you want to output data to when generating code with MapForce Make sure that the input and output files are different when generating code or the source file will be overwritten when the code is executed This option is only used when generating code for Java C or C File encoding Allows you to define select the encoding of the input text file If there is no entry in the Input file field then the encoding automatically defaults to UTF 8 CSV Settings Field delimiter Select the delimiter type for the text file CSV files are comma delimited per default You can also enter a custom delimiter in the Custom field Click into the Custom field and e Hit a keyboard key to enter a new value or e Double click in the Custom field to mark the current value and hit a different keyboard key to change the entry First row contains field names Sets th
366. ext structure file The lower list box allows you to select a new complex data structure i e XML Schema Database file EDI file or FlexText structure file 5 Click Insert new structure radio button select the XML Schema structure entry and click OK to continue Altova MapForce User Manual 2006 Altova GmbH User defined functions Complex user defined function XML node as input 207 E Insert Input Parameter f x Choose an existing structure or a new structure type to insert Inger an existing structure as a parameter Mame Path Description CompletePo xq C Program Files AttovalvapForce2006 Mapr C Program Files AttovalvapF orce2006 apr C Program Files Atova Map orce 2006 MapF E f Insert anew structure of the one of the following types AML Schema Structure Database Structure EQ Structure Flex Text Structure 6 Select the Articles xsd from the Open dialog box 7 Click the element that you would like to become the root element in the component e g Articles and click OK to confirm Choose schema element E x Please choose a schema element to become the root element for the parameter 7 Article El Articles 4 Article Y Number _ SinglePrice ArticleType WM Show annotations The Articles component is inserted into the user defined function Please note the input icon 4 to the left of the component name This shows that the
367. f mixed content This stripping may have an effect on the value returned by the fn position fn last and fn count functions For any node selection that selects text nodes also boundary whitespace only text nodes would typically also be included in the selection However since the XML Infoset used by the Altova engines has boundary whitespace only text nodes stripped from it these nodes are not present in the XML Infoset As a result the size of the selection and the numbering of nodes in the selection will be different than that for a selection which included these text nodes The fn position fn last and fn count functions therefore could produce results that are different from those produced by some other processors A situation in which boundary whitespace only text nodes are evaluated as siblings of other elements arises most commonly when xsl apply templates is used to apply templates When the n position fn last and fn count functions are used in patterns with a name test for example para 3 whichis short for para position 3 boundary whitespace only nodes are irrelevant since only the named elements para in the above example are selected Note however that boundary whitespace only nodes are relevant in patterns that use the wildcard for example 10 Note If a boundary whitespace only text node is required in the output then insert the required whitespace within one of the two adjoining child e
368. f the Republic of Austria excluding its conflict of laws principles and the U N Convention on Contracts for the International Sale of Goods and you expressly agree that exclusive jurisdiction for any claim or dispute with Altova or relating in any way to your use of the Software resides in the Handelsgericht Wien Commercial Court Vienna and you further agree and expressly consent to the exercise of personal jurisdiction in the Handelsgericht Wien Commercial Court Vienna in connection with any such dispute or claim If you are located in the United States or are using the Software in the United States then this Software License Agreement will be governed by and construed in accordance with the laws of the Commonwealth of Massachusetts USA excluding its conflict of laws principles and the U N Convention on Contracts for the International Sale of Goods and you expressly agree that exclusive jurisdiction for any claim or dispute with Altova or relating in any way to your use of the Software resides in the federal or state courts of Massachusetts and you further agree and expressly consent to the exercise of personal jurisdiction in the federal or state courts of Massachusetts in connection with any such dispute or claim If you are located outside of the European Union or the United States and are not using the Software in the United States then this Software License Agreement will be governed by and construed in accordance with the laws of the
369. fication for more details 2006 Altova GmbH Altova MapForce User Manual 320 MapForce and EDI UN EDIFACT and ANSI X12 as target components Extended EDIXI2 Settings Ed Interchange Control Version Humber foso 2 Request Acknowledgement Yeg af Cancel e Interchange control version number Default 05012 e Request acknowledgement Default yes Altova MapForce User Manual 2006 Altova GmbH MapForce and EDI UN EDIFACT and ANSI X12 as target components 321 20 3 3 Legal values and qualifiers Legal authorization information qualifiers 00 01 02 03 04 05 Legal security information qualifiers 00 01 Legal interchange ID qualifiers 01 02 03 04 08 09 11 12 13 14 15 17 18 19 20 21 22 23 24 25 NR Legal boolean values 0 1 Legal interchange usage indicators P T 2006 Altova GmbH Altova MapForce User Manual 322 MapForce and EDI Converting customized EDI configuration files 20 4 Converting customized EDI configuration files The format of the configuration files used to customize EDI messages has undergone a major change in MapForce2006 R3 Although several files are used in the customization process only one configuration file needs to be converted namely the Config or Config xml file A supplied XSLT stylesheet converts the old customization files to the new customization format e The XSLT file Convert EDI config xslt file is available in the MapForceEDI folder e Fi
370. forwards the Article Name records to the CompletePO XML file 10 Click the Home icon zal to return to the mapping The LookupArticle user defined function is now available under the user library 2006 Altova GmbH Altova MapForce User Manual 204 User defined functions Standard user defined function Libraries core eit logical functions ShortPO math functions ibs A 3 ShontPO string functions i F CustomerNr E Lineltems S user l E Lineltem Lookup rticle l ArticleNr l om Amount HE xslt ei xpath functions lang result last result 11 Drag the LookupArticle function into the Mapping window The user defined function is displayed e with its name LookupArticle in the title function bar e with named input and output icons Ol Lookup rticle CustomerNr gt s5 ArticleNr E Lineltems gt E 7 Lineltem gt Y ArticleNr Amount gt CompletePo El Y CompletePO E Customer E 7 Lineltems E 7 Lineltem E 4 Article Number ary wt Lt ee i i kop bal bos it Lt 1 ee Lt LER kog 10 Create the mappings displayed in the graphic below and click the Output tab to see the result of the mapping fH Completero E 7 ShortPO P i E CompletePO 4 Customer gt E E Y Customer E 4 Lineltems E Lineltems E Lineltem O a E Lineltem a ArticheNr gt E 7 Article Amount Numbe
371. g Inserts a component that uses two input and output parameters node row and bool and on true on false If the Boolean is true then the value of the node row parameter is forwarded 2006 Altova GmbH Altova MapForce User Manual 394 MapForce Reference Insert to the on true parameter If the Boolean is false then the complement value is passed on to the on false parameter Please see the tutorial example on how to use a filter a aoa Ly t IF Else Condition A condition is a component which allows you to pass on different sets of data depending on the outcome of a preset condition The component header displays the text if else e The first input parameter is a bool which contains the data you are checking against e The value true input parameter supplies the data to be passed on as a result if the condition is true e The value false supplies the data to be passed on if the condition is false e The result parameter outputs the data supplied by the value true false input parameters Exception O The exception component allows you to interrupt a mapping process when a specific condition is met or define Fault messages when using WSDL mapping projects Please see MapForce Exceptions or Webservice faults for more information Altova MapForce User Manual 2006 Altova GmbH MapForce Reference Project 395 24 4 Project MapForce supports the Multiple Document Interface and allows you to group your mappings i
372. g Default settings mapping mixed content 73 Result J sMame Nanonull Inc stame i Desc lt para gt i i ebold Yerenosbold i i sitalic mutti core processors lt italic Po lt bold Nano grid lt bold i i sitalicsottshore italic ob s paras i apara eDesc gt f fice lt Office gt lt Name Manonull Europe Ats Mame Desc i spara Pot sitalicsEuropesJitalic fod lt bold gt tive research scientists lt bold gt io sJpara gt all text nodes of the para element have been removed mapped bold and italic text content remain bold and italic item sequence still follow that of the source XML file Text nodes and mixed content mapping Text nodes can only be mapped in their entirety you cannot limit or transform the data they contain All text nodes of the para element are either mapped or excluded as in the example above Filters or any other type of function cannot be used to access text node data Mixed content child node data i e data enclosed in bold italic tags in this example can of course be mapped individually If a connector exists then the child data will be mapped There is currently no way of accessing the text node s of a mixed content element for further processing or filtering Mixed content settings Right click the para connector and select Connection Settings This opens the Connection Settings dialog box in which you can define the spec
373. g box Implementations Element for the helloworld library lt mapping xmlns xsi http www w3 org 2001 XMLSchema instance XS1 noNamespaceSchemaLocation mff xsd version 2 library helloworld gt lt implementations gt lt implementation language cs gt lt setting name namespace value HelloWorldLibrary gt lt setting name class value Greetings gt lt setting name reference value C HelloWorldLibrary He lLloWorlobiabrary dli gt lt implementation gt lt implementations gt For each language that the helloworld library should support an implementations element has to be added The settings within each implementation allow the generated code to call the specific functions defined in Java c or c The specific settings for each programming language will be discussed below Java lt implementation language JjJava gt lt setting name package value com hello functions gt lt setting name class value Hello gt lt implementation gt Altova MapForce User Manual 2006 Altova GmbH Adding custom libraries Configuring the mff file 225 It is important for the generated code to be able to find your hello class file This can be achieved by making sure that it is entered in the classpath The classpath is found in the system environment variables C lt implementation language cs gt lt setting name namespace value HelloWorldLibrary gt lt setting name class value
374. g box from where you can printout your mapping as hardcopy what ie whole diagram Print i Selection Preview Print Setup Cancel didi Use optimal CHo Page plit of pictures Prevent Allow Use current retains the currently defined zoom factor of the mapping Use optimal scales the mapping to fit the page size You can also specify the zoom factor numerically Please note that component scrollbars are not printed You can also specify if you want to allow the graphics to be split over several pages or not Print Preview Opens the same Print dialog box with the same settings as described above Print Setup Open the Print Setup dialog box in which you can define the printer you want to use and the paper settings 2006 Altova GmbH Altova MapForce User Manual 390 MapForce Reference File Validate Mapping Validating a Mapping validates e that all mappings connectors are valid e please note that the current release supports mixed content mapping Please see Validating mappings for more information Generate code in selected language Generates code in the currently selected language of your mapping The currently selected language is visible as a highlighted programming language icon in the title bar XSLT XSLT 2 XQuery Java C or C Generate code in XSLT XSLT2 This command generates the XSLT file s needed for the transformation from the source file s Select
375. g solution file Mapping sIn Solution Explorer Mapping ah x f 3 am Solution Mapping 6 projects fea Altova E AltovaFunctions E AltovaxML l This file was generated by MAFFORCE 2004 i EF ExpReport Main string args Happinglonsole cs E Mapping E 3 References YOU SHOULD NOT MODIFY THIS FILE BECAUSE IT WILL BE H AssemblyInka cs OVERWRITTEN WHEN YOU RE RUN CODE GENERATION E MappingConsole cs MappingMaini cs Refer to the NAPFORCE Documentation for further details H E MarketingExpenses http www altova com mapforce using System El namespace Mapping i public class MappingConsole i public static woid Main string args i Froperties try MappingConsole cs File Properties i 2 Select the menu option Build Build Solution to compile the mapping project Altova MapForce User Manual 2006 Altova GmbH Code Generator Generating program code 425 Debug Tools ES Build Solution Rebuild Solution Build Mapping Rebuild Mapping Batch Build Configuration Manager 3 Select the menu option Debug Run to start the application Tools Window Help Windows b Start Fo Start Without Debugging Cbrl F5 SL Processes Exceptions Ctrl Alk E Step Into Fil Step Over Fi Mew Breakpoint Ctrl B wren pee Seo E tingExpenses M a EERTE n Loading GO Projects Files sANLS pyExeFo lder MapForceExamples ExpRe port xml Saving MarketingE
376. ge Description Gets or sets the language to be used with GenerateCode or Project GenerateCode This property is consulted only if CodeGenSettings UseDefault is set to false Errors Altova MapForce User Manual 2006 Altova GmbH The MapForce API Object Reference 509 1700 The object is no longer valid 1701 Invalid language or invalid address for the return parameter was specified CodeGenSettings OutputFolder Property codeGenSettings_OutputFolder as String Description Gets or sets the output directory to be used with GenerateCode GenerateCodelIn Project GenerateCode or Project GenerateCodelrn This property is consulted only if CodeGenSettings UseDefault is set to false Errors 1700 The object is no longer valid 1701 An invalid output folder or an invalid address for the return parameter was specified CodeGenSettings UseDefault Property codeGenSettings_UseDefault as Boolean Description Gets or sets whether output directory and code language are used as defined by either a the parent folders or b the project root This property is used with calls to GenerateCode GenerateCodeIn Project GenerateCode and Project GenerateCodeln If this property is set to false the values of CodeGenSettings OutputFolder and CodeGenSettings Lanquage are used to generate code for this project item Errors 1700 The object is no longer valid 1701 Invalid address for the return parameter was specified Count Pro
377. gle element or record e Inthe example below the ForeignKey is checked to see if it is 1 and only then is one Altova element passed on to the target root element e f no mappings exist from any of the source items to the target root element then the root element of the target schema is inserted automatically Altova Hierarchical fy equal E i a P ao Altova gt pE i E esit e 4 PrimaryKey 0 Office 3 PrimarypKey 4 ForeignKey mp ho Cj baal be ol a fa filter predea ect baal m be al of be ho if ho Te i D i i i i i wt Li Li Lt Jt Lil Ll Lt Li p F ut Lt Li Li ot Lt Lt Lt L Root element not limited If you do not limit the target schema root element then all source elements records are inserted between the first root element 2006 Altova GmbH Altova MapForce User Manual 88 MapForce How To Boolean values and XSLT 1 0 6 3 Boolean values and XSLT 1 0 Currently XSLT processors can only process values as strings The values supplied by the detailed element in this example can only be true or false as defined in the schema file The example below tries to create an if else construct using the bool value of detailed Depending on the content you should either see the First or Last name of the Person element in the Target schema Trying out this mapping however shows that whatever
378. govern the interpretation of comparisons COTE L3 conversion functions boolean result boolean arg number result number arg string result string arg ei logical functions equal result a equal b Adding these conversion functions to input nodes of related functions might change the common data type and the result of the evaluation in the desired manner E g if string nodes store only numeric values a numerical comparison is achieved by adding the number conversion function in the conversion section of the core library to each input node Altova MapForce User Manual 2006 Altova GmbH MapForce How To Priority Context 91 6 5 Priority Context When applying a function to different items in a schema or database MapForce needs to know what the context node will be All other items are then processed relative to this one This is achieved by designating the item or node as the priority context A simplified version of the complete DB CompletePO mfd file available in the MapForceExamples folder is shown below Please note that there are multiple source components in this example ShortPO is a Schema with an associated XML instance file while CustomersAndaArticles is a database schema The data from both are then mapped to the CompletePO schema XML file The priority context icon is enclosed in a circle as a visual indication The CustomerNr in ShortPO is compared with the item Numbe
379. h collections and incrementing variables will not generate compilable files Text not enclosed by and is written directly to the file It s similar to using javascript in ASP If you want to place the value of a variable in the result document use the following method The result of your calculation is x so have a nice day assuming that the value of variable x is 23 the file output will be The result of your calculation is 23 so have a nice day Altova MapForce User Manual 2006 Altova GmbH Code Generator The way to SPL Spy Programming Language 451 25 7 9 Subroutines Code generator supports subroutines in the form of procedures or functions Features e By value and by reference passing of values e Local global parameters local within subroutines e Recursive invocation subroutines may call themselves Subroutine declaration Subroutines Syntax Sub SimpleSub lines of code EndSub Sub is the keyword that denotes the procedure SimpleSub is the name assigned to the subroutine Round parenthesis can contain a parameter list The code block of a subroutine starts immediately after the closing parameter parenthesis e EndSub denotes the end of the code block Please note Recursive or cascaded subroutine declaration is not permitted i e a subroutine may not contain another subroutine Parameters Parameters can also be passed by procedures using the following syntax All parameter
380. hat is to happen if a database action does not succeed for whatever reason When such an exception occurs a dialog box opens prompting you for more information on how to proceed You then select the specific option and click OK to proceed Activating this option for a specific table using the table action dialog box allows that specific database table to be rolled back when an error occurs The transaction setting can also activated for the database component by right clicking it in the Component Settings dialog box of the respective database component In this case all tables can be rolled back Altova MapForce User Manual 2006 Altova GmbH MapForce and Databases Mapping XML data to databases 137 MAPFORCE Database Transaction Exception x Error in Transaction Jauthors_1 Reason for the error Violation of PRIMARY KEY constraint UPK CL _auidind Cannot insert duplicate key in object authors SOL statement INSERT INTO dbo authors au_id au_lname au_ fname phone address city state VALUES 1 f2 32 71 76 White Johnson 408 496 7225 1 0932 Bigge F rie Choose how to continue f Rollback this transaction and stop C Rollback this transaction and continue Rollbackscontinue for all further errors C Rollback all and stop This action it available when Use Transactions ie set in the database component settings Cancel No Transaction options set
381. he empty event handler The handler implementation turns off any file reloading and displays a message box to inform the user that a file loaded by the MapForceControl has been changed from outside private void axMapForceControl_OnFileExternalChange object sender 2006 Altova GmbH Altova MapForce User Manual 540 MapForceControl Integration at Document Level AxMapForceControlLib _DMapForceControlEvents_OnFileExternalChangeEvent e MessageBox Show Attention The file e strPath has been changed from outside nbut reloading is turned off in the sample application This turns off any file reloading e varRet false Testing the Example After adding the assemblies to the Toolbox see Introduction you can run the sample project with F5 without the need to change anything in the code The main MDI Frame window is created together with a floating Toolwindow containing the Overview window of MapForce The application looks something like the screenshot below aL MapForceControl File Edit Insert Component Connection Function Output View Tools Help Window core a3 logical functions equal equal or greater equal orless greater less logical and logical rat logical or rot equal ei math functions add ceiling divide floor modulus multiply round subtract e node test functions exists hot exists sLibstitue missing ag string functions corcat contains narmalize anar F Add
382. he active one Errors 1300 The application object is no longer valid 1301 Invalid address for the return parameter was specified Application Property Application as Agplication read only Description Retrieves the application s top level object Errors 1300 The application object is no longer valid 1301 Invalid address for the return parameter was specified HighlightMyConnections Property HighlightMyConnections as Boolean Description This property defines whether connections from the selected item only should be highlighed Errors 1300 The application object is no longer valid 1301 Invalid address for the return parameter was specified Altova MapForce User Manual 2006 Altova GmbH The MapForce API Object Reference 479 HighlightMyConnectionsRecursivey Property HighlightMyConnectionsRecursively as Boolean Description This property defines if only the connections coming directly or indirectly from the selected item should be highlighed Errors 1300 The application object is no longer valid 1301 Invalid address for the return parameter was specified InsertXMLFile Method Insert XMLFile i_strXMLFileName as String i_strRootElement as String Description Adds a new item to the mapping The item s internal structure is determined by the schema defined in the specified XML file The second parameter defines the root element of this schema if there is more than one candidate The specified XML
383. he screenshot below shows the mapping console output in Sun ONE Studio Fe Output Window MappingConsole 1 0 Mapping Application Loading Ci Projects Files AMNLipyExeFolder MapForceExamples ExpReport xnl saving MarketingExpenses xml Finished 2006 Altova GmbH Altova MapForce User Manual 424 Code Generator Generating program code 25 2 2 Generating C code Prerequisites and default settings The menu option File Mapping settings defines the mapping project settings The default settings are Application name Mapping Database specfic settings can be viewed by clicking a database component and selecting the menu option Component Component Settings To generate C code in MapForce 1 Select the menu option File Generate code in C sharp You are then prompted for the target directory of the generated files 2 Select the directory you want to place the files in and click OK to confirm eg c codegen C A C Code generation completed message appears when the process was successful If not an error message appears detailing the specific error s Folder c codegen C mapping You can compile the project in VS NET 2002 2003 2005 or use the mono makefile e Mapping sin for VS NET 2002 2003 2005 e The makefile is placed in the C directory if Mono Makefile was selected in the Generation tab of the Tools Options dialog box 1 Navigate to the Mapping subdirectory and open the Mappin
384. he situation that older code from prior releases and code generated by later releases are not code compatible For this reason a compatibility mode has been introduced which generates code compatible to V2005R3 e Compatibility Mode Default is OFF e Please make it a point to use the new code generation features i e keep compatibility mode check box unchecked e The availability of the Compatibility Mode is only temporary it will be removed in a future version Code generated code for XML schemas up till V2005R3 used a static DOM document instance as parent for all nodes Altova MapForce User Manual 2006 Altova GmbH Code Generator Code generator options 441 LibraryType lib newLibraryType BookType book new BookType book addISBN new SchemaSt ring 0764549642 book addTitle new SchemaString The XML Spy Handbook book addAuthor new SchemaString Altova lib addBook book LibraryDoc doc new LibraryDoc doc setRootElementName http www nanonull com LibrarySample Library doc setSchemaLocation Library xsd optional doc save Libraryl xmL lib Code generated for XML schemas after V2005R3 The standard non parameter constructor is not used because it does not establish a reference to a DOM document A new document is created first which can then be referenced by the root node All new child nodes must then also be created in the correct
385. he title bar when the Output tab is active The file mf ExpReport combined xml is available in the MapforceExamples Tutorial folder Please note that it has been assigned an SPS file which allows you to view the XML file in Authentic View of Authentic Desktop or XMLSpy To remove duplicated items e Right click the duplicate item and select the Remove Duplicate entry from the menu To see a further example involving duplicate items please see the PersonList mfd sample file available in the MapForceExamples folder In the example 2006 Altova GmbH Altova MapForce User Manual 60 MapForce tutorial Mapping multiple source items to single target items e Different elements of the source document are mapped to the same element in the target Schema XML document e Specific elements Manager etc are mapped to a generic one using a role attribute oe l Ca Manager ly alee Eo Y PersonList gt g Employees a C Person E Manager Pee p Grena i 3 us gt First in Y LastName Ef PhoneExt pe Programmer i i B Person 2 bbe E mail i Poe role Seen p First Shads role Le F F T I Lr iw LJ 1 Le kasi koa a E 4 Programmer sen Y FirstName b 7 LastName oe PhoneExt gt i Y Email E 4 Support Y FirstName 4 LastName 7 PhoneE xt Email j kon koa e p _ lh CU ay _ kasi i i
386. i F r r of 71 2006 Altova GmbH Altova MapForce User Manual 186 MapForce CSV and Text files Mapping Fixed Length Text files to a database 8 5 1 Fixed Length Text file options Right click the Altova FLF Text file component and select Component Settings to open the dialog box Fixed Length Text import export options When defining field formats in this dialog box type checking of the respective fields is automatically performed If the inout data and the field format defined here to do not agree then the data is highlighted in red Please note The field types that one can select for a specific column are based on the default XML schema datatypes E g The Date type is in the form YYYY MM DD Text import export Input Output File APFORCE2005MapForceE xamples TutorialAltova FLF trt Input file Output file Cancel File encoding Little endiar bi Unicode UTF 8 Litte endian byte onder Big endian byte order Fited Length Field Settings Fill Character Space Period f Custom Assume record delimiters present i coy f Fired Tel Ext Email Title a E string string string 8 E 3 25 25 Vernon Calaby 582 v callaby nanonull comee Office M Further 471 f furthergnanonull comeet Account Input file Select the text file you want to use as the source file for this component Please note This field can remain empty if you are using the Text fi
387. ial industry standard for document interchange also a UN standard and MapForce supports the messages contained in directories 93A 05B with 04B as default of the UN EDIFACT standard hitp www unece org trade untdid d04b trmd trmdi2 htm There are approximately 200 different message types in this directory UN EDIFACT documents can be used as source and target components in MapForce This data can also be mapped to any number of XML schema and database components ANSI X12 is a industry standard for document interchange and MapForce supports version 5012 of the ANSI X12 specification ANSI X12 documents can be used as source and target components in MapForce This data can also be mapped to any number of XML schema and database components Please note The format of the configuration files used to customize EDI messages has undergone a major change in MapForce2006 R3 please see Converting customized EDI configuration files for more information Altova MapForce User Manual 2006 Altova GmbH MapForce and EDI EDIFACT Terminology 301 20 1 EDIFACT Terminology The following short list describes the main UN EDIFACT terms and their counterparts in ANSI X12 the US related standard Messages ANSI X12 Transactions A single EDI document is a message or transaction and is defined as a group of segments in a standard sequence Segment A single record contained in a message Segments are identified by a two or three
388. ick the Fixed radio button below CSV 4 Uncheck the Assume record delimiters present check box The preview changes at this point What we now have is a fixed format comprising of e a single field called Field1 e where the format is of type string and the e field length is one character V from person Vernon Field 1 now contains additional data 5 Click into the row containing the 1 character change the value to 8 and hit Return WEP Trae Append Field Insert Field Remove Field ad oo Altova MapForce User Manual 2006 Altova GmbH MapForce CSV and Text files Mapping Fixed Length Text files to adatabase 181 More data is now visible in the first column which is now defined as 8 characters wide 6 Click the Append Field button to add a new field and make the length of the second field 10 characters Calaby t labyinanon 7 Use the same method to create three more fields of the following lengths 3 25 and 25 characters and change the field headers to make them easier to map First Last Tel Ext Email Title The preview will then look like this Text import export Input Output File APFORCE2005MapForceE xamples TutorialsAltovarFLF tt Input file Output file Cancel File encoding Litthe endian byte order fu code UTF 8 Big endian byte order Fitted Length Field Settings Fill Character Space Period f Custom Assume record delimite
389. icons Clicking an icon and dragging creates a connector which connects to another icon when you drop it there The connector represents a mapping between the two sets of data the icons represent Please see the section Mapping between components for more information Connector The connector is the line that joins two icons It represents the mapping between the two sets of data the icons represent Please see the section Mapping between components for more information Several types of connector can be defined e Target Driven Standard connectors see source driven mixed content vs standard mapping Copy all connectors please see Copy all connections e Source Driven mixed content connectors see Source driven and mixed content mapping Constant A constant is a component that supplies fixed data to an input icon The data is entered into a Altova MapForce User Manual 2006 Altova GmbH MapForce overview Terminology 11 dialog box when creating the component There is only one output icon on a constant function You can select from the following types of data Number and All other String Filter Node Row A filter is a component that uses two input and output parameters node row and bool and on true on false If the Boolean is true then the value content of the node row parameter is forwarded to the on true parameter The on false output parameter outputs the complement node set defined by the mapping
390. icrosoft jdoc sqlserver SQLServerDriver URL jdoc microsoft sqlserver localhost Oracle 9i Download the Oracle9i Release 2 9 2 0 3 driver for JDK 1 4 ojdbc14 jar from http otn oracle com software tech java sqlj_ jdbc You will need to have an account or sign up to the Oracle Technology Network to access these drivers Ant Settings Add the full path to ojdoc14 jar to the CLASSPATH JBuilder Settings Use the menu option Tools Configure JDKs then click Add to add the jar file above Java internal usage Driver oracle jdoc OracleDriver URL jdbc oracle oci localhost Altova MapForce User Manual 2006 Altova GmbH MapForce and Databases Development environments for code generation 109 7 2 Development environments for code generation Below is a list of the requirements for each of the development environments as well as other tools that are needed when generating code using MapForce Java Minimum requirements Java2 SDK SE Standard Edition 1 4 1 Apache ANT 1 5 3 Other vendor supported IDEs Borland JBuilder 8 Optional Sun 1 Studio import of ANT build file into IDE C Minimum requirements Microsoft Net Framework SDK 1 0 for compilation and build process Additionally Microsoft Visual Studio NET 2002 2003 Microsoft Visual Studio NET 2005 Borland C Builder 1 0 MONO 0 26 Optional C Minimum requirements Microsoft Visual Studio 6 0 for compilation build process and as IDE 2
391. ific mixed content settings of the current connector Note that unavailable options are greyed out Please note that these settings also apply to complexType items which do not have any text nodes 2006 Altova GmbH Altova MapForce User Manual 74 Source driven mixed content mapping Default settings mapping mixed content Connection Settings x Connection Type Target Driven Standard Copy all Copy child items Source Driven Mixed content MW Map Text content Map Processing Instructions Map Comments Map CDATA sections Annotation Settings Descriptors mixed Starting Location C Source Connection Midpoint Target Connection Alignment Position Horizontal C Vertical Above Line C Below Line Sloped Target Driven Standard Changes the connector type to Standard mapping please see Source driven mixed content vs standard mapping for more information Source Driven mixed content Changes the connector type to source driven mixed content and enables the selection of additional elements to be mapped The additional elements have to be child items of the mapped item in the XML source file to be able to be mapped Annotation settings Individual connectors can be labeled for clarity Double click a connector and enter the name of the connector in the Description field This enables all the option
392. ight click and select Component settings please see the Reference Component Settings for more information 2006 Altova GmbH Altova MapForce User Manual 114 MapForce and Databases Mapping XML data to databases 7 3 2 Components and table relationships Table relationships are easily recognized in the database component The database component displays each table of a database as a root table with all other related tables beneath it in a tree view za ze Address Let us call the table names visible in the above diagram root tables i e they are the top level or root of the tree view Expanding a table name displays all the tables related to it The root tables are usually displayed in alphabetical sort order this has no bearing on the actual table relationships however When creating queries mappings of databases with relations including flat format SQL KML databases make sure that you create mappings between tables that appear under one of the root tables if you want the table relationships to be maintained i e when creating queries that make use of joins The graphic below shows the expanded Office root table of the Altova database The arrows to the left of the expand contract icons of each table name as well as the indentation lines show the table relationships Starting from the Office table and going down the tree view e Arrow left denotes a child table of the table above Address
393. iii a EE Eea aiian 511 Generate codel nE ices aise set N N 511 Altova MapForce User Manual FGA a E E eeece eet oa oedesectnrae geese 511 NOE PEE A E este E AT EAE E E ee see 512 ODEN SEE ER A EE E E AE EE N A 512 POO EE E EE E EA E E E E ET E E 512 Oua lN LN OE eer EE E E EE AEREE E E O E E EN IET 512 PROTO AOE EE ENE OEN EE E E ENEE E O E E A 513 VSD e oe a N T E A A 513 DOD E EOE a EE E 514 26 3 1 ENUMCodeGenErrorLevel ccccccccceeccccccceeceesscsssseeeeeeeeseeeecceceees 515 Bs 6 ee ENUMDOMTY aereeemeennen emer emer E ree eee ene ee 516 9 eo i amma t o IYD ee eee ie 517 26 3 4 ENUMProgrammingLanguage ccccccccccccceecceeeeeeeaessssseseeeeeeceeeeeeeeeeeaaas 518 26 5 ENUMProjectitem Type siccsccsesscsssenseesesssaassvcanadesessutanaesensmoseasiaveceaasdesesantausen 519 20 30 ENUMProject Type eie AEA E 520 20 31 ENUMViewMod ose serscetsetcs nnesenseent rE ne T E E ENE SEENA 521 27 MapForceControl 524 27 1 Integration at the Application Level 0 0 0 0 ccccccccccssssssesssseseeeeeeceeeeeeeeeeeeeaaaaeseseeees 525 Za Mek Teale HIME aati anon ctter ete sensei ui tnvasalaunlodatatarenetuentqieneinsaselsenladataters 526 DSTO CLS TCC ONION eena e E EN E E E E EE E EEEE 526 Add Button to Open Default Document sssssssssssososeseneeennsssssssssssssesseeseee 526 Add Buttons for Code Generation sseeeeseeessseeeeseressrsseerrerrrrrsserrrerrrrssseree 527 Connect to Custom EventS ee eeeees
394. ile in MapForce 1 Click the XQuery tab to preview the generated XQuery code 2 Click the Output tab to preview the result of the mapping E C xquery version 1 0 declare namespace a httg Aimy company comnamespace for Fexpense report in fexpense report let 41 Fexpense report return za company i attribute xsischemaLocation i for Person in Fexpense report Person 2 let v2 Person i return To generate XQuery code 1 Open the Tut ExpReport mfd file in MapForce 2 Select the menu item File Generate code in XQuery 3 Select the folder you want to place the generated XQuery file in e g MapForceExamples and click OK A message appears showing that the generation was successful 4 Navigate to the designated folder and you will find the XQuery file with the file name MapToExpReport Target xq To execute the XQuery using XMLSpy 1 Start XMLSpy and open the previously generated MapToExpReport Target xq file Altova MapForce User Manual 2006 Altova GmbH Generating XQuery 1 0 code 193 2 Select the menu option XSL XQuery XQuery execution Define an XML Source for the XQuery Choose a file JORCE2005 MapForceE xamples Tutorial mt E xpR eport xml Browse window kip Select WiL Make path relative to Always skip choosing an XML Source for the Query Statement Cancel Me Please choose a file from Your hard disk or select one of the o
395. ill characters and you enter the same fill character in the Custom field then the incoming data will be stripped of those fill characters You can also enter a custom fill character in the Custom field Click into the Custom field and e Hit a keyboard key to enter a new value or e Double click in the Custom field to mark the current value and hit a different keyboard key to change the entry Assume record delimiters present If a fixed length text file Single string is the data source for another fixed length text file mapping of two text files then setting this option in the target file creates new rows after the last column of the target has been filled Altowa FLF E Text file gt Rows gt Field wow amp Field bo Field2 ow amp Field2 if on Field Field3 gt Field4 amp Field4 gt vow Field5 Field5 In the example above the Altova FLF text file is mapped to an empty target text file my text file 2006 Altova GmbH Altova MapForce User Manual 188 MapForce CSV and Text files Mapping Fixed Length Text files to a database W Component Settings Input Output File Input file my text file Output file input tile encoding Unicode UTF f itte endian byte order Big endian byte order Fited Length Field Settings Fill Character f Space Period C Custom Assume record delimiters present Field3 Field
396. ill the next occurrence of HDR 2006 Altova GmbH Altova MapForce User Manual 278 FlexText FlexText Reference WHDR custidooos ordidaoooz pwspkh 2iI20TL itemDbDEF qtyOUOUs price 200 000 Altova MapForce User Manual 2006 Altova GmbH FlexText FlexText Reference 279 19 6 2 Split once Using this option creates two vertically aligned containers The top container contains the text defined by the condition set in the Split once container The bottom container contains the rest of the text file fragment When you first select this option default parameters are automatically set and the resultant fragments appears in both containers Note that the Split once container is currently active and displays a preview of all current records lines in the Sample Text pane Container default settings are Mode fixed length Orientation horizontal split line 1 Split base head eee a E Alora secsvs nT w CALF tet Mode Hed length Western a Split line 1 Split base head Fey MapForceFlexText2 Fe MapForceFlexText3 Sample Text De al oman ao CUM ta ther ship Mega 2 111 41579227 10 3 400 Microtome h 3 111 5152427 7 6 1200 Miscellaneous F Default result The first line of text appears in the top container The bottom container contains the rest of the text file fragment MODE Fixed length This is the default value Orientation Allows you to define how the text fragment i
397. in XPath 2 0 see fn deep equal 590 Default input value 215 default functions namespace for XPath 2 0 and XQueyr 1 0 expressions 590 in XSLT 2 0 stylesheets 584 Delete database action 131 user defined function 196 Delete child and update 126 Delimited files CSV 169 Delimiter assume present 186 field 177 non printable 312 Delimiters custom defined 312 Development environments 109 Distribution of Altova s software products 601 602 604 DII compiler settings 440 Document 481 closing 482 creating new 474 489 filename 486 on closing 481 on opening 473 opening 475 489 path and name of 482 path to 486 retrieving active document 489 save 487 save as 487 Document level examples of integration of MapForce 534 2006 Altova GmbH Index 619 Document level integration of MapForce 529 530 531 532 533 Documents 474 488 retrieving 488 total number in collection 488 DOM type enumerations for C 516 for C 495 Driver JDBC 397 JDBC drivers 107 MSSQL 2000 107 Oracle 91 107 DTD source and target 103 Duplicate input item 56 E Eclipse apply MapForce nature 383 build mapping code automatically 380 build mapping code manually 379 code generation 378 create new mapping project 377 importing MapForce examples 376 install MapForce plugin 370 374 MapForce plug in 368 start MapForce plugin 372 EDI a
398. in the target database the delete if condition fails therefore e move on to the next Table Action column Insert Rest e insert the new Person records into the Person table if any exist In this case two new person records are added to the Administration department each with the person primary key of 30 and 31 respectively Two additional examples of the Delete if table action can be viewed in the Update if combinations section 2006 Altova GmbH Altova MapForce User Manual 134 MapForce and Databases Mapping XML data to databases 7 3 6 Database Key settings When mapping to databases MapForce lets you specify how the primary key will be handled The three options below are only available if you right click a key field and select the menu option Database Key settings The primary key setting should take the table action defined for that table into account E g when inserting records the primary key setting should generally be Maximum number so that new records are automatically appended to existing ones An input icon is only available when Default handling is selected This allows source data to be mapped to the database field directly Table Field PrimaryKey x Kep values generation handling f Default handling C Masinurm number Database generated value Default handling This is the standard setting for all database fields e aninput icon exists when this opt
399. ing pplication MappingFrame frame new MappingFrame iil if packFrame frame packii m a Inporta Mapping pplication Mapping Applicationl i maint string args 1 es Ty backFrame aire frame validate Project Run Team Wizards Tools Window Help Ty Rebuild Project Mapping jp Make Mapping4pplication jawa Strg F Rebuild Mapping4pplication java ha Make Project Group a Rebuild Project Group Apply Filter Select the menu option Run Run project Altova MapForce User Manual 2006 Altova GmbH Code Generator Generating program code 419 Run Team Wizards Tools Window Help Run Project Strg Fo e Debug Project BS Optimize Project Run Mapping4pplication java Debug Mapping pplication jawa BS Optimize Mapping4pplication jawa Configurations Execute either e MappingApplication or e MappingConsole In both cases the MarketingExpenses xml target file is created MappingApplication on Mapforce Application Eo ee Dj x THIS APPLICATION WAS GENERATED BY MAPFORCE 2004 http Wawa alto comimnaptorce Please check the input and output files and press the Start button Source instance of ExpReport xsd Projects lesa MLS pyExeF older MapForceExamples ExpReport xml Instance of MarketingExpenses xsd IMarketingExpenses xm Loading C Projects Files 2uNLapyExeFolder MapForceExanples ExpReport xml saving MarketingExpenses xnl
400. ing code generation See also 2006 Altova GmbH Altova MapForce User Manual 484 The MapForce API Object Reference Code Generation GenerateOutput Method GenerateOutput Description Generates all output files defined in the mapping using a MapForce internal mapping language The names of the output files are defined as properties of the output items in the mapping Errors 1200 The application object is no longer valid 1201 Invalid address for the return parameter was specified 1206 Error during execution of mapping algorithm See also Code Generation GenerateXQuery Method GenerateXQuery Description Generates mapping code as XQuery Uses the properties defined in Application Options to configure code generation Errors 1200 The application object is no longer valid 1201 Invalid address for the return parameter was specified 1204 Error during XSLT XSLT2 XQuery code generation See also Code Generation GenerateXSLT Method GeneratexSLT Description Generates mapping code as XSLT Uses the properties defined in Application Options to configure code generation Errors 1200 The application object is no longer valid 1201 Invalid address for the return parameter was specified 1204 Error during XSLT XSLT2 XQuery code generation See also Code Generation GenerateXSLT2 Method GenerateXxSLT2 Description Generates mapping code as XSLT2 Uses the properties defined in Applicatio
401. ing this option opens the Browse for Folder dialog box where you select the location of the XSLT file Note the name of the generated XSLT file s is defined in the Application Name field of the Mapping Output dialog box This dialog is opened by selecting File Mapping Settings menu option A notification appears when the process has been completed successfully Generate code in XQuery This command generates the XQuery file s needed for the transformation from the source file s Selecting this option opens the Browse for Folder dialog box where you select the location of the XQuery file Note the name of the generated XQuery file s is defined in the Application Name field of the Mapping Output dialog box This dialog is opened by selecting File Mapping Settings menu option A notification appears when the process has been completed successfully Generate code in Java This command generates the Java file s needed for the transformation from the source file s Selecting this option opens the Browse for Folder dialog box where you select the location of the Java files Note the name of the generated Java file s are defined in the Application Name field of the Mapping Output dialog box This dialog is opened by selecting File Mapping Settings menu option A notification appears when the process has been completed successfully Generate code in C Generates the C code in the selected directory The file name created by th
402. ing with project item here Java_BasePackageName Property Java_BasePackageName as String Description sets or gets the base package name of the Java packages that will be generated This property is used only when generating Java code Errors 1500 The object is no longer valid 1501 Invalid package name specified Invalid address for the return parameter was specified Name Property Name as String read only Description Name of the project file without file path Errors 1500 The object is no longer valid 1501 Invalid address for the return parameter was specified Output_Folder Property Output_Folder as String Description sets or gets the default output folder used with GenerateCode and GenerateCodeln Project items can overwrite this value in their CodeGenSettings OutputFolder property when CodeGenSettings UseDefault Is set to false Errors 1500 The object is no longer valid 1501 Invalid folder name specified Invalid address for the return parameter was specified Output_Language Property Out put Language as ENUMProgrammingLanquage Description Sets or gets the default language for code generation when using GenerateCode Project items can overwrite this value in their CodeGenSettings OutputLanquage property when Altova MapForce User Manual 2006 Altova GmbH The MapForce API Object Reference 505 CodeGenSettings UseDefault Is set to false Errors 1500 The object is no longer valid 1501
403. input icons and one output icon e Special components can have any number of icons e g the Constant component only has an output icon This example shows how you can use the concat function to combine the First and Last names and place the result in the Title element The constant component supplies the space character between the two names rof E xpR eport ExpReport T arget G expense report exph b E 1 Company Root oo detailed e J gt o Employee l E Curency ic gt 4 Title E Person 2 _ Name oom First 1 2006 Altova GmbH Altova MapForce User Manual 22 MapForce overview Mapping between components 2 5 1 Connector properties Connectors and their properties Clicking a connector highlights it in red Hitting the Del key while highlighted deletes it immediately Right clicking a connector opens the connector context menu Double clicking a connector opens the Connection Settings dialog box Viewing connectors Spe ena m a ey MapForce allows you to selectively view the connectors in the mapping window Show selected component connectors Switches between showing e all mapping connectors or e those connectors relating to the currently selected component Show connectors from source to target oe Switches between showing e connectors that are directly connected to the currently selected component or e connectors linked to the currently sel
404. ins existing database tables Engineering in this case which do not have a counterpart in the input XML file no source keys for the Update if comparison e Inserts all Person records from the input XML instance This also includes new records that might not already exist in the database Update if on parent table Update if on child table Parenttable Department_ Jooo Table action Update it compare PrimaryKey 2006 Altova GmbH Altova MapForce User Manual 128 MapForce and Databases Mapping XML data to databases Delete datainchildtables Ja oo ooo Ignore input child data es ee child table Person C i Table action Update if lcompare PrimaryKey Delete data in child tables Ignore input child data a a a Result e Updates parent table data Department records e Deletes child data of those tables which satisfy the Update if condition Person records Retains existing database tables Engineering in this case which do not have a counterpart in the input XML file no source keys for the Update if comparison e Update if condition defined for the Person table fails because all Person records in the database have been deleted by the Delete data in child tables option There is no way to compare the database and XML data primary keys as the database keys have been deleted No records are updated Update if on parent table Delete if on child table Delete data in child
405. ion Choose plug ins and Fragments to launch From the list Use features in the workspace simulated normal startup oe Workspace Plug ins me i MapForceclient 1 0 05 El i External Plug ins guho com alova eclipseplugin 1 0 0 fy tb com altova mapforceeclipseplugin 1 0 0 4 Check that the project MapForceClient is selected in the Plug ins tab 5 Click the Run button A new Eclipse Workbench opens 6 Open any MapForce mapping in the new Workbench It will now open with a zoom level of 70 2006 Altova GmbH Altova MapForce User Manual Chapter 24 MapForce Reference 388 MapForce Reference 24 MapForce Reference The following section lists all the menus and menu options in MapForce and supplies a short description of each Altova MapForce User Manual 2006 Altova GmbH MapForce Reference File 389 24 1 File New Clears the Mapping tab if a previous mapping exists and creates a new mapping document Open Opens previously defined mapping mfd or mapping project mfp files Save Saves the currently active mapping using the currently active file name Save As Saves the currently active mapping with a different name or allows you to supply a new name if this is the first time you save it Save All Saves all currently open mapping files Save Project Saves the currently active project Close Project Closes the currently active project Print Opens the Print dialo
406. ion is selected allowing you to map data directly e the value supplied by the source item is used as the key value in the database Maximum number Use this setting when you want to Insert records into the database e aninput icon is not available when you select this option e the select statement queries the database for the maximum value of the primary key This value is then incremented by one and inserted into the new field Database generated value Use this setting when the database generates uses the Identity function to generate key values and you want to Insert records e an input icon is not available when you select this option e the select statement inserts the mapped data into the database queries the database for the key value generated by the identity function and writes it into the key field Altova MapForce User Manual 2006 Altova GmbH MapForce and Databases Mapping XML data to databases 135 7 3 7 Database Table Actions and transaction processing Table actions allow you to define how specific table data are to be manipulated MapForce currently supports the table actions insert update and delete One or more fields are used to compare source and target data to determine if the table action is to be executed The Table Action dialog box allows you to define the fields that will be compared e g PrimaryKey operators used for the comparison equal equal ignore case and action taken when all cond
407. ion of the application s user interface is restricted to what MapForce provides This includes rearrangement and resizing of helper windows and customization of menus and toolbars The only ActiveX control you need to integrate is MapForceControl Its property InteqrationLevel defaults to application level You may use Appearance and BorderStyle to configure the appearance of the control s wrapper window Do not instantiate or access MapForceControlDocument Of MapForceControlPlaceHolder ActiveX controls when integrating at application level If you have any initialization to do or if you want to automate some behaviour of MapForce use the properties methods and events described for MapForceCont rol Consider using MapForceControl Application for more complex access to MapForce functionality In this section is an example Example HIML showing how the MapForce application can be embedded in an HTML page For usage with other programming languages or more sophisticated access see the Examples of integration at document level 2006 Altova GmbH Altova MapForce User Manual 526 MapForceControl Integration at the Application Level 27 1 1 Example HTML This example shows a simple integration of the MapForce control at application level into a HTML page The integration is described in the following sections e Instantiate a MapForceControl in HTML code e Implement buttons to load documents and automate code generation tasks
408. ion process produces a version of the configuration file that adheres to the new configuration format Areas that may still need to be looked at e To parse standalone messages i e messages not enclosed in group or interchanging wrapping you may have to add minOccurs 0 on certain segments UNB UNZ for EDIFACT ISA GS for X12 e ANSI X12 date and time fields were of type string in the previous format To have MapForce treat these as date and time fields you can change the type accordingly type date or type time e The new configuration files distinguish between repeated elements and sequences consisting of several instances of a single element Repeated elements are separated by the Repetition Separator while several instances of a single element are separated by the normal Data Element Separator visible in the Component Settings dialog box When converting old configuration files the XSLT stylesheet assumes that groups and segments that have Repeat greater than one are always repeated while in the case of composite and data elements Repeat is an abbreviation for a sequence of individual elements Therefore maxOccurs is output generated for groups and segments while mergedEntries is output generated for composite and data elements e The new configuration files support ANSI X12 implicit decimals To be able to use implicit decimals add implicitDecimals lt number of implicit decimal digits gt to the ap
409. ions works as expected fields are set to null e Using set null as an input for a simpleType element will not create that element in the target component e Connecting this function to a complexType element as well as a table or row is not allowed A validation error occurs when this is done substitute null Used to map the current field content if it exists otherwise use the item mapped to the replace with parameter The image below shows an example of the substitute null function in use and is available as DB ApplicationList in the MapForceExamples folder Altova MapForce User Manual 2006 Altova GmbH MapForce and Databases Database null processing functions 165 EB Accounts gt Es Applications Groups pea Users ofS UserlD int 1 0 0 eGrouplD int 10 0 Username nyvarchar St Login nvarchar 7 0 g Created datetime pe Groups i GrouplD int i 0 0 mAppiD int 10 0 IF T l a a S a ne ere re or ona re bef kop M i 5 Applications eoAppID int i 0 0 i Jt hd in LE LT fa URL nvarchar 00 m GroupName nvarchar 50 eoAppName nvachalS0 m Description myvarcharl25 m Category nvarchar 0 Eas fi substitute rull pipfield a replace with Test file TE E Rows r i SS User string H E Application string i if Category string fy yo Description sting e F fy substitute null pfied sph Ala Descrip
410. is a child table of Office e Department is also a child of Office as well as a sibling table of Address both have the same indentation line Person is also a child table of Department e Arrow right denotes a parent of the table above Altova is the parent of the Office table Altova MapForce User Manual 2006 Altova GmbH MapForce and Databases Mapping XML data to databases 115 fe PrimaryKey ir ForeignKey gPhone E Address m Primarykey i ForeignKkey oE Person 7 PrimaryRey ir ForeignKey ry litle z Altova m PrimaryKkey Mame Person Which root tables should use when I am mapping data When creating mappings to database tables make sure you create mappings using the specific root table as the top level table E g suppose you only want to insert or update Person table data You should then create mappings using the Person table as the root table and create mappings between the source and target items of the Person fields you want to update If you want to update Department and Person data while retaining database relationships between them use the Department table as the root table and create mappings between the source and target items of both tables 2006 Alt
411. is not a MapForce mapping Maybe the file is already assigned to the target folder Application Property Application as Agplication read only Description Retrieves the top level application object Errors 1500 The object is no longer valid 1501 Invalid address for the return parameter was specified Close Method close Description Closes the project without saving Errors 1500 The object is no longer valid Count Property Count as Integer read only Description Retrieves number of children of the project s root item Errors 1500 The object is no longer valid Examples 2006 Altova GmbH Altova MapForce User Manual 502 The MapForce API Object Reference See ItemOr NewEnum CreateFolder Method createFolder i_strFolderName as String as ProjectIten Description Creates a new folder as a child of the project s root item Errors 1500 The object is no longer valid 1501 Invalid folder name or invalid address for the return parameter was specified FullName Property FullName as String read only Description Path and name of the project file Errors 1500 The object is no longer valid 1501 Invalid address for the return parameter was specified GenerateCode Method GenerateCode Description Generates code for all project items of the project The code language and output location is determined by properties of the project and project items Errors 1500 The objec
412. is restricted to specific kinds of project items The description of all methods and properties contains information about these restrictions Errors 1700 The objectis no longer valid 1701 Invalid address for the return parameter was specified Name Property Name as String Description Retrieves or sets the name of a project item The name of most items is read only Exceptions are user created folders the names of which can be altered after creation Errors 1700 The objectis no longer valid 1701 Invalid address for the return parameter was specified 1702 Project item does not allow to alter its name Open Method open as Document Description Opens the project item as a document or makes the corresponding document the active one if itis already open The project item must be a MapForce mapping or for Enterprise edition only Web service operation Errors 1700 The object is no longer valid 1701 Invalid address for the return parameter was specified 1702 The project item does not refer to a MapForce mapping file 1708 Operation not supported in current edition Parent Property Parent as Project read only Description Retrieves the project that this item is a child of Has the same effect as Application ActiveProject Errors 1700 The object is no longer valid 1701 Invalid address for the return parameter was specified QualifiedName Property QualifiedName as String read only Description Retri
413. is to generate a list of all affected customers to whom a letter must be sent In this case the mapping defines For the ComponentType name Prototype AND the Manufacturer Noname Select all related Customers and their requisite details The relationship diagram of the example database discussed in this section is shown below Seriallr Custo l Froduced t ID Testedat CustomerID Delivered at el Component TypelD Serialhr Aai Manufacturer Spec Amount Cost Name Department Phone EMail Pager Altova MapForce User Manual 2006 Altova GmbH MapForce and Databases Mapping large databases with MapForce 159 7 7 1 Complete database import Option 1 Import the complete database i e with all the tables it contains The Product database component therefore contains all tables with each table appearing as a root table along with all its related tables Using the ComponentType table as the root table the mappings filter out e the Component Name Prototype AND e the Manufacturer NoName along with e the related Customer ID and address data 6 Production gt DEJ ComponentT ype _ kani m Manufacturer i aiai 5 pec hin Amount eg koni kon ho koni po SeralNr m ProducedAt mT estedAt m DeliveredAt 3 SN mU mtiD pE Customer D kani koni m kani bg gf koni f
414. itializing starting sequence in the example above Altova MapForce User Manual 2006 Altova GmbH FlexText FlexText Reference 287 19 6 4 Node Allows you to add a new hierarchical level to the FlexText and MapForce tree structures The data that the following node container contains is passed on as is In the screenshot below the All 111 Order No container is the last container in the top branch Split once Mode fed length Unentation honzontal Split lne 1 Splt base head Mode fed length Onentation honzontal Split line 1 Split base head Repeated split re ee AM 222 Order No tE Mode delimited floating 1 Type sting Separator 22 Trim side None el Store VAL Type sting Trim side None oF Repeated split rE ER AN 222 Order No Mode delimited floating Type string Separator 22 Trim zide Mone A new container has been added to the right of the current one Please note The automatically appended container was then manually defined as Store as value The screenshot below shows both template structures as they appear when inserted into MapForce Ls Flt Root gt gt E gt Root gt E Repeated split E 7 Split once v EAN 111 Order No E Repeated split Al 222 Order No M 5 E Repeated split gt E 4 Split once gt gt AQHA Order No 7 22 Store 5 gt E Repeate
415. itions of each column are fulfilled E Altova_Hierarchical AELE Address gE Altova Data may originate from any data source XML file EDI message database text Constant component etc The mappings that define which data are to be manipulated are created using connectors in the Mapping window Database Table Actions Altova All input data are compared to the DE table data using the operators defined Hed Cancel IF all comparisons are true then the specie action ie executed i Pr Append Action ha Insert Action Action on input data fia Primarykey m Name Delete data in child tables gnore input child data Office an Delete Action Use Transactions re Table Actions are processed from left to right In the example above the Update if column is processed and then the Insert Rest column All the conditions of one column must be satisfied if the table action is to be executed When this is the case all those fields are updated where a mapping exists i e a 2006 Altova GmbH Altova MapForce User Manual 136 MapForce and Databases Mapping XML data to databases connector exists between the source and target items in the Mapping window e If acondition is not satisfied then the table action for that column is ignored and the next column is processed e f none of the conditions are true no table action takes place Delete data in child tables e
416. itor window associated with _ strFilePath Returning true from this event indicates that the client has closed the document Clients can return false if no specific handling is required and MapForceControl should try to close the editor and destroy the associated document control OnProjectOpened Event OnProjectOpened ob Project as Project Dispatch Id 2 Description This event gets triggered whenever a project is opened The argument objProjectDocument IS a Project object from the MapForce automation interface and can be used to query more details on the project or perform additional operations 2006 Altova GmbH Altova MapForce User Manual 570 MapForceControl Object Reference OnUpdateCmdUI Event OnUpdateCmdUI Dispatch Id 1 Description Called frequently to give integrators a good opportunity to check status of MapForce commands using MapForceControl QueryStatus Do not perform long operations in this callback Altova MapForce User Manual 2006 Altova GmbH MapForceControl Object Reference 571 27 5 4 MapForceControlDocument Properties Appearance Borderstyle Document IsModified Path ReadOnly ZoombLeve Ll Methods Exec New Open UuUervolatus Reload Save SaveAs If the MapForceControl is integrated in the Document Level mode each document is displayed in an own object of type MapForceControlDocument The MapForceControlDocument contains only one document at the time but c
417. kaai koa koai kog m kog m Meal Lodging E Travel PT Means E i L Li koa T i a E i Le Lt NE rav cost nr E i Company 15 Y Employee Title on Name coon Email Y DomesticD ailyR ate stk Y ForeignD ailyR ate Y Expense detail E expense item ise Currency ad Travel i oh Travel Cost io Destination i Car Rental ii h Air Travel on Misc Travel 8 Click the Output tab to see the result of the current mapping sEmployee lt xml version 1 0 encoding UTF 3 gt Company mins xsi http Way vw org 2001 MLS chema instance xsi sche f lt 7 tle Project Manager Ttle lt Mame Landis lt Mame lt Tel 123 456 78 lt Tel Email t landisienanonull com Email Oo 4 mth ew ha sexpense iteme 3 f Travel Travel Cost 337 68 gt i svlexpense item f sexpense iterns i cexpense item 3 lt Travel Travel Cost 1 014 22 s5 i slexpense item i sexpense item Pf eTravel Travel Cost 2000 s gt sfexpense tem i sexpense itemss Employee lt flompany gt Please note Empty lt expense item gt tags are generated when child items of a mapped parent item exist in the source file which have not been mapped to the target schema In this case only the travel items of the expense item parent have been mapped
418. ke sure the component name hello is in lowercase or it will not appear in the library window 2006 Altova GmbH Altova MapForce User Manual 226 Adding custom libraries Defining the component user interface 11 2 Defining the component user interface The code shown below defines how the component will appear when dragged into the mapping area lt component name hello gt lt sources gt lt datapoint name greeting_type datatype boolean gt lt sourcdes gt lt CaLrgece lt datapoint name result datatype string gt lt targets gt lt implementations gt lt implementations gt lt description gt lt short gt result hello greeting_type lt short gt lt long gt Returns a greeting sentence according to the given greeting_type lt long gt lt description gt lt component gt The new MapForce component EESE Datapoints Datapoints can be loosely defined as the input or output parameters of a function The datapoints datatype parameter specifies the parameters return values type Please note Only one target datapoint but multiple source datapoints are allowed for each function The datatype of each datapoint must be one of the following datatypes any Type boolean decimal string datetime duration date time These datatypes have to correspond to the datatypes of the function s parameters you defined in your Java C or C library Altova has therefore provided
419. language Print Setup Mapping Settings language 1 MarketingExpenses mtd pnn ETRE 2 MarketingandDailyExpenses mid expto 3 Customers DEB mfd 4 Tut ExpReport multi mfd 5 FersonDE mfd The Browse for Folder dialog box opens at this point 3 Navigate to the folder that you want the code to be placed in and click OK to confirm A C Code Generation completed message appears 4 Click OK to confirm the message The generated code is placed in subdirectories below the directory you specified and contains all the necessary libraries etc needed to compile and execute the mapping code The sequence shown here is repeated later in this document with additional information on the build and compile process of each of the programming languages For more information please see the sections below Generating Java code Generating C code Generating C code Altova MapForce User Manual 2006 Altova GmbH Code Generator Generating program code 417 25 2 1 Generating Java code Prerequisites and default settings The generated mapforce application supports Java 5 code JDBC drivers have to be installed for you to compile Java code when mapping database data Please see the section JDBC driver setup for more information The menu option File Mapping settings defines the mapping project settings The default settings are Application name Mapping and Base Package Name com mapforce JDBC specific settings
420. ld items of Desc have been connected The connector joining the para items is displayed as a dotted line to show that it is mixed content 4 Click the Output tab to see the result of the mapping lt xml version 1 0 encoading LITF a gt Company Person xmn xsi http Say sys org 2001 AML Schema instance si nohames lt Name Organization Chart Mame gt lt Office gt lt Mame gt NManonull Inc lt Mame gt Desc lt para The company was established in lt bold Yereno pold in 1995 Nanonull devel fof oP slpara gt paras White papers and further information will be made available in the near future io s para gt svDescs slOTfice SCT Tice lt Name Manonull Europe Ats Mame gt Desc lt parasIn May 2000 Manonull italic Europesitalic was set up in Vienna The team cc Desc softice lt lompan Persoan WR 5 Click the word Wrap icon LJ to view display the complete text in the Output window 2006 Altova GmbH Altova MapForce User Manual 72 Source driven mixed content mapping Default settings mapping mixed content lt Name Organization Chart Mame gt lt Office gt lt Mame gt NManonull Inc lt Mame i Desc lt para gt The company was established in lt bold Yereno bold in 1995 Nanonull develops nancelectronic technologies forsitalic muti core processors lt talic gt February 1999 saw the unveiling of the first prototype bold Mano grid bold The company hopes t
421. ldrich Bander Clovis Durnelll Ellas Fortunas Gundall Hardy Idilko Judy Krove Second Example This slightly more complex example attempts to update records in both the Department and Person tables as well as add any new Person records which might exist in the XML input file The root table used in this example is thus the Department table Files used in this example e Altova_Hierarchical xsd e altova cmpy extra xml is the XML instance for Altova_hierarchical xsd e altova mdb e to update the Department Name records e to update existing Person records e insert any new Person records i Altova Hierarchical 4 PrimaryKey oo ForeignKey 3 a Y state T street oe Y zip E Department Y PrimaryKey A 4 Person oom PrimaryKey ForeignKey EMail Y First 7 PhoneE xt s Title Altova pE Department Primary key m Foreignkey aE Office p2 Person Office Person 2006 Altova GmbH Altova MapForce User Manual 124 MapForce and Databases Mapping XML data to databases The source and target primary keys of both tables are compared using the equal operator If the two keys are identical then the mapped fields of the Department and Person tables are updated If the comparison fails in the Person table then the next table action is processed i e Insert Rest Table action Department table e Table actions Update if equal defined for Prima
422. le before you try any of the examples shown here Altova MapForce User Manual 2006 Altova GmbH MapForce and Databases Mapping XML data to databases 111 7 3 1 Setup of XML to database mapping Setting up an XML to database mapping is in no way different from the methods previously described 1 2 5 Click the Insert Schema XML instance icon and select the Altova_Hierarchical xsd Select the Altova cmpy xml file as the XML instance file Click the Altova entry and hit the key on the numeric keypad to view the items resize the component if necessary Click the Insert Database icon select the Microsoft Access ADO entry and click Next Click the C icon in the title bar to specify the language the generated code should support This setting also loads the language related library into the Libraries window Select a Source Database Please select 4 source database or a stored connection and click on nest Microsoft SOL Server 400 C Oracle OCI MySGL ODBC C Subase ODBC IEM DEZ ODBC C Any ADO Any ODBC Next Cancel Click the Browse button to select the altova mdb database available from the MapForceExamples Tutorial folder and click Next This dialog box allows you to define the specific Tables Views or System tables that you want to appear in the Database component 2006 Altova GmbH Altova MapForce User Manual 112 MapForce and Databases Mapping XML data t
423. le component as a target component for a mapping In this case the file encoding automatically defaults to UTF 8 You can define the field type field names formatting etc and click OK to create a text file target Clicking the Output tab then allows you to save this text file with its mapped output by clicking the Save generated output as icon l Entering a name in this text box without using a file extension assigns this name to the component Altova MapForce User Manual 2006 Altova GmbH MapForce CSV and Text files Mapping Fixed Length Text files to adatabase 187 Output file Select the target file you want to output data to when generating code with MapForce Make sure that the input and output files are different when generating code or the source file will be overwritten when the code is executed This option is only used when generating code for Java C or C File encoding Allows you to define select the encoding of the input text file If there is no entry in the Input file field then the encoding automatically defaults to UTF 8 Fill Character This option allows you to define the characters that are to be used to complete or fill in the rest of the fixed field when the incoming data is less shorter than the respective field definitions The custom field allows you to define your own fill character in the Custom field Stripping fill characters If the incoming data already contains specific f
424. legal authorization information qualifier See Legal values and qualifiers Legal authorization information qualifiers Whether ISA I03 contains a legal security information qualifier See Legal values and qualifiers Legal security information qualifiers Whether the two ISA I05 segments contain legal interchange ID qualifiers See Legal values and qualifiers Legal interchange ID qualifiers Whether ISA I08 contains a well formed date value Whether ISA I09 contains a well formed time value Whether ISA I13 contains a legal boolean value See Legal values and qualifiers Legal boolean values Whether ISA I14 contains a legal interchange usage indicator See Legal values and qualifiers Legal interchange usage indicators Whether ISA I12 and IEA I12 contain the same value Whether IEA I16 contains the correct number of function groups in the interchange Each function group is checked If there is a matching GS and GE pair Whether GS 373 contains a well formed date value Whether GS 337 contains a well formed time value Whether GS 28 and GE 28 contain the same value Whether GE 97 contains the correct number of messages in the function group Each message is checked If there is a matching ST and SE pair Whether ST 143 contains the correct message identifier Whether ST 829 and SE 329 contain the same value Whether SE 96 contains the correct number of segments in the message Automatic data completion for EDI X12 makes sur
425. lements For example the XML fragment lt para gt This is lt b gt bo0ld lt b gt lt i gt italic lt gt lt para gt when processed with the XSLT template lt xsl template match para gt lt xsl apply templates gt lt xsl template gt will produce Ths is bolditalac To get a Space between bold and italic in the output insert a space character within either Altova MapForce User Manual 2006 Altova GmbH Appendices Engine information 583 the lt b gt or lt i gt elements in the XML source For example lt para gt This is lt b gt bold lt b gt lt i gt italic lt gt lt para gt or lt para gt iThis is lt b gt bold amp x20 lt b gt lt i gt italicx gt lt para gt or para loans 1s lt bebold lt b gt s1 367 370s a lacK gt lt para When such an XML fragment is processed with the same XSLT template given above it will produce This is bold italic 2006 Altova GmbH Altova MapForce User Manual 584 Appendices Engine information 28 1 2 XSLT 2 0 Engine Implementation Information The Altova XSLT 2 0 Engine is built into Altova s XMLSpy StyleVision Authentic and MapForce XML products It is also available in the free AltovaXML package This section describes the engine s implementation specific aspects of behavior It starts with a section giving general information about the engine and then goes on to list the implementation specific behavior of XSLT 2 0 functions
426. les of how to use the properties and methods listed above see Example Project Support Note that in order to use these properties and methods you will need to have the Enterprise or Professional edition of MapForce installed on your computer For operations with Web services the Enterprise edition is required _NewEnum Property NewEnum aS IUnknown read only Description This property supports language specific standard enumeration Errors 1500 The object is no longer valid Examples JScript sample enumeration of a project s project items function AllChildrenOfProjectRoot 2006 Altova GmbH Altova MapForce User Manual 500 The MapForce API Object Reference objProject objMapForce ActiveProject if ob Project null for objProjectIter new Enumerator objProject objProjectIter atEnd objProjectIter moveNext objProjectItem objProjectIter item do something with project item here JScript sample iterate all project items depth first function IterateProjectItemsRec objProjectItemIiter while ob jProjectItemIter atEnd objProjectItem objProjectItemIter item do something with project item here IterateProjectItemsRec new Enumerator objProjectItem objProjectitemiter moveNext
427. les that can be converted are Config or Config xml files e Both UN EDIFACT as well as ANSI X12 customization files can be transformed Converting the configuration files using Altova XMLSpy To convert a pre 2006R3 EDI configuration file to the new format 1 Open the supplied XSLT stylesheet Convert EDI config xslt in XMLSpy 2 Select XSL XQuery XSL Transformation ema Schema design SL xQuery Authentic Convert View Browser WSDL a Bo o Eanes D Eg s5L FO Transformation Strg F10 5L Parameters sQuery Variables ea sOgery Execution Alk F10 H s sl s 7 Enable SLT 2 Query profiling 3 Choose the configuration file that you want to convert Config or Config xml Please choose sample XML file no permanent assignment found l Choose a file E2006 MapF orceE DISEDIFACT N anonul ORDERS Config Browse window 4 Click OK to start the transformation XMLSpy opens a new window called XSL Output html which contains the transformed configuration file The html extension is the default setting the converted file is XML however Text Browser convert newedi sit fm XSL Output html Validation va Bie Be s x 5 Click the Text tab to see the resulting configuration file 6 Check the converted EDI configuration file please see Checking transformed configuration files 7 Save the transformed file as lt YourConfig g
428. lhost 8080 axis services PersonWS gt lt port gt lt service gt liS style WSDL lt service name PersonWS gt lt port name PersonWSQuerySoapPort binding tns PersonWSSoapBinding gt lt soap address location http ocalhost services PersonWS asmx gt lt port gt lt service gt The example WSDL files contain both variants one of which is commented out Also the WSDL example files include the soap action parameter which is needed by IIS but ignored by AXIS Generating C code Having created or opened the Query Person database mfp project file used in the previous section 1 Select File Generate code in C 2 Select the output directory java dev in this case and hit OK to generate A C Code generation completed message appears when the process was successful If not an error message appears detailing the specific error s Several folders are automatically generated in the target directory and contain the C code project files solution files as well as visual basic scripts _ Altova __ AltovaDB __ AltovaFunctions __ AltovaXML Mapping _ J people You can compile the project in VS NET 2002 2003 or 2005 or use the mono makefile Use the generated files to compile the generated code e Mapping sln for VS NET 2003 e The makefile is placed in the C directory if Mono Makefile was selected in the Generation tab of the Tools Options dialog box Altova MapForce User Manual
429. lication startup Errors 1400 The application object is no longer valid 1401 Invalid address for the return parameter was specified UseGradientBackground Property UseGradientBackground as Boolean Description Set or retrieve the background color mode for a mapping window Errors 1400 The application object is no longer valid 1401 Invalid address for the return parameter was specified 2006 Altova GmbH Altova MapForce User Manual 498 The MapForce API Object Reference XSLTDefaultOutputDirectory Property xSLTDefaultOutputDirectory as String Description Specifies the target directory where files generated by Document GenerateXSLT are placed Errors 1400 The application object is no longer valid 1401 Invalid address for the return parameter was specified See also Code Generation Altova MapForce User Manual 2006 Altova GmbH The MapForce API Object Reference 499 26 2 8 Project Enterprise or Professional Edition Properties and Methods Properties to navigate the object model Apolication Parent File handling Ful lName Name Path Saved Save Close Project tree navigation Count item Newknum Project tree manipulation AddActiveFile AddF ile InsertWebService Enterprise edition only CreateFolder Code generation Output Folder Output Language Output _TextEncoding Java BasePackageName GenerateCode GenerateCodekx GenerateCodelIn GenerateCode InEx For examp
430. lns soapenv http schemas xmlsoap org soap fenvelope umlns xed http w W3 org 00l SMLS chena xulas sis http rua wa prg 00l SMLS chena inst anc soapeny Body mi putPersonkesponse uulns nO http fw altova com WS2DB xsd umlns xusi http w ws org Z00L RULSchema instance xumlns im http f f wi altowa com WS2DB query Confirmation xsiitype xed retring gt Thank you for adding Fred Flaqellator Slt ffG home comaqe into our spam databases Conftilrmation gt tr put Personkesponse gt soapeny Body soapenyv Envelope gt 2006 Altova GmbH Altova MapForce User Manual 358 MapForce and Webservices Generating C webservices with MapForce 21 4 Generating C webservices with MapForce The query wsdl file supplied in the Tutorial folder has a section that is commented out This is the lt Service name WS2DB gt section at the end of the file Uncomment this section and comment out the previous lt Service gt section before starting this example This example assumes that the webserver is located on the local computer Please note The URI schemes for AXIS and IIS are not compatible and changes are required in the WSDL file The differences occur in the lt service gt element which is usually at the end of the WSDL file AXIS style WSDL lt service name PersonWS gt lt port name PersonWSQuerySoapPort binding tns PersonWSSoapBinding gt lt soap address location http loca
431. lse Top Left True Bottom HoContral PTF 473 False Private MapForcex alidationWindow 620 152 4 True True The Placeholders also have the Anchor and Dock properties set in order to react on resizing of the Frame window Placeholder on a separate Toolwindow Itis also possible to place a Placeholder control on a separate floating Toolwindow To do this create a new Form as a Toolwindow and add the control as shown above The Altova MapForce User Manual 2006 Altova GmbH MapForceControl Integration at Document Level 537 MapForceOverviewWnd in the sample project contains the Overview window of MapForce Properties of the Overview Toolwindow DataBindings DynamicProperties Marnie axMapForceControlOverview 4ccessibleDescription AccessibleName 4ccessibleRole Default AllowDrop False Anchor Top Bottom Left Right Causes alidation True Dock None ImeMode HoContral Location 0 Locked False Modifiers Public PlaceholderWwindowIb MapForcexOverview Window Size 2792 766 TabIndex Oo TabStop True Tag visible True However all Placeholder controls need a connection to the main MapForceControl Normally this connection can be established automatically and there is nothing more to do The two placeholders on the MDI Frame work like this In the case of the Placeholder control in the Toolwindow we need to add some code to the public MDIMain method in MDIMain cs m_MapForceOverview new M
432. lso be accomplished with Fixed length text files The only difference is that the field lengths have to be defined manually please see Mapping Fixed Length Text files on how define field lengths Altova MapForce User Manual 2006 Altova GmbH MapForce CSV and Text files Mapping CSV files to XML 169 8 1 Mapping CSV files to XML This example maps a simple CSV file to an XML file based on the MFCompany xsd schema file All the files used in the following examples are available in the MapForceExamples Tutorial folder Having made sure you selected one of the programming languages Java C or C by clicking the respective toolbar icon Select the menu option Insert Text file or click the Insert Text file icon This opens the Insert Text Component dialog box Insert Text Component Altova MapForce provides different methods to process text files depending on ther complexity Please choose below Design graphically new structure based on a sample file Open existing FlesT ext configuration file to map it with other sources bargets Use simple processing for standard CSW delimited and or FLF fixed length files Donte Click the Use simple processing radio button and click the Continue button This opens the Text import export dialog box in which you can select the type of file you want to work with CSV or Fixed length files The CSV radio button is active by default 2006 Altova Gm
433. m Currency aw 7 ar hos z ac y Travel E Heal i E Accommodation E Y Lodging is ac Y Entertainment E Travel 5 et Mise er means z k rs Y description ow Trav cost 2 m CashAdvance an Y Destination gt i E Employee 2 of Mileage gt fC Exec if 3 i I a koni i e es es ee r La 3 Click the expand icon to see the items below it Altova MapForce User Manual 2006 Altova GmbH MapForce tutorial Mapping multiple source items to single target items 57 The structure of the new Employee item is an exact copy of the original except for the fact that there are no output icons for the duplicated items eS koa E Travel oo means 7 ofl Mise m description ac CashA dyance E Employee 2 _ Title TAT ie T iw Trav cost e Y Destination s Y Mileage E Y Parking ac Entertainment m Misc t E Y description F J T7 Lt Lt Li Le J LA 1 i ijesa n e i I aaa koni kog y Email cesses Y DomesticD ailyR ate Y ForeignD ailyRiate ee Expense detail I r Le cht i i 1 wl r al aa in kah E expense item m CashAdyvance m Exec i oe J L etd foment LL You can now use these new duplicate items as the target for the second source XML data file Use the s
434. m Field 2 l b Field 3 l L wow Field 4 Please note Default ignore containers also exist These are the new containers that are automatically appended when selecting Split once and Repeated split etc The contents of these containers are not initially mappable available to MapForce when the template is inserted You have to select one of the container options in FlexText Store as value Store as CSV etc to be able to map them Altova MapForce User Manual 2006 Altova GmbH FlexText FlexText Reference 289 19 6 6 Store as CSV separated Store CSV allows you to store text fragments as CSV text and map individual columns to MapForce Any number of CSV containers components can be created in FlexText and each of the CSV containers may have different separators The Sample Text pane provides an overview of the current CSV fragment and also allows you to specify individual field names and field tyoes Each column appears as a mappable item in the FlexText component in MapForce Container default settings are Record separator CR LF Field separator l Quote character j Escape character none First row contains field names no The following example shows how data in a small text file is split up into two CSV files and mapped to separate XML files in MapForce Mode delimited lne based Record separator lt CA lt LF gt Separator 222 Field separator Split base head ia Quote character
435. ment is processed with the same XSLT template given above it will produce This is bold italic XSLT 2 0 elements and functions Limitations and implementation specific behavior of XSLT 2 0 elements and functions are listed in the section XSLT 2 0 Elements and Functions 2006 Altova GmbH Altova MapForce User Manual 586 Appendices Engine information XPath 2 0 functions Implementation specific behavior of XPath 2 0 functions is listed in the section XPath 2 0 and XQuery 1 0 Functions XSLT 2 0 Elements and Functions Limitations The xs1 preserve space and xs1l strip space elements are not supported Implementation specific behavior Given below is a description of how the Altova XSLT 2 0 Engine handles implementation specific aspects of the behavior of certain XSLT 2 0 functions format date format dateTime formatTime Presentation modifiers and formatting tokens in the variable markers of the Picture argument are not supported and if supplied are ignored The optional Language Calendar and Country arguments are not supported and if supplied are ignored Days and weeks are returned as numbers in the case of single digit numbers there is no preceding zero The component specifier F is returned as a number Weeks of the month are reckoned from Monday to Friday The component specifier P returns am or pm in English function available The function tests for the availability of XSLT 2 0 functions not for the availa
436. most all graphical elements you can insert import or place in the Mapping tab become components Components are recognizable by the small triangles they possess These triangles input and output icons allow you to map data by creating a connection between them The following graphical elements are all components All schema types Source and target schemas All database types Source and target databases All flat files CSV and text files All EDI documents UN EDIFACT and ANSI X12 Source and target documents All function types XSLT XSLT2 XQuery Java C and C functions as well as Constants Filters and Conditions Function A function is basically an operation on data e g Add Functions have input and or output parameters where each parameter has its own input output icon Functions are available in the Libraries window and are logically grouped Dragging a function into the Mapping window creates a function component Please see the section functions and Libraries for more details Item An item is the unit of data that can be mapped from schema to schema An item can be either an element an attribute a database field or an EDI segment Each item has an input and output icon which allows you to map data from one item to another It is not mandatory that items be of the same type element or attribute when you create a mapping between them Input Output icon The small triangles visible on components are input and output
437. mponent Settings dialog box is opened If the component is a Text file then the Text import export dialog box is opened 2006 Altova GmbH Altova MapForce User Manual 398 MapForce Reference Component Component Settings 3 a x Input s ML Instance Browse Output sML Inetance for Code Generation FORCE 2004 MapForceE xamples DraChart am Browse Schema file Files ValtovaS MAPFORCE 2004M apF orceE samples Orglhart xed Pretis for target namespace cence Input XML Instance Allows you to select or change the XML Instance for the currently selected schema component This field is filled when you first insert the schema component and assign an XML instance file Output XML Instance for code generation This is file name and path where the XML target instance is placed when generating and executing program code The entry from the Input XML Instance field is automatically copied to this field when you assign the XML instance file If you do not assign an XML Instance file to the component then this field contains the entry schemafilenameandpath xml Schema file Shows the file name and path of the target schema Prefix for target namespace Allows you to enter a prefix for the Target Namespace if this is a schema XML document A Target namespace has to be defined in the target schema for the prefix to be assigned here The database settings for this dialog box are only displayed if you open th
438. ms the defined mapping v Mapping application can nowextended by user or be N imported into own application 2006 Altova GmbH Altova MapForce User Manual 414 Code Generator Introduction to code generator Code generator templates Output code is completely customizable via a simple yet powerful template language which gives full control in mapping XML Schema built in data types to the primitive datatypes of a particular programming language lt allows you to easily replace the underlying parsing and validating engine customize code according to your company s writing conventions or use different base libraries such as the Microsoft Foundation Classes MFC and the Standard Template Library STL Built in code generation frees software developers from the mundane task of writing low level infrastructure code enabling them to focus on implementing critical business logic By automatically generating a programming language binding MapForce accelerates project development time from initial design to final implementation resulting in substantial cost savings and time to market advantages Altova MapForce User Manual 2006 Altova GmbH Code Generator Generating program code 415 25 2 Generating program code This example shows the general sequence that needs to be followed to generate program code from MapForce The example uses the MarketingExpenses mfd file available in the MapforceExamples folder Please als
439. n Options to Altova MapForce User Manual 2006 Altova GmbH The MapForce API Object Reference 485 configure code generation Errors 1200 The application object is no longer valid 1201 Invalid address for the return parameter was specified 1204 Error during XSLT XSLT2 XQuery code generation See also Code Generation HighlightSerializedMarker Method HighlightSerializedMarker i_strSerializedMarker as String Description Use this method to highlight a location in a mapping file that has been previously serialized If the corresponding document is not already loaded it will be loaded first See GenerateCodeEx for a method to retrieve a serialized marker Errors 1000 The application object is no longer valid 1001 Invalid address for the return parameter was specified 1007 The string passed in _strSerializedMarker is not recognized a serialized MapForce marker 1008 The marker points to a location that is no longer valid JavaSettings BasePackageName Property JavaSettings_BasePackageName as String Description Sets or retrieves the base package name used when generating Java code This property is available in Ul dialog for the Document Settings Errors 1200 The application object is no longer valid 1201 Invalid address for the return parameter was specified See also Code Generation MapForceView Property MapForceView aS Document read only Description This property gives access to functionality sp
440. n gt lt implementations gt lt component gt A function may be called HelloFunction in Java or HelloFunctionResponse in C This is why you need to specify a separate function name for each programming language A function for each of the three programming languages might look like the following AeCnnonent name hello gt lt implementations gt lt implementation language cs gt lt function name HelloFunction gt lt implementation gt lt implementation language java gt lt function name HelloFunction gt lt implementation gt lt implementation language cpp gt lt function name HelloFunctionResponse gt lt implementation gt lt implementations gt lt component gt The value you supply as function name must of course exactly match the name of the function in the Java C or C class Altova MapForce User Manual 2006 Altova GmbH Adding custom libraries Writing your libraries 229 11 4 Writing your libraries How to write a Java library Create a new Java class using the previous example name it Hello Add the package name you provided under lt implementation language java gt lt setting name package value com hello functions gt lt setting name class value Hello gt lt implementation gt Add the line import com altova types this enables you to use the Schema simpleTypes If you encounter problems finding the com altova types on
441. n this section Automatic data completion are NOT inserted or created The correct values cannot be ascertained automatically Given a target parent element A in the target EDI component with child items x y and z where y is mandatory parent element A will only be created in the output file if 2006 Altova GmbH Altova MapForce User Manual 316 MapForce and EDI UN EDIFACT and ANSI X12 as target components the mandatory child element y in the target component has been mapped Functional group checking makes sure e That UNG 0038 exists If it does not contain data the name of the message is inserted e That UNG S006 and UNG SO07 exist e That UNG S004 exists If it does not contain data the current date time in EDI format is inserted e That UNG 0051 exists If it does not contain data the first two characters of the controlling agency from the user defined settings are inserted See Settings Controlling agency e That UNE 0060 exists If it does not contain data the number of messages in the group is calculated and inserted e That UNE 0048 exists If it does not contain a value the value from UNG 0048 is copied e That UNG 0048 exists If it does not contain a value the value from UNE 0048 is copied Message checking makes sure e That UNH S009 0065 exists If it does not contain data the name of the message is inserted e That UNH S009 0052 and UNH S009 0054 exist e That UNH S009 0051 exists
442. n you subsequently click the XSLT XSLT2 XQuery or Output tabs Defining multiple target schemas of the same name for code generation Both target schemas have the same name in this example so we have to make sure the code generator can distinguish between them When generating XSLT there is no need to do this 1 Right click the second target schema document and select the Component Settings option 2 Enter a file name in the Output XML instance field C Progra 1 Altova MapForce MapForceExamples Tutorial SecondXML xml for example Note that you have to insert the absolute path when generating code The example above uses the default installation path of MapForce Creating mappings for the rest of the expense report data 1 Connect the Lodging item in the source schema to Accommodation in the second target schema 2 Connect the Lodging item to DomesticAcc 3 Connect the Lodge Cost item to DomesicAcc Cost 4 Create the following mappings between the source schema and second target schema Altova MapForce User Manual 2006 Altova GmbH MapForce tutorial Multiple target schemas documents 49 You created the same connectors for the first target schema so there is nothing new here Source schema connect to second Target schema Person Employee Result of existing First Nam and Last concatenation Title Title Phone Tel Email Email currency Currency expto Bill to Date Date E ExpReport T arget Previe
443. nal Class object Classes Class collection Collection of the classes in this namespace step through them using foreach Class Class abstraction Name Type Description ___ SS The Namespace object this Class object is part of e NamespacePrefix string ____ Prefix of the namespace in which the classis_ NamespaceURI string JURI of the namespace in which the classis Name string Name of the type in the resulting file SchemaName______string___ Name of the type as in the original schema file is also represented by a Class object BuiltInSchemaBase string Name of the root simple type as in the original schema file True if there is a root element of this type IsSimpleType True if this is a simple type IsComplexFromSimpleType boolean _ True if this is a complex type and is derived from a simple type True if the top level group type is sequence True if the top level group type is choice IsGlobal if this type is usable anywhere in the generated files 2006 Altova GmbH Altova MapForce User Manual 456 Code Generator The way to SPL Spy Programming Language IsAnonymous boolean _ jtrue if this type is a kind of a help object that will not be shown in the generated files IsInternal boolean __ true if this is a help object dealing with root elements Members Member JA class representing a complexType contains one or collection jmore Members Facets Facet A class representing a simpleTy
444. nction further doubles as an input parameter for the command line execution of the generated mapping code E Articles E Articles Be Articles Pe gt E Articles H Article Fe P E Article Number E Number ieke i C Name 4 SinglePrice rme r py Li LJ i emal Eaves resum EE resul He input 1 lt pdefaul Truvai The above example uses the Articles xsd schema and Articles xml files available in the MapForceExamples folder The article numbers in the source XML file are 1 2 3 and 4 1 Use the menu option Function Insert Input to insert the component This opens the Create Input dialog box 2 Enter a name for the function and select the datatype you want to use 3 Click in the Value field and enter a value In this case enter a value different from the one supplied by the constant e g 2 2006 Altova GmbH Altova MapForce User Manual 96 MapForce How To Input values overrides and command line parameters Create Input a x Mame Trueval Datatype nteger M Connection required Preview Code generation I Use alternative value Value 2 4 Click the Output tab to see the result of the mapping lt Yximl version 1 0 encading LITF 9 gt lt Article E shlumber 1 lt Mumber lt hlame gt T Shirt Mame lt SinglePrice 25 SinglePrice gt Article gt lt Article o shumber 1033 lt Number shlame Socks
445. nctional groups otherwise it should be the number of messages contained in the interchange Each functional group is checked Whether it contains a matching UNG and UNE pair Whether UNG S004 contains a valid date time specification Whether UNE 0060 contains the correct number of messages contained in the functional group Each message is checked Whether it contains a matching UNH and UNT pair Whether UNH S009 0052 contains the same value as UNG S008 0052 of the enclosing functional group Whether UNH 0062 and UNT 0062 contain the same value Whether UNH S009 0065 contains the correct message type specifier Whether UNT 0074 contains the correct number of segments contained in the message Automatic data completion for EDIFACT makes sure a UNB and a UNZ segment exist That if either UNG or UNE exist that the other ID also exists That a UNH and a UNT segment exist That UNB S001 exists If it does not contain data the syntax level and syntax version number from the user defined settings are used See Settings Syntax version number That UNB S002 and UNB SO038 exist That UNB S004 exists If it does not contain data the current date time in EDI format is inserted That UNZ 0036 exists If it does not contain data the number of functional groups or messages is calculated and inserted That UNZ 0020 exists If it does not contain data the value from UNB 0020 is copied Please note Any fields not mentioned i
446. nctions Mff files can of course be written for more than one language Every additional language must therefore contain an additional lt implementation gt element The specifics on the implementation element are discussed later in this document 2006 Altova GmbH Altova MapForce User Manual 224 Adding custom libraries Configuring the mff file 11 1 Configuring the mff file The steps needed to adapt the mff file to suit your needs are described below The Library Name The library name is found in the mff file line shown below Please make sure that the library name is written in lowercase letters lt mapping xmlins xsi http www w3 org 2001 XMLSchema instance xS1l noNamespaceSchemaLocation mff xsd version 2 library helloworld gt The entry that will appear in the libraries window will be called helloworld Note that the library will not appear immediately after you have clicked the Add button in the Settings dialog box Libraries are only displayed if at least one component exists containing an implementation for an enabled programming Language Libraries and their functions can be toggled on or off by deleting or adding the respective library file mff To add the new mff file to the libraries pane 1 Click the Add libraries button 2 Click the Add button in the libraries dialog box 3 Select the MFF library you want to include and click Open to load the file in the Options dialo
447. nd then evaluate for each row if child items are mapped Please note when connecting a filter from a source parent item its also necessary to connect the on true on false parameter to the parent target element If this cannot be done then do not apply this rule Connect the on false parameter to map the complement node set Connecting this parameter allows you quick access to the complement node set defined by the current mapping The same tips apply when using this parameter connect to parent items etc Don t use filters to map to child data if the parent item is mapped Using a filter to map data from a source parent to a target parent automatically applies the same filter to every child item of the particular parent Filter components do not have to be used to supply filtered data to child items if the parent item can be mapped You can therefore map child data directly Use priority context to prioritize execution when mapping unrelated items Mappings are always executed top down if you loop search through two tables then each loop is processed consecutively When mapping unrelated elements without setting the priority context MapForce does not know which loop needs to be executed first it therefore Altova MapForce User Manual 2006 Altova GmbH MapForce How To Filter components Tips 101 automatically selects the first table or data source Solution Decide which table or source data is to be looped searche
448. ndalone Versions ccceccecceceecescess 23 MapForce plug in for Eclipse 23 1 Installing MapForce plugin ccccccessseececccceeeeeeeeaaaseeeeseeseeeeeeeeeeeeeeeeanaas 23 2 Starting Eclipse and using MapForce plugin cc eeeccceccceceeeeeeeeeeeees 23 3 MapForce Editor View and Perspectives ccccceeececcccccccccccceeeeeeeeeeeeeees 23 4 Importing MapForce examples folder into Navigator ccccccccecceceeeeeees Altova MapForce User Manual 23 5 Creating new MapForce files mapping and project file ee eeeeecceeeeeeeeeeees 377 23 6 MapForce code generation seccsiccscecccecciaciceceiccccccssacetoesseocanesedodeeetaenscecssaeetpeaseoceenssaeneeess 378 23 6 1 Build mapping code manually cccccccccccccccceeeeceeeeeeeeseeseeeeeeeeeeeeeeeeeaaaas 379 23 6 2 Using MapForce Eclipse projects for automatic build ees 380 23 6 3 Adding MapForce nature to existing Eclipse Project cccccccccceeeeeees 383 23 Extending MapPorce plug in cnccsnccesescosessedsacevennsaseannccendearecanas salesceuanasareonneenebebeeenaeassees 384 24 MapForce Reference 388 AE Te nee cere cere eeter rer rer ere rererr terre eters rere rere e erryer terre eters Tere cere Terre cere e 389 DA TO e E A 392 Ber E E E nse oscencsonseeees 393 DO POE E a E 395 24S COMPONENT ssar ncestescnateacetactaantmadengdenameutetdageh acess teassenaengeceaceatetcageeass 397 2A LC OEC O e E
449. ng a dynamic menu bar based on information the MapForceControl API provides e Usage of MapForce Placeholder controls in a standard frame window e Usage of a MapForce Placeholder control in a sizeable Tool Window e How to handle an event raised by the MapForceControl API Please note that the example application is already complete There is no need to change anything if you want to run and see it working The following steps describe what general actions and considerations must be taken in order to create a project such as this Introduction Adding the MapForce components to the Toolbox Before you take a look at the sample project please add the assemblies to the NET IDE Toolbox The MapForce Installer will have already installed the assemblies in the NET Global Assembly Cache GAC If you open the Toolbox dialog under Tools Add Remove Toolbox Items the controls will appear as AxMapForceControl AxMapForceControlDocument and AxMapForceControlPlaceholder on the NET Framework Components tab Check all to make them available to the IDE Now you can open the MapForceApplication sin file in the ActiveX C MapForceApplication folder to load the project Placing the MapForceControl It is necessary to have one MapForceControl instance to set the integration level and to manage the Document and Placeholder controls of the MapForce library The control is accessible via the General section of the Toolbox helper window in the IDE To add it y
450. nge is calculated and inserted That IEA I12 exists If it does not contain data the value from ISA I12 is copied Please note Any fields not mentioned in this section Automatic data completion are NOT inserted or created The correct values cannot be ascertained automatically Given a target parent element A in the target EDI component with child items x y and z where y is mandatory parent element A will only be created in the output file if the mandatory child element y in the target component has been mapped The potentially existing function group is checked That GS 373 exists If it does not contain data the current date in EDI format is inserted That GS 337 exists If it does not contain data the current time in EDI format is inserted That GE 97 exists If it does not contain data the number of messages in the function group are calculated and inserted That GE 28 exists If it does not contain data the value from GS 28 is copied Message checking makes sure That ST 143 exists If it does not contain data the name of the message is inserted That SE 96 exists If it does not contain data the number of segments in the message is calculated and inserted That ST 329 and SE 329 exist If SE 329 does not contain data the value from ST 329 is copied Settings Clicking the Extended button in the component settings dialog box opens the extended settings dialog box Please see the EDI X12 speci
451. ngs 2404 2006 Altova GmbH Altova MapForce User Manual 552 MapForceControl Command Table 27 3 5 Component Menu Commands from the Component menu Mentet Command Name ID Edit Constant ID COMPONENT_EDIT_ CONSTANT Align Tree Left ID_COMPONENT_LEFTALIGNTREE Align Tree Left Align Tree Right ID_COMPONENT_RIGHTALIGNTREE ID_COMPONENT_CREATE_DUPLICATE_ICON Remove Duplicate ID_ COMPONENT _REMOVE_DUPLICATE_ICON Database Key Settings ID_POPUP_VALUEKEYSETTINGS Database Table Actions ID_ POPUP_DATABASETABLEACTIONS Component Settings ID COMPONENT SETTINGS 2341 Altova MapForce User Manual 2006 Altova GmbH MapForceControl Command Table 553 27 3 6 Connection Menu Commands from the Connection menu Settings for Connect Matching Children ID CONNECTION SETTINGS 32344 Connect Matching Children ID _ CONNECTION _MAPCHILDELEMENTS 2 Standard Mapping target driven ID_POPUP_NORMALCONNECTION 2006 Altova GmbH Altova MapForce User Manual 554 MapForceControl Command Table 27 3 7 Function Menu Commands from the Function menu Create User Defined Function ID_FUNCTION_CREATE_EMPTY Create User Defined Function From ID FUNCTION CREATE FROM SELECTION 32381 Selection Function Settings ID_FUNCTION_SETTINGS nsert Input ID_FUNCTION_INSERT_INPUT nsert Output ID_ FUNCTION_INSERT OUTPUT Altova MapForce User Manual 2006 Altova GmbH MapForceControl Command Table 555
452. nly Property ReadOnly as boolean Dispatch Id 1007 Description Using this property you can turn on and off the read only mode of the document If ReadOnly is true It is not possible to do any modifications ZoomLevel Property ZoomLevel as long Dispatch Id 1002 Description The ZoomLevel property allows to set the Mapping view magnification in a range from 1 to 100 A ZoomLevel of 50 is the default and shows the view content at normal size Altova MapForce User Manual 2006 Altova GmbH MapForceControl Object Reference 573 Methods The following methods are defined Document handling New Open Reload Save SaveAs OpenDocument deprecated NewDocument deprecated SaveDocument deprecated Command Handling Exec UUEervolLaclus Exec Method amp xec nCmdID as long as boolean Dispatch Id 8 Description Exec Calls the MapForce command with the ID ncmd1Ip If the command can be executed the method returns true The client should call the Exec method of the document control if there is currently an active document available in the application See also CommandsStructure to get a list of all available commands and QueryStatus to retrieve the status of any command New Method New as boolean Dispatch Id 1000 Description This method initializes a new mapping inside the control NewDocument deprecated Method NewDocument as boolean deprecated Description The method res
453. ns 2 Click the List link to display the currently deployed services which now includes the WS2DB wsdl service And now Some Services e Admin tence pwodi o Admin envice e Version pwedi o getVersion e W2DB fwsdi o getPerson 3 Click the wsdl link to open the WSDL file The WSDL file location on the server is visible in the Address text box of the browser window e g http 127 0 0 1 axis services WS2DB wsdl 2006 Altova GmbH Altova MapForce User Manual 354 MapForce and Webservices Generating Java webservices with MapForce 21 3 1 Using the webservice getPerson operation Using the webservice Using a WSDL client e g XMLSpy create and send a SOAP request 1 Select SOAP Create a new SOAP request 2 Enter the WSDL file location on the server e g http 127 0 0 1 axis services WS2DB wsdl and hit OK Please enter the WSDL file location local path or url E E x http 1 27 0 0 1 axis services wS2DB wed Browse window Cancel Choose a file Please choose a file from your hard disk or select one of the other windows curently open in skiLS py 3 Select the SOAP operation name that you want to use getPerson string Query in this case and hit OK to create the SOAP Request document Please select a soap operation name getPerson string Query putPerson Person Put i Cancel f The line containing lt Query xsi type xsd string gt
454. ns However each document is loaded fully into memory so as to parse it completely and to improve viewing and editing soeed The memory requirement increases exponentially with the size of the document For example a 512kB document would typically require about 2MB of RAM whereas a 5MB document can consume up to 50MB Memory requirements are also influenced by the unlimited Undo history When repeatedly cutting and pasting large selections in large documents memory can rapidly be depleted 2006 Altova GmbH Altova MapForce User Manual 596 Appendices Technical Data 28 2 2 Altova XML Parser When opening any XML document the application uses its built in validating parser the Altova XML Parser to check for well formedness validate the document against a schema if specified and build trees and Infosets The Altova XML Parser is also used to provide intelligent editing help while you edit documents and to dynamically display any validation error that may occur The built in Altova XML Parser implements the Final Recommendation of the W3C s XML schema specification New developments recommended by the W3C s XML Schema Working Group are continuously being incorporated in the Altova Parser so that Altova products give you a State of the art development environment Altova MapForce User Manual 2006 Altova GmbH Appendices Technical Data 597 28 2 3 Altova XSLT and XQuery Engines Altova products use the Altova XSL
455. ns xsi http fwu ws arg Z001 KMLSchema insta Met a gt Yersilon D Version BRelease gt O4b Release gt Aqency UH r Agency Meta Include href Admin Seqment Include href EDSD Segment gt Include hret UNCL Codelist gt Hessaqe gt HMessagelType ORDERsS lt MessagqgelType gt Description gt Purchase order messages Description gt l 3 4 5 6 7 3 9 EPRPRPRE Ee woh e Oo Bevision gt l4ds Revisioan gt Date gt Z004 l1l 234 Date gt Group name Envelope gt H in Ti Insert the following lines before the first Include href element insert the following lines this can be copied from the EDSD Segment file lt Elements gt lt Composite name C056 info DEPARTMENT OR EMPLOYEE DETAILS gt lt Data ref F3413 minOccurs 0 gt lt Data ref F3412 minOccurs 0 gt lt Data name X1000 type string maxLength 35 minOccurs 0 info New Element gt lt Composite gt lt Elements gt tuml version 1 0 encoding UTF s t gt H Config xulas si http rrm w3 org Z00L ANLSchema instance Wer 5 Met a Yersilon D Versilon Belesase gt O04Bs Release gt Agqgency UN r Agency lt Meta gt o D Elements gt Composite name CO56 info DEPARTMENT OR EMPLOYEE DETAILS gt Data reft Fsa413 mindecurs 0 r gt Data reft Fsd1le mindecurs 0 gt Data name ALOOO tiype string wmaxLength S5 mindecurs Composit
456. nsaction isolation Er MF begin transaction API call API call MF commit transaction MF rollback transaction not supported by DB2 not supported by DB2 MF set save point MF rollback to save point MF used init Statements none 2006 Altova GmbH Altova MapForce User Manual 154 MapForce and Databases Using MapForce to create database relationships 7 6 Using MapForce to create database relationships MapForce allows you to extract related database data even if no such relationships exist in the source database e any database fields can be used as primary or foreign keys e new relations can be created that do not currently exist in the database The MS Access altova no relation mdb database used in this example is a simplified version of the Altova mdb database supplied with MapForce The Person and Address tables as well as all table relationships have been removed in MS Access E altoya no relation Altova Hierarchical k gt Elz Altova fe PrimaryKey NTS ee i ry J J i re J J L F Phone E Address i Y PrimaryKey T a j gt ForeignKey Desc A i hates HE Mail re Y state Established street aes zip E Department oom PrimaryKey ForeignKey Laer J ee i re iw J Li Do M i a i re J J L a r B a kog None of the tables visible in the altova no relation tree have any child tables all tables are on the s
457. nstances of MapForce may still remain in the system See Error handling for details of how to avoid annoying error messages e Free references explicitly if using languages such as C or C Altova MapForce User Manual 2006 Altova GmbH The MapForce API Overview 461 26 1 Overview This overview of the MapForce API provides you with the object model for the API and a description of the most important API concepts The following topics are covered The object model Example Code Generation Example Project Support Error handling 2006 Altova GmbH Altova MapForce User Manual 462 The MapForce API Overview 26 1 1 Object model The starting point for every application which uses the MapForce API is the Application object To create an instance of the Application object call CreateObject MapForce Application from VisualBasic or a similar function from your preferred development environment to create a COM object There is no need to create any other objects to use the complete MapForce API All other interfaces are accessed through other objects with the Application object as the starting point The application object consists of the following parts each indentation level indicates a child parent relationship with the level directly above Apolication Options Project Projectitem Documents Document MapForceView ErrorMarkers ErrormMarker Once you have created an Application object you can s
458. nt and other intellectual property markings that appear on or in the Software You may not modify adapt or translate the Software You may not directly or indirectly encumber or suffer to exist any lien or security interest on the Software knowingly take any action that would cause the Software to be placed in the public domain or use the Software in any computer environment not specified in this Software License Agreement You will comply with applicable law and Altova s instructions regarding the use of the Software You agree to notify your employees and agents who may have access to the Software of the restrictions contained in this Software License Agreement and to ensure their compliance with these restrictions you agree that you are solely responsible for the accuracy and adequacy of the software for your intended use and you will indemnify and HOLD harmless ALTOVA from any 3rd party suit to the extent based upon the accuracy and adequacy of the software in your use without limitation The Software is not intended for use in the operation of nuclear facilities aircraft navigation communication systems or air traffic control equipment where the failure of the Software could lead to death personal injury or severe physical or environmental damage INTELLECTUAL PROPERTY RIGHTS Acknowledgement of Altova s Rights You acknowledge that the Software and any copies that you are authorized by Altova to make are the intellectual property of and are
459. nt child display 114 relationships preserve discard 140 Table relationships 114 Target EDI documents 312 multiple and code generation 430 multiple schemas 47 root element 87 viewing multiple schemas 50 Target item mapping multi source 52 Target driven mapping 77 Technical Information 594 Teminology 10 Template calling 234 named summing 244 Terminology EDIFACT 301 Test node testing 102 Text create new text file 186 files defining key fields 174 iterator Rows 172 mapping 179 mapping text files 168 mapping to Rows 172 nodes in mixed content 71 removing text nodes 71 Text enclosed in 177 186 time xsd time 312 Tools 408 Transactions Customizing X12 336 Tutorial 30 FlexText 262 TXT field datatypes 177 Type checking 179 Type conversion checking 248 Type driven connections 80 Types built in 455 U UI defining component 226 UN EDIFACT 300 as target 312 auto completion rules 315 custom eg 334 customizing 325 customizing configuration 334 customizing set up 326 mapping to XML 302 target validation rules 315 terminology 301 Unicode support in Altova products 598 Unicode support in Altova products 598 599 Update and delete child 126 database action 121 URI in DTDs 103 User defined separators 312 User defined changing function type 196 complex input 206 complex output 211 deleting 196 function inline standard 199
460. ntain the new element UNCL Codelist This file defines the various EDIFACT codes and the values that they may contain and is used for validation of output files in MapForce If you organization uses a special code not in the EDIFACT code list add it here EDI Collection The Collection file contains a list of all messages in the current directory It is used to provide a list of the available messages when inserting an EDIFACT file into MapForce The following example contains only one message namely ORDERS Edit this file to contain only those messages relevant to your work Orders config The configuration file for Purchase order message files This file contains all groups and segment definitions used in Orders messages Changes made to this file can define local or inline customizations Admin Segment Admin segment describes the Interchange level administrative segments They are all used to parse the EDIFACT file EDSD Segment Electronic Data Segment Definition This file defines the Segment Composite and Field names of the EDIFACT files and is used when parsing the EDIFACT file Changes made to this file are global customizations and apply to all segments and messages 2006 Altova GmbH Altova MapForce User Manual 328 MapForce and EDI Customizing an EDIFACT message 20 5 2 Global customization e Changes only have to be made to the EDSD Segment file to be able to access the new X1000 field globally
461. ntent settings of the current connector Note that unavailable options are greyed out Please note that these settings also apply to complexType items which do not have any text nodes 2006 Altova GmbH Altova MapForce User Manual 402 MapForce Reference Connection Connection Settings z a E Annotation settings Individual connectors can be labeled for clarity 1 Double click a connector and enter the name of the connector in the Description field This enables all the options in the Annotation Settings group 2 Use the remaining groups to define the position and alignment of the label Altova MapForce User Manual 2006 Altova GmbH MapForce Reference Function 403 24 7 Function Create user defined function Creates a new user defined function Selecting this option creates and empty user defined function into which you insert the components you need Please note that a single output function is automatically inserted when you define such a function and that only one output function can be present in a user defined function Please see Creating a user defined function from scratch for more information Create user defined function based on selection Creates a new user defined function based on the currently selected elements in the mapping window Please note only one output component may exist amongst the selected components Please see Adding user defined functions for more info
462. nto mapping projects Project files have a mfp extension Two types of projects can be defined e A collection of individual mappings a standard project e A related set of mappings which make up a WSDL mapping project e Both project types support code generation for the entire project Add files to project Allows you to add mappings to the current project through the Open dialog box Add active file to project Adds the currently active file to the currently open project Create Folder This option adds a new folder to the current project structure and only becomes active when this is possible The default project settings can be applied or you can define your own by clicking the Use following settings radio button Project Item Properties l x Mame New Folder 4 Code Generation Settings Use following settings Output Directory Browse Language ra Cancel Open Operation s Mapping This option is only available when working with WSDL files If a mapping for the selected WSDL operation exists then this option opens it in the Mapping pane Create Mapping for Operation Creates a mapping file for the currently selected operation of the WSDL project The operation name defined in the WSDL file is supplied in the Save as dialog box which is opened automatically Add Mapping file for Operation Allows you to add a previously saved mapping file to the currently active WSDL operation Select
463. nts Existing Connections W Ignore existing output connections f Retain C Overwrite Delete all existing 2 Activate all four check boxes and click OK E mf ExpReport E ExpReport T arget G expense report a F Company a detailed E Employe E currency e Title 4 Person p F First 7 ae Y Last Title 7 ae gt Phone i Email E expenze item Mappings have been automatically created for the Title and Email items of both schemas 3 Click the Output tab to see if there is a result lt sml version 1 0 encoding UTF 07 gt Company xmins xsi http e v3 org 200 ML Schema instance gt Employee lt Tithe Project Manager Titlhe gt lt Email t landisminanonull com Email JEmployee gt flompany Z 3 4 5 G T a 2006 Altova GmbH Altova MapForce User Manual 36 MapForce tutorial Mapping schema items You will notice that the Title and Email fields contain data originating from the XML Instance document 4 Click the Mapping tab to continue mapping Please note The settings you select in the Connect Matching Children dialog box are retained until you change them These settings can be applied to a connection by either using the context menu or by clicking the Auto connect child items icon to activate or deactivate this option Altova MapForce User Manual 2006 Altova GmbH MapForce tutorial Using functions t
464. nual 2006 Altova GmbH MapForceControl Integration at Document Level 531 27 2 2 Use MapForceControlDocument An instance of the MapForceControlDocument ActiveX control allows you to embed one MapForce mapping editing window into your application You can use any number of instances you need Each instance will have one mapping loaded New instances contain a new mapping at creation Use the method OpenDocument to load any other existing mapping file The control supports a read only mode via the property ReadOnly Use Path and SaveDocument or methods and properties accessible via the property Document to access document functionality 2006 Altova GmbH Altova MapForce User Manual 532 MapForceControl Integration at Document Level 21 2 3 Use MapForceControlPlaceHolder Instances of MapForceControlPlaceHolder ActiveX controls allow you to selectively embed the additional helper windows of MapForce into your application The property PlaceholderWindowID selects the MapForce helper window to be embedded Use only one MapForceControlPlaceHolder for each window identifier See Enumerations MapForceControlPlaceholderWindow for valid window identifiers For placeholder controls that select the MapForce project window additional methods are available Use OpenProject to load a MapForce project Use the property Project and the methods and properties from the MapForce automation interface to perform any other project related o
465. ny kaa Office name H Department name PARS Ctreet at a Y city j raans Office Tel gt Phone ie i _ First name O Department ie seven Last name L F ee ee es a B a A a D i ia a el_ Extension The Departments are output in the source file sequence for each Office Microtech Inc Admin Major Ave 1 Vancouver 5588339 Clive Cloa Microtech Inc Sales and Marketing MNajor Ave 1 Vancouver 658 Microtech Inc Manufacturing Major Ave 1 Vancouver 55883339 F Microtech Inc Level 1 support Major Ave 1 Vancouver 5585339 Microtech Partners Inc Admin Perro Byrd la24 O0ttowa 3549702 Microtech Partners Inc Sales and Marketing Perro Byrd 1ls24 0 Microtech Partners Inc Lewel fupport FPerroa Byrd 1324 0ttow oO J n on Wh Fe Mapping Person to the Rows item results in all the Persons being output E Tut company E My CS file 7 Rows ac Office name i sist Department name 4 Department 3 g Last name Name i i 3 ceva Tel Extension E 4 Person 4 EMail is fe i Position The Persons are output in the source file sequence i e each Person within each Department for each Office Microtech amp Admin Major Ave 1 Vancouver 558550339 Albert Aldrich 552 A Alg Microtech amp Admirn Major Ave 1 Vancouver 5585339 Bert Bander 471 hb banden Microtech Admin Major
466. o databases Create Schema Microsoft Jet Connection Access altova Database Tables T able C Views System Be Address Be Altova Be Department Bs Office B Person Database Owrers SelectAll Deselect 4 Selected T ables me Address is Altova me Department Flt Altova a PrimarypKey Altova Department E Office Office wom PrimaryKey F Person ForeignKey 7 Desc EMail Established 7 Click the expand icon of the Altova item to display the Altova table fields Altova MapForce User Manual 2006 Altova GmbH MapForce and Databases Mapping XML data to databases 113 E Altova_Hierarchical Flt Altova Y PrimaryKey I Jt Lt be r ka N i Office Y PrimarpKey 4 ForeignKey bo i m A Bo B a a I iw T Lt 1 Le Li kra bea Please note l Address gt ElEs Altova ne i ho i koa kon Bo Se a i i Ll 1 bal Be D i a I ary eu Lt Lt jasa how T _ ae i fe Lt i wt LT 1 T Department Office k Person ath at EE Creating mappings between database components is not possible if you select XSLT XSLT2 or XQuery as the target language XSLT does not support database queries Once you have defined the database settings using the method described above they cannot be changed by editing the component settings of the database component r
467. o expand its operations lt italic ottshore italic to drive down operational costs foo sJpara gt lt parasyhite papers and further information vill be made available in the near future io sJpara gt Desc lt fOTfice lt Office gt lt Name Manonull Europe Ats Mame Desc lt para In May 2000 Nanonulleitalic Eurapestalic was set up in Vienna The team consists of lt bold five research scientists lt bold and one administrative statt para gt svDescs lt f Office gt lt Llompan Person The mixed content text of each office description has been mapped correctly the text as well as the bold and italic tag content have been mapped as they appear in the XML source file 6 Switch back to the Mapping view Removing text nodes from mixed content items 1 Right click the para connector and select Connection Settings Connection Settings x Connection Type Target Driven Standard Copy all Copy child items f Source Driven Mixed content M Map Test content Map Processing Instructions Map Comments Map CDATA sections The image shows the default settings when you first create mixed content mapping The Map Text content check box is active per default 2 Deactivate the Map Text content check box and click OK to confirm 3 Click the Output tab to see the result of the mapping Altova MapForce User Manual 2006 Altova GmbH Source driven mixed content mappin
468. o map data 37 3 3 Using functions to map data The aim of this section is to combine two sets of data from the source schema and place the result in a single item in the target document Please note that some of the previously defined mappings are not shown in the following screen shots for the sake of clarity This will be done by e Using the Concat string function to combine the First and Last elements of the source schema e Using a Constant function to supply the space character needed to separate both items e Placing the result of this process into the Name item of the target schema Using functions to combine items 1 Click the concat entry of the string functions group in the Core library and drag it into the Mapping tab gt a E expense report d7 logical functions i E detailed math functions a3 string functions concat result contains result hormalize spa result sharts with result sting length result substring result substring afte result substring befte result translate result i la al kaa CUITency k H a F fai concat sete 4 Last Y Title i ei Y Phone ow Email E expense item oon lype bs od io ni o od inal ba baal OE Oe ee ee ee eee ee D a sansin expto expense report je detailed iow cumency Y Person E f Tay concat l Y First Ie ic rae rast pivaluel Y Title vale 2
469. o see Integrating code in your application for more information 1 Open the MarketingExpenses mfd mapping file E ExpRepott MarketingE xpenses fy conca gt El expense report gt f ri gt keting gt co detailed panat a atm 4 string resulti HE lt Person Sa CUITency gt einng l nl Pi LS om iT oo 4 gt FullName P total sum gt S Saas Y Title 5 Person wea l z i hd Y First Fy eh YE mail i spm p G expense item Y Phone l Festing i rit P a resultle on Email pstiing2 E expense item kf aneii type Pa a i na r Le ow i Li kon I 1 gt _ i LER Li Lt Lt koa j lt LER L tonal _ i init pnode row resLlthy Le L T C Marketing i Mapping Project lt Output A 2 Select the menu option File Generate code in C 2006 Altova GmbH Altova MapForce User Manual 416 Code Generator Generating program code File Edit Insert Component Connection Output View Tools Help i Mew Strg h HSLT JAVA C love E A B4 abe E Open Strqto mj Save Strg 5 Save Os E ExpReport Fe expense repor g Print E detailed Print Preview gt Bi currency gt sereen total sum gt HE Person Generate code in selected language r ai gt First Java
470. obalText strTab WSDL File is objItem WSDLFile Qualified Name is objItem QualifiedName n catch err catch ex strGlobalText striTab TI obqltem Kind n 4 recurse PrintProjectTree new Enumerator objItem strTab a T objProjectItemIter moveNext Load example project installed with MapForce function LoadSampleProject close open project objProject objMapForce ActiveProject if objProject null objProject Close Altova MapForce User Manual 2006 Altova GmbH The MapForce API Overview 467 open sample project and iterate through it sump properties of all project items objProject objMapForce OpenProject strSamplePath Maprorcebzanples mip strGlobalText PrintProjectTree new Enumerator ob jProject WScript Echo strGlobalText ob Pro ject Close a Create a new project with some folders mappings and a Web service project function CreateNewProject try create new project and specify file to store it objProject objMapForce NewProject strSamplePath Sample mfp create a simple folder structure objProject CreateFolder New Folder 1 objFolderl o
471. odically occurs that mappings produce a very large amount of code which might cause an out of memory exception during compilation In Java this can be rectified by editing the build xml file used by ANT The generated build xml file is automatically created and placed in the folder you define when generating code Change line 6 from lt javac srcdir com mapforce destdir gt to lt javac srcdir com mapforce destdir fork true memoryMaximumSize 80m gt There is a related issue that might occur when compiling very large projects using ANT which might also result in a java lang OutofMemory exception To rectify this e Add the environmental variable ANT_OPTS which sets specific ANT options such as the memory to be allocated to the compiler and add values as shown below Edit User Variable Variable name ANT OPTS Variable value server MmS12m ms512m Reserving method names When customizing code generation using the supplied spl files it might be necessary to reserve method names To do this C and Java 1 Navigate to the program installation directory e g c Program Files Altova MapForce2006 spl 2 Open either the cs spl or java spl file and insert a new line into the reserve section e g reserve myReservedWord 3 Regenerate the program code C 1 Navigate to the cpp subdirectory e g c Program Files Altova MapForce2006 spl cpp 2 Open the settings spl file and insert a new line into the rese
472. of the components that have been inserted into the active mapping e g XML Schema database EDI file or FlexText structure file The lower list box allows you to select a new complex data structure i e XML Schema Database file EDI file or FlexText structure file 2006 Altova GmbH Altova MapForce User Manual 212 User defined functions Complex user defined function XML node as output E Insert Input Parameter Choose an existing structure or a new structure type to insert D Insert an existing structure as a parameter Path Description ShortPo sd CompletePo xsd Articles xad C Program Files AtovatvapForce2006 MaprF C Program Files Altova apr orce 006 Mapr C Program Files AtovaliMapForce 2006 MapF ci f Insert anew structure of the one of the following types AML Schema Structure Database Structure EQ Structure Flex Test Structure Cancel E 4 Click Insert new structure radio button select the XML Schema structure entry and click OK to continue Select the CompletePO xsd from the Open dialog box Click the element that you would like to become the root element in the component e g Article and click OK to confirm Choose schema element B x Please choose a schema element to become the root element for the parameter G Y CompletePO E Customer E Lineltems E 7 Lineltem E 7 Article ties Y Number seve 3 SinglePrice 3 e
473. oftware or its use becomes the subject of a Claim or its use is enjoined or if in the opinion of Altova s legal counsel the Software is likely to become the subject of a Claim Altova shall attempt to resolve the Claim by using commercially reasonable efforts to modify the Software or obtain a license to continue using the Software If in the opinion of Altova s legal counsel the Claim the injunction or potential Claim cannot be resolved through reasonable modification or licensing Altova at its own election may terminate this Software License Agreement without penalty and will refund to you on a pro rata basis any fees paid in advance by you to Altova THE FOREGOING CONSTITUTES ALTOVA S SOLE AND EXCLUSIVE LIABILITY FOR INTELLECTUAL PROPERTY INFRINGEMENT This indemnity does not apply to infringements that would not be such except for customer supplied elements 6 SUPPORT AND MAINTENANCE Altova offers multiple optional Support amp Maintenance Package s SMP for the version of Software product edition that you have licensed which you may elect to purchase in addition to your Software license The Support Period hereinafter defined covered by such SMP shall be delineated at such time as you elect to purchase a SMP Your rights with respect to support and maintenance as well as your upgrade eligibility depend on your decision to purchase SMP and the level of SMP that you have purchased a If you have not purchased SMP you will receive th
474. om the source XML file which do not have a counterpart key field in the database Click the Output tab at the bottom of the mapping window to see the pseudo SQL code that this mapping produces Click the Run SQL Script icon in the function bar to run the script and update the database records If the script was successful a confirmation message appears Click OK to confirm 10 Open the Altova database and double click the Person table to see the effect E Person Table _ PrimaryKey ForeignKey EMail First Last_ E 3 flandis nanonull corn Fred 3 milandistnanonull co Michelle 3 tlittleananonull cam Ted 3 awayicdnanonull com Ann 3 gardnerainananull ce Liz I p smithnanonull cor Paul 4 a matng nanonull co Alex 4 g hammerainanonull c George 1 c Cicadatmicrotech Camilla 1 c corriganimicrotech Carol Person table Delete if condition true source and target keys are identical therefore e delete each Person record where the keys are identical Landis Butler Little Way Gardner omith Martin Hammer Cicada Corrigan e if records exist in the database with no counterpart key field in the source file then these records are not deleted and remain unchanged Altova MapForce User Manual 2006 Altova GmbH MapForce and Databases Mapping XML data to databases 133 Person table Delete if condition false source and target keys are not identical i e source keys exist which have no match
475. ommon in the Unix world and with a number of database development tools It allows Altova customers to purchase reasonably priced concurrent use multi user licenses Please note that your Altova product at no time attempts to send any information out of your LAN or over the Internet We have also designed the applications so that they send few and small network packets so as to not put a burden on your network The TCP IP ports 2799 used by your Altova product are officially registered with the IANA see http www isi edu in notes iana assignments port numbers for details and our license metering module is tested and proven technology If you are using a firewall you may notice communications on port 2799 between the computers that are running Altova products You are of course free to block such traffic between different groups in your organization as long as you can ensure by other means that your license agreement is not violated You will also notice that if you are online your Altova product contains many useful functions these are unrelated to the license metering technology 2006 Altova GmbH Altova MapForce User Manual 604 Appendices License Information 28 3 3 Copyright All title and copyrights in this software product including but not limited to images photographs animations video audio music text and applets incorporated in the product in the accompanying printed materials and in any copies of the
476. omponents in the Mapping tab To create a schema component source 1 Click the Insert XML Schema File icon 2 Select the schema file you want to use from the Open dialog box A further dialog box appears prompting you to select an XML instance file if you intend to use this schema as a data source in this mapping 3 Click Yes if this is the case and select the XML instance file The schema component now appears in the Mapping tab El expense report detailed ee currency E Person pee A First 7 ae Last Title 7 E Y Phone i Email E expense item You can now connect the schema source output icons with the target or function input icons to create your mappings To create a schema component target 1 Click the Insert XML Schema File icon 2 Select the schema file you want to use from the Open dialog box Select No when you are prompted to supply an XML instance file 3 Select the Root element of the schema you want to use Company and click OK Altova MapForce User Manual 2006 Altova GmbH MapForce overview MapForce components 13 E ExpReport T arget ow Email 4 DomesticD ailyRi 7 pees ForeignD ailyR all gt Y Expense detail gt r gt 15 expense item The schema snippet with the root element appears as a schema component The target sch
477. on lt Person Manager true The data from the CSV file have been successfully mapped to an XML file Please note The connector from the Rows item in the CSV file to the Person item in the schema is essential as it defines which elements will be iterated through i e for each Row in the CSV file a new Person element will be created in the XML output file Please see the examples that follow on how the Rows item influences the output if you are mapping to a CSV or fixed length text file 2006 Altova GmbH Altova MapForce User Manual 172 MapForce CSV and Text files Mapping XML to CSV or fixed length text files 8 2 Mapping XML to CSV or fixed length text files This example is available in the MapForceExamples Tutorial folder as Tut xml2csv mfd e Tut company xsd and Tut company xml are the source schema and XML data source respectively e My CSV file is the text file component The name is entered in the Input file field of the Text import export dialog box The mapping example is for illustration purposes only it is not supposed to be a real life example The diagram below shows how you would generally expect to map an XML file to a CSV file E My CS file E Tut company i J Altova i gt AE Rows gt Name gt p Office name gt a 4 Office l i seven Department name l L Mame e Street l l jane t street oe City I I a city oe Offic
478. on object is no longer valid 1301 Invalid address for the return parameter was specified ShowltemTypes Property ShowltemTypes as Boolean Description This property defines if types of items should be shown in the mapping diagram Errors 1300 The application object is no longer valid 1301 Invalid address for the return parameter was specified ShowLibrarylInFunctionHeader Property ShowLibraryInFunctionHeader as Boolean Description This property defines whether the name of the function library should be part of function names Errors 1300 The application object is no longer valid 1301 Invalid address for the return parameter was specified Altova MapForce User Manual 2006 Altova GmbH The MapForce API Object Reference 481 26 2 3 Document Properties and Methods Properties to navigate the object model Apolication Parent File handling Ful lName Name Path Saved Save SaveAs Close Code generation OutputSettings ApolicationName OutputSettings Encoding JavaSettings BasePackagqeName GeneratexSLT GenerateCppoCode GenerateJavaCode GenerateCHashCode GenerateCodekEx HighlightSerializedvarker View access MapForceView Events This object supports the following events OnDocumentClosed OnModifiedF lagChanged OnDocumentClosed Event OnDocumentClosed i_objDocument as Document Description This event is triggered when a document is closed The document object passed into the
479. on or file is sent by means of any MAPI compliant mail program installed on the user s PC Note All Internet communication is initiated only when directly requested by you from you This functionality is important in an XML development environment since XML is after all a technology closely related to the Internet Altova MapForce User Manual 2006 Altova GmbH Appendices License Information 601 28 3 License Information This section contains e Information about the distribution of this software product e Information about the copyrights related to this software product e The End User License Agreement governing the use of this software product Please read this information carefully It is binding upon you since you agreed to these terms when you installed this software product 2006 Altova GmbH Altova MapForce User Manual 602 Appendices License Information 28 3 1 Electronic Software Distribution This product is available through electronic software distribution a distribution method that provides the following unique benefits e You can evaluate the software free of charge before making a purchasing decision e Once you decide to buy the software you can place your order online at the Altova website and immediately get a fully licensed product within minutes e When you place an online order you always get the latest version of our software e The product package includes a comprehensive integrated on
480. on the same schema It is not necessary that they both have the same root elements however Please see Complex output components defining for an example 2006 Altova GmbH Altova MapForce User Manual Chapter 6 MapForce How To 84 MapForce How To 6 MapForce How To This section deals with common tasks that will be encountered when creating your own mappings The tasks covered are Mapping multiple tables to one XML file How to map data to the root element of target components Using boolean values in XSLT 1 0 Mixed content data and MapForce Defining the Priority context MapForce command line parameters Using input functions to override values and act as parameters in command line execution Filter components Tips Node testing Altova MapForce User Manual 2006 Altova GmbH MapForce How To Mapping multiple tables to one XML file 85 6 1 Mapping multiple tables to one XML file Mapping multiple hierarchical tables to one XML output file e You have a database and want to extract map a certain number of tables into an XML file e Primary and foreign key relationships exist between the tables e Related tables are to appear as child elements in the resulting XML file The DB_Altova_Hierachical mfd sample file in the MapForceExamples folder shows how this can be achieved when mapping from an hierarchical database The Altova_Hierarchical xsd schema is also supplied in the same folde
481. one provided by need the evaluation context the implicit timezone is taken from the CuLrenl tame system clock The timezone is always specified in the result e Anerror is raised only if no XML file is available at the specified location or if the file is not well formed The file is validated if a schema is available If the file is not valid the invalid file is loaded without schema information e n a well formed but invalid document that contains two or more elements having the same ID value the first element in document order is returned In SCope preri e Only default namespaces may be undeclared in the XML Xes document However even when a default namespace is undeclared on an element node the prefix for the default namespace which is the zero length string is returned for that node e See note on whitespace in the General Information section e The ASCII character set only is supported Altova MapForce User Manual 2006 Altova GmbH Appendices Engine information 593 normalize unic e Not supported ode e See note on whitespace in the General Information section c ntd Function Name notes resolve Ur1 e lf the second optional argument is omitted the URI to be resolved the first argument is resolved against the base URI from the static context which is the URI of the XSLT stylesheet or the base URI given in the prolog of the XQuery document e The relative URI the first argument i
482. onnecior is created between these items Existing connections 2006 Altova GmbH Altova MapForce User Manual 24 MapForce overview Mapping between components Ignore existing output connections Creates additional connectors to other components even if the currently existing output icons already have connectors Retain Retains existing connectors Overwrite Recreates connectors according to the settings defined Existing connectors are scrapped Delete all existing Deletes all existing connectors before creating new ones Altova MapForce User Manual 2006 Altova GmbH MapForce overview Validating mappings and mapping output 25 2 6 Validating mappings and mapping output Validating a Mapping validates e that all mappings connectors are valid e please note that the current release supports mixed content mapping Connectors and validation lt is not mandatory for functions or components to be mapped The Mapping tab is a work area where you can place any available components XSLT 1 0 XSLT 2 XQuery Java C or C code is only generated for those components for which valid connections exist To validate your mapping e Click the Validate Mapping icon or select the menu item File Validate Mapping e Click one of the preview tabs XSLT XSLT 2 0 or Output or e Select the menu option File Generate XSLT XSLT2 Generate XQuery Java C or C code A validation message appears in the Me
483. onnect child items function as well as the icon in the icon bar Settings for Connect Matching Children Opens the Connect Matching Children dialog box in which you define the connection settings Connect Matching Children This command allows you to create multiple connectors for items of the same name in both the source and target schemas The settings you define in this dialog box are retained and are applied when connecting two items if the Auto connect child items icon in the title bar is active Clicking the icon switches between an active and inactive state Please see the section on Connector properties for further information Target Driven Standard Changes the connector type to Standard mapping please see Source driven mixed content vs standard mapping for more information Copy all Creates connectors for all matching child items where each of the child connectors are displayed as a subtree of the parent connector please see Copy all connections for more information Source Driven mixed content Changes the connector type to source driven mixed content and enables the selection of additional elements to be mapped The additional elements have to be child items of the mapped item in the XML source file to be able to be mapped Please see Default settings mapping mixed content for more information Connection settings Opens the Connection Settings dialog box in which you can define the specific mixed co
484. ons Several functions available in the function libraries are extendable for e g the concat and logical and functions The parameters of these types of function can be inserted appended and deleted at will Clicking the plus icon inserts or appends the same type of parameter while clicking the check mark deletes the parameter Please note dropping a connector on the plus symbol automatically inserts appends the parameter and connects it Insert value on pyalue result pallu E Append value evalue E Append value evalue m Delete value Function context menu Right clicking a function in the Mapping window opens the context window Edit Constant Priority Context _ Show library in Function header Replace component with internal Function structure Chrl s Ctrl c Cr d E x Delete Edit Constant Allows you to change the entry currently defined in the Constant component A Constant is obe added by clicking the Insert Constant icon Priority Context 2006 Altova GmbH Altova MapForce User Manual 18 MapForce overview Functions and libraries When applying a function to different items in a schema or database MapForce needs to know what the context node will be All other items are then processed relative to this one This is achieved by designating the item or node as the priority context A circle appears around the icon so designated Plea
485. onull com Marketing Wis foo Ss eannaenanonull cam Art Please note Hitting the Tab keyboard key allows you to cycle through all the fields header1 field type1 header2 etc 3 Click the OK button when you are satisfied with the settings The CSV component is now visible in the Mapping 4 Select the menu option Insert XML Schema file and select MFCompany xsd 5 Click No when asked if you want to supply a sample XML file and select Company as the root element Altova MapForce User Manual 2006 Altova GmbH MapForce CSV and Text files Mapping CSV files to XML 171 E First name i E Address H Last name gt g 0 Person Tel_ extension P w Manager i Email i Programmer pitin Degree 4 First i Position 4 Title 4 PhoneE xt Email ore 6 Map the corresponding items of both components making sure to map the Rows item to the Person item in the schema target then click the Output tab to see the result lt xml version 1 0 encoding UTF 0 t H lompany mns xsi http ee a orgi 001 SMLSchema instance xsi 5 lt Person Manager true lt First Vernon First sLast Callaby Last gt lt PhoneExt 582 lt PhoneExt lt Email callabyieinanonull cam Email lt Person Person Manager true gt lt First Frank lt First sLast Further Last gt PhoneExt 471 lt PhoneExt lt Email t further ienanonull com Email lt Pers
486. oo Field 4 Switch gt S Field I ow Initialize a Field I i Starting Field l oer Pausing a _ Stopping Please note If a text fragment in the current fragment satisfies a condition then the complete data of that fragment is passed on to the associated container Data is not split up in any way it is just routed to the associated containers or to the default container if it does not satisfy any of the defined conditions The associated containers produced by Switch can be used for further processing You can change such a container to Split once Repeated split or anything else if you wish Content starts with Data is only passed to the associated container if the condition string appears at the start of the text fragment Content contains Data is passed on to the associated container if the condition string appears anywhere in the text fragment For the first triggered condition Data is passed on when one of the conditions in the condition list is true Any other conditions that are true are ignored and no data is passed on to any of the associated containers For all triggered conditions Outputs data for every condition that is true in the condition list This makes it possible to have multiple occurrences of the same data fragment in multiple associated containers simultaneously This might occur if a text fragment contains text that satisfies two conditions simultaneously e g In
487. or ceiling round concat substring contains string length uppercase lowercase find substring empty MS Access specific functions MapForce function round concat substring contains string length uppercase lowercase find substring empty Database function FLOOR CEILING ROUND SUBSTRING CHARINDEX LEN UPPER LOWER CHARINDEX IsEmpty Database function Round Mid InStr 1 Len UCase LCase InStr 1 IsEmpty 2006 Altova GmbH Altova MapForce User Manual 164 MapForce and Databases Database null processing functions 7 9 Database null processing functions New null processing functions have been added to the DB language library is not null result s not null field Is riull result s nulll field set null result set null slUbstitute null result substitute null field replace with is not null Returns false if the field is null otherwise returns true is null Returns true if the field is null otherwise returns false set null Used to set a database column or text field to null This function will also overwrite a default value with null Please note e Connecting this function to another function will generally not lead to a null result The null input will be cast to O or false e Connecting to special functions Filters and IF Else condit
488. orce nature 383 build code automatically 380 build code manually 379 code generation 378 create new mapping project 377 importing examples folder 376 MapForce Editor View 374 MapForce for Eclipse 368 MapForce for VS NET 362 position function in XPath 1 0 582 position function in XPath 2 0 see fn position 590 Preview Mapforce engine 254 Print non printable delimiters 312 Priority and filters 100 function 16 Priority context defining 91 Programming language enumerations for 518 Project 476 499 creating new 475 file name 504 file name and path 502 on opening 473 opening 475 path with filename 505 saving 505 506 Project type enumerations for C 520 for C 496 Q QName serialization when returned by XPath 2 0 functions 591 Query select from where 162 Quit 476 R Reference 388 Relationship create 154 preserve discard 140 Repeated split 274 Reserve method name 429 Right to left writing systems 599 Root element of target 87 Root tables 114 Rows mapping from text files 174 mapping to text files 172 2006 Altova GmbH Index 627 S Save 487 505 Java code 27 XML output 254 XML preview 27 XSLT code 27 SaveAs 487 Saved 487 506 Schema code generator 412 components 12 database as source 61 database component 12 multiple source 397 multiple target 47 viewing multiple targets 50 schema valida
489. orm lt xsl function name MyFunction gt Please see the XSLT 2 0 implementation specific document for more information as well as Aggregate functions for an additional example of using named templates to sum nodes Datatypes in XPath 2 0 If your XML document references an XML Schema and is valid according to it you must explicitly construct or cast datatypes that are not implicitly converted to the required datatype by an operation In the XPath 2 0 Data Model used by the Altova XSLT 2 0 Engine all atomized node values from the XML document are assigned the xdt unt ypedAtomic datatype The xdt untypedAtomic type works well with implicit type conversions For example e the expression xdt untypedAtomic 1 1 results in a value of 2 because the xdt untypedAtomic value is implicitly promoted to xs double by the addition operator e Arithmetic operators implicitly promote operands to xs double e Value comparison operators promote operands to xs string before comparing In some cases however it is necessary to explicitly convert to the required datatype E mf ExpReport H rof ExpReport El lt expense report B Y Person cesses detailed fi we gate Y First oo amp Currency fa subtract gt i i Last HE Person i Title E expense item 3 DAN Phone som type E mail i explo E 4 expense item siii type bal ot LI J W lara bal bal
490. ot supported when using ODBC a MUST when using nested transactions Mixing API transaction handling and SQL transaction commands is not possible via SAVEPOINTS 2006 Altova GmbH Altova MapForce User Manual 146 MapForce and Databases Database feature matrix MF set save point SAVEPOINT MF used init Statements Altova MapForce User Manual 2006 Altova GmbH MapForce and Databases Database feature matrix 147 7 5 3 Database info Oracle supported Notes S DB engine as service own authentication Trusted authentication Connection not supported by MapForce y y y ODBC connection string issues DATABASE must not be applied n n n y MF used init Statements none MF used final Statements DB object name qualification support for DB schemas y identity support E MF read back identity value must use triggers not supported y a y E UPPER sub select support JOIN support OLE DB ODBC MF upper function exec multiple stat in one SQL Execution command separator a special error handling retrieve parameter types special issues when using j Q m ra O O m Flat transactions supported Start flat transaction via execution of SQL command D D S A a y via SAVEPOINTS Nested transactions supported set transaction isolation MF begin transaction y API call API call MF commit transaction MF rollback
491. ou need to select the component in the Toolbox window and drag a rectangle wherever you want to have it in the destination window If you have an application which does not open a window on startup you can use a simple invisible Form with the control on it which is created manually in the code The example project adds this instance to the main MdiContainer MDIMain If you open MDIMain in the Design View from the Solution Explorer you will see a light blue rectangle at the top left side in the client area of the Frame window Selecting this rectangle will show you the properties of the MapForceControl It is important to set the IntegrationLevel property to ICActiveXIntegrationOnDocumentLevel in order to turn on the Document and Placeholder support of the MapForce library Properties of the MapForceControl component placed in the MDIFrame Window of the example application are shown below Altova MapForce User Manual 2006 Altova GmbH MapForceControl Integration at Document Level 535 DataBindings DynamicProperties Marnie 4ccessibleDescription 4AccessibleName 4ccessibleRole AllowOrop Anchor Causes alidation Dock ImeMode IntegrationLewel Location Locked Modifiers ReadOnly Size TabIndex TabStop Taq Visible axMapForceControl Default False Top Left True Mone HoContral ICActi vexIntegrationOnDocumentLevel 60 3 False Private True 2245112 1 False False Set the Visible flag to False to avoid any
492. out oe ie cys ET ae SE External Plug ins and Fragments L File system 4 Click the Browse button next to the Select root directory field and choose the sample project directory e g C Program Files Altova MapForce2006 eclipse workspace MapForceExtension Import Projects Select a directory to search For existing Eclipse projects Select root directory Browse Select archive file Browse 5 Click Finish A new project named MapForceExtension has been created in your workspace Accessing javadoc for the extension point of MapForce plug in 1 Open the index html in the docs folder of the plugin installation e g c Program Files Altova MapForce2006 eclipse plugins com altova mapforceeclipseplugin_1 0 0 docs Running the Sample extension plug in Altova MapForce User Manual 2006 Altova GmbH MapForce plug in for Eclipse Extending MapForce plug in 385 1 Switch to the Java perspective 2 Select the menu option Run Run 3 Select Eclipse Application and click New_configuration Run Create manage and run configurations Create a configuration to launch an Eclipse application Configurations Name New configuration 5i re Eclipse Application New n configuration E Java ipplee a Main Plug ins Configuration Tracing Pg SFI Java Application f Launch with all workspace and enabled external plug ins Ju JUnit Ju JUnit Plug in Test fee SWT Applicat
493. ova GmbH The MapForce API Object Reference 483 1201 Invalid address for the return parameter was specified 1205 Error during code generation See also Code Generation GenerateCppCode Method GenerateCppCode Description Generates C code that will perform the mapping Uses the properties defined in Application Options to configure code generation Errors 1200 The application object is no longer valid 1201 Invalid address for the return parameter was specified 1205 Error during code generation See also Code Generation GenerateCodeEx Method GenerateCodeEx i_nLanguage as ENUMProgrammingLanquage as ErrorMarkers Description Generates C code that will perform the mapping The parameter _ nLanguage specifies the target language The method returns an object that can be used to enumerate all messages created the code generator These are the same messages that get displayed in the Messages window of MapForce Errors 1200 The application object is no longer valid 1201 Invalid address for the return parameter was specified 1205 Error during code generation See also Code Generation GenerateJavaCode Method GenerateJavaCode Description Generates Java code that will perform the mapping Uses the properties defined in Application Options to configure code generation Errors 1200 The application object is no longer valid 1201 Invalid address for the return parameter was specified 1205 Error dur
494. ova GmbH Altova MapForce User Manual 116 MapForce and Databases Mapping XML data to databases 7 3 3 Database action Insert The first example in this section deals with the simple task of adding a new office orgchart to the Altova table The only fields available in the Altova table are PrimaryKey and Name The second example inserts related office tables to the new orgchart record 1 Insert the Altova_Hierarchical xsd schema and assign altova cmpy xml as the input XML instance 2 Insert the MS Access database altova mdb into the mapping 3 Create the following mappings Altova to Altova and Name to Name Please note If all Altova Office etc items are automatically mapped the option Auto connect children is active Select undo and then the menu option Connection Auto connect matching children to disable this option E Altova_Hierarchical k 5 y Altova E a HE Address 5 7 PrimaryKey EIFS Altova L Name 3 fe PrimaryKey i 4 Office PrimarnyKey a ForeignKey 3 i EMail 4 Established r E l T gt 4 Right click the Altova entry and select the menu item Database Table Actions There is currently only one table action column defined in this dialog box Insert All Update if and Delete if table actions are selected by clicking the column header combo box whereas additional table actions can be defined by clicking the Append or Insert Action buttons
495. owse for the folder where you want to save the program files 3 A message appears when the code generation was successful 4 Compile and execute the code using your specific compiler Please note A JBuilder project file and Ant build scripts are generated by MapForce to aid in compiling the Java code see the section on JDBC driver setup as well as the code generator section for more information To search for specific data in the Output tab e Select the menu option Edit Find or hit the CTRL F keyboard keys The Find dialog box allows you to specify the search options in great detail and also supports regular expressions 2006 Altova GmbH Altova MapForce User Manual Chapter 3 MapForce tutorial 30 MapForce tutorial MapForce tutorial Tutorial example In the tutorial a simple employee travel expense report will be mapped to a more complex company report Each employee fills in the fields of the personal report This report is mapped to the company report and routed to the Administration department Extra data now has to be entered in conjunction with the employee the result being a standardized company expense report Further formatting cost summation and conditional viewing options of the expense report are made possible by having the target XML document associated with StyleVision Power Stylesheet designed in StyleVision Aim of the tutorial To transform the personal expense report to a company expense
496. pForce and Databases 7 MapForce and Databases MapForce allows you to not only map database data to XML documents but you can do the reverse as well map XML data to databases and even create mappings between databases MapForce takes primary and foreign key constraints into account and also generates transaction data which ensures data integrity Please note XQuery code can currently only be generated for XML data sources Database access currently requires that you use one of the programming languages Java C or C Currently supported databases and connection types are Microsoft Access ADO versions 2000 and 2003 Microsoft SQL Server ADO Oracle OCI MySQL ODBC Sybase ODBC IBM DB2 ODBC Any ADO compliant database e Any ODBC compliant database Altova MapForce User Manual 2006 Altova GmbH MapForce and Databases JDBC driver setup 107 7 1 JDBC driver setup JDBC drivers have to be installed for you to compile Java code when mapping database data Overview This section describes how to download and install JDBC drivers and how to use them with Ant and JBuilder A JBuilder project file and Ant build scripts are generated by MapForce when generating Java code JDBC drivers are used by MapForce generated Java applications to connect to and exchange data with several different databases These JDBC drivers need to be installed first to successfully run the generated Java application s
497. pRepart ei logical functions egual result egual or greal result egual or less result greater result less result logical and result logical not result logical or result not egual rezult expense report 3 math functions ei string functions 4 Click the expense report entry and hit the key on the numeric keypad to view all the items 5 Click the expand icon at the lower right of the component window and resize the window Libraries HE Core ei logical functions detailed equal i S currency E Person ow First im Last Title a Phone om Email E expense item one type math functions sve expto e3 string functions Add Libraries oT Mapping Project Output Altova MapForce User Manual 2006 Altova GmbH MapForce tutorial Setting up the mapping environment 33 Creating the target schema component 1 Click the Insert XML Schema File icon 2 Select the ExpReport Target xsd file from the Open dialog box You are now prompted for a sample XML file for this schema 3 Click No and select Company as the root element of the target document Select root element a E Namespace URI Cash dwance http my company com http mycompany conn Date http my company com Location http my company com Restaurant http my company corm Cancel The target schema component now appears in the mapping tab 4 Click the Compan
498. pSettings LibraryType CopsSettings UseMFC CopSettings GenerateVC6ProjectFile CopSettings GenerateVSProjectFile CSharpSettings ProjectType Application Property Application as Agplication read only Description Retrieves the application s top level object Errors 1400 The application object is no longer valid 1401 Invalid address for the return parameter was specified CodeDefaultOutputDirectory Property CcodeDefaultOutputDirectory as String Description Specifies the target directory where files generated by Document GenerateCppCode Document GenerateJavaCode and Document GenerateCHashCode are placed Errors 1400 The application object is no longer valid 1401 Invalid address for the return parameter was specified See also Code Generation Altova MapForce User Manual 2006 Altova GmbH The MapForce API Object Reference 495 CompatibilityMode Property compat ibilityMode as Boolean Description Set to true to generate code compatible with Version 2005R3 Set to false to use newly added code generation features in Document GenerateCppCode Document GenerateCHashCode Document GenerateJavaCode and Document GeneratexSLT Errors 1400 The application object is no longer valid 1401 Invalid address for the return parameter was specified See also Code Generation CppSettings DOMType Property CopSettings_DOMType aS ENUMDOMType Description Specifies the DOM type used by Document GenerateCppCod
499. parison operators which are Logical operators Operator Operator in SPL And Jand or or Comparison operators Equal Greater than Greater than or equal gt Less than or equal lt A sample if instruction with a condition looks like this if namespace ContainsPublicClasses and namespace Prefix lt gt whatever you want inserts whatever you want in the resulting file endif Altova MapForce User Manual 2006 Altova GmbH Code Generator The way to SPL Spy Programming Language 449 25 7 7 foreach Vectors and iterators A vector is a collection of objects like a ordinary array Iterators solve the problem of storing and incrementing array indexes when accessing objects foreach example foreach class in classes if not Sclass IsInternal class class Name endif next The first line classes is the global object of all types classes is also a vector a collection of single class objects Foreach steps through all the items in classes and executes the code within the instruction In each iteration class is assigned to the next class object You simply work with the class object instead of using classes i gt class gt Name as you would in C foreach is executed till the next instruction 2006 Altova GmbH Altova MapForce User Manual 450 Code Generator The way to SPL Spy Programming Language 25 7 8 Adding text to files lterating throug
500. pe j Prode resulti aguii ekplo Not exist Returns false if the node exists else returns true substitute missing Used to map the current field content if the node exists in the XML source file otherwise use the item mapped to the replace with parameter Y Person i value i F Person Y First i i h substitute missing is e node m Er dereplace with mai el 4 expense item l gt 5 C 3395113 3141 In the image above the existence of the node Phone is checked in the XML instance file If the node is not present then the value supplied by the constant is mapped Altova MapForce User Manual 2006 Altova GmbH MapForce How To Using DTDs as schema components 103 6 12 Using DTDs as schema components MapForce 2006 SP2 supports namespace aware DTDs for source and target components The namespace URIs are extracted from the DTD xmlns attribute declarations to make mappings possible Adding DTD namespace URIs There are however some DTDs e g DTDs used by StyleVision which contain xmlns attribute declarations without namespace URIs These DTDs have to be extended to make them useable in MapForce e The DTD has to be altered by defining the xmIns attribute with the namespace URI as shown below lt ATTLIST fo root xmIins fo CDATA FIXED http www ws org 1999 XSL Format 2006 Altova GmbH Altova MapForce User Manual Chapter 7 MapForce and Databases 106 Ma
501. pe or a collection complexType derived from a simpleT ype may contain Facets Member Abstraction of a member variable inside a class Name Type Description _ _ NamespaceURI string The namespace URI of this Element Attribute within XML instance documents streams Name string ______ Name in the resulting file SchemaName __ string Name as in the original schema file XmIName string The name as it is expected to appear in XML instance documents streams Type string The name of the class which represents the schema type SchemaType The schema type TypeObject See explanation below HasTypeObject boolean _ true when typeobject has a valid value Description string Description of the Element Attribute Can contain line feeds IsBuiltInT ype boolean true if the type is a built in schema type e g string unsignedint dateTime IsSimpleType boolean true if the type of this member is a simple Type Element or Attribute IsQualified boolean true if the form of the Element Attribute is set to qualified TypeObject The reason this has to be used is the following you might use a complextype and the complextype itself contains a simpletype e Get the class variable and step through its members using foreach at some point you arrive at the simpletype e You now need the simpletype properties type name or whatever e Check the HasTypeObject if its value is true the member has been filled with
502. pective detail records designated with a D with each of the header records Orders E Tut headerDetail me i 7 Fk a Rows fi NET e e CY Order as OrderNo fy equal 7 Pnoderowl ontus Header l fe oo RecordT Field4 E Pb 3 TEA gt Y Total eight ITa Y TotallnitCost Y Currency Y Shipping details El Detail wo Record ype 7 OrderNo SS SS SS is eo ae eo an Lod kas koa kog a y fa filter E Orders l phode row on trueh ProductNo Unit eight 4 UnitNo UnitCost 2 _ Dip i H Ti Unit description ie a HF i F o Fied5 j eyalet me Field l P valez H Freld 7 am Field E l Fieldd result For this to be achieved the header and detail records must have one common field In this case the common field or key is the second field of the CSV file i e OrderNo In the CSV file both the first header record and the following two detail records contain the common value 111 Altova MapForce User Manual 2006 Altova GmbH MapForce CSV and Text files Creating hierarchies from CSV and fixed length text files 175 Notes on the mapping The Orders csv file has been inserted twice to make the mapping more intuitive The Tut headerDetail xsd schema file has a hierarchical structure Order is the root element with Header as its child element and Detail being a child element of Header The first Orders
503. perations Altova MapForce User Manual 2006 Altova GmbH MapForceControl Integration at Document Level 533 27 2 4 Query MapForce Commands When integrating at document level no menu or toolbar from MapForce is available to your application Instead you can query all the commands and the structure of the application menu at runtime Use the property MapForceControl CommandsStructure to access this information Professional applications will need to integrate this menu in a sophisticated manner into their own menu structure Your installation of MapForce even provides you with command label images used within MapForce See the folder MapForceExamples ActiveX Images of your MapForce installation for icons in GIF format The file names correspond to the labels of commands See the C Example for details of how to use the command structure information to create a menu at runtime 2006 Altova GmbH Altova MapForce User Manual 534 MapForceControl Integration at Document Level 27 2 5 Examples This section contains examples of MapForce document level integration using different container environments and programming languages Source code for all examples is available in the folder MapForceExamples Activex of your MapForce installation C The C example shows how to integrate the MapForceControl in a common desktop application created with C using Visual Studio NET 2003 The following topics are covered e Buildi
504. perty Count as Integer read only Description Retrieves number of children of this project item Also see Item Errors 1700 The object is no longer valid Examples See Project Ita or Project NewEnum CreateFolder Method createFolder i_strFolderName as String as ProjectIten Description Creates a new folder as a child of this project item Errors 2006 Altova GmbH Altova MapForce User Manual 510 The MapForce API Object Reference 1700 The object is no longer valid 1701 Invalid folder name or invalid address for the return parameter was specified 1702 The project item does not support children CreateMappingForProject Method createMappingForProject i_strFileName as String as ProjectItem Description Creates an initial mapping document for a Web service operation and saves it to i_strFileName When using Project InsertWebService you can use the i_bGenerateMappings flag to let MapForce automatically generate initial mappings for all ports Errors 1700 The object is no longer valid 1701 Invalid address for the return parameter was specified 1707 Cannot create new mapping The project item does not support auto creation of initial mappings or a mapping already exists 1708 Operation not supported in current edition GenerateCode Method GenerateCode Description Generates code for this project item and its children The code language and output location is determined by CodeGenSettings U
505. plication as Application Dispatch Id 4 Description The Application property gives access to the Application object of the complete MapForce automation server API The property is read only BorderStyle Property BorderStyle as short Dispatch Id 504 Description A value of 1 displays the control with a thin border Default value is 0 CommandsList Property CommandList aS MapForceCommands read only Dispatch Id 1004 Description This property returns a flat list of all commands defined available with MapForceControl For more information see C Sample CommandsStructure deprecated Property commandsStructure aS MapForceCommands deprecated Dispatch Id 3 Remark This property is deprecated Instead use CommandsList MainMenu Toolbars Description The CcommandsStructure collection contains all commands of the MapForceControl as MapForceCommand objects At the first level of the collection two special MapForceCommand objects with the following labels are accessible e IDR _MAPFORCE This object holds all commands as hierarchical menu structure e ALL COMMANDS This object holds all commands in a flat list Sample C code to access the first level of the collection MapForceCommands obyCommands objCommands axMapForceControl CommandsStructure long nCount objCommands Count for long idx O 1idx lt nCount idx Altova MapForce User Manual 2006 Altova GmbH MapForceControl Object Referenc
506. poeta tY Phone on Email eal bs ol bead result Lt Lt Jt Lt Lt J ig m B expense item ae ype pon ekplo bog eno enn Jt Lt LJ Lt L e obec 3 Click the Insert Constant icon in the icon bar to insert a constant component 2006 Altova GmbH Altova MapForce User Manual 38 MapForce tutorial Using functions to map data fe concat value result valez f String C Number All other Cancel 4 Enter a space character in the text box and click OK The constant component is now in the working area Its contents are displayed next to the output icon 5 Create a connection between the constant component and value2 of the concat component rof E xpR eport i 5 expense report e plii f conca amp detailed sale result L currency evalue E Person First bad Last Title i ae Phone om Email o expense item 6 Click the item Last and drop the connector on the icon of the concat function just below value2 The text cursor changes to show when you can drop the connector rof E xpA eport e El expense report exp on amp detailed oo currency F Person on First Ti oo l F lt a _ Tl iT hd Ale i Last Title 7 nea CY Phone i Email E expense item This automatically enlarges the concat function by one more
507. ported Note however that some functions have the same name as schema datatypes e g fn stringand fn boolean Both xs string and xs boolean are defined The namespace prefix determines whether the function or type constructor is used XML source document and validation XML documents used in executing an XQuery document with the Altova XQuery 1 0 Engine must be well formed However they do not need to be valid according to an XML Schema If the file is not valid the invalid file is loaded without schema information If the XML file is associated with an external schema and is valid according to it then post schema validation information is generated for the XML data and will be used for query evaluation Static and dynamic type checking The static analysis phase checks aspects of the query such as syntax whether external references e g for modules exist whether invoked functions and variables are defined and so on No type checking is done in the static analysis phase If an error is detected in the static analysis phase it is reported and the execution is stopped Dynamic type checking is carried out at run time when the query is actually executed If a type is incompatible with the requirement of an operation an error is reported For example the expression xs string 1 1 returns an error because the addition operation cannot be carried out on an operand of type xs string Library Modules Library modules store functions an
508. posted on the Altova Web site from time to time TERM AND TERMINATION This Software License Agreement may be terminated a by your giving Altova written notice of termination or b by Altova at its option giving you written notice of termination if you commit a breach of this Software License Agreement and fail to cure such breach within ten 10 days after notice from Altova In addition the Software License Agreement governing your use 2006 Altova GmbH Altova MapForce User Manual 612 Appendices License Information 10 of a previous version that you have upgraded or updated of the Software is terminated upon your acceptance of the terms and conditions of the Software License Agreement accompanying such upgrade or update Upon any termination of the Software License Agreement you must cease all use of the Software that it governs destroy all copies then in your possession or control and take such other actions as Altova may reasonably request to ensure that no copies of the Software remain in your possession or control The terms and conditions set forth in Sections 1 g h 2 5 b c 9 and 10 survive termination as applicable RESTRICTED RIGHTS NOTICE AND EXPORT RESTRICTIONS The Software was developed entirely at private expense and is commercial computer software provided with RESTRICTED RIGHTS Use duplication or disclosure by the U S Government or a U S Government contractor or subcontractor is subject to the
509. pport Builtin generates code using the built in transformation engine Outputdir directory the log file is to be placed in LOG LogFileName name of the log file to be generated Please Note VC6 workspace files are always generated Examples MapForce exe Filename starts MapForce and opens the file defined by Filename 2006 Altova GmbH Altova MapForce User Manual 94 MapForce How To Command line parameters generate all XSLT files and output a log file MapForce exe Filename XSLT outputdir LOG logFileName Il generate a Java application and output a log file MapForce exe Filename Java outputdir LOG logFileName Ill generate a C application and output a log file MapForce exe Filename CS outputdir LOG logFileName IV generate a C application using the configuration of the mapping settings and output a log file MapForce exe Filename CPP outputdir LOG logFileName V generate a C application using the CPP switch restricting your C compiler options MapForce exe Filename CPP MSXML XERCES LIB DLL MFC NoMFC Builtin outputdir LOG logFileName MapForce exe Filename CPP MSXML LIB MFC Generates the C application using all of the first choices in this example compile for C use MSXML4 0 generate code for static libraries have generated code support MFC MapForce exe Filename CPP XERCES DLL NoMFC outputdir LOG logFileName Generates the C application using all of the second
510. propriate data element If you specify implicitDecimals 2 then a value of 1295 in the source EDI message is treated as 12 95 in MapForce e Old configuration files did not contain an entry for the EDIFACT UNA special segment The XSLT stylesheet therefore inserts the UNA segment entry inside the Interchange if 2006 Altova GmbH Altova MapForce User Manual 324 MapForce and EDI Converting customized EDI configuration files the Interchange originally started with UNB e The XSLT file detects whether an ANSI X12 or UN EDIFACT message is being transformed by checking for the existence of the ISA segment and sets the lt Meta gt tag accordingly Altova MapForce User Manual 2006 Altova GmbH MapForce and EDI Customizing an EDIFACT message 325 20 5 Customizing an EDIFACT message MapForce allows you to customize EDIFACT messages to take different nonstandard or changed EDIFACT formats into account This example uses the Orders Custom EDI mfd file available in the MapForceExamples Tutorial folder Please note that a ZIP file EDIFACT Nanonull zip is also included in the Tutorial folder The ZIP file contains the files final result of the customization procedure The EDIFACT file available in the Tutorial folder Orders Custom EDI has been changed to include a new component element in the CTA segment e Line 9 contains a Mr entry and e Line 11 contains a Mrs entry UNB OHOBR 1 0038S7733 01
511. r SinglePrice 4 Amount Price Please note Using filters in user defined functions only make sense if the source component is also in the same user defined function Filters can only be used to supply data into a user defined function using input components if you have defined it as an inline function Altova MapForce User Manual 2006 Altova GmbH User defined functions Complex user defined function XML node as input 205 10 3 Complex user defined function XML node as input This example is provided as the lookup udf in mfd file available in the MapForceExamples folder What this section will show is how to define an inline user defined function that contains a complex input components Note that the user defined function FindArticle consists of two halves A left half which contains the input parameters e asimple input parameter POArtNr e acomplex input component Articles with mappings directly to its XML child nodes A right half which contains e asimple output parameter called Name E ShortPO BO shoaPo p i Y Customer gt E Lineltems EIS O CompleteP0 E Lineltem gt HAK Customer i lt f H Number rope jE ing gt e FirstName mee b POArtN 3 LastName 7 PA Articles Artic E Address E E Article E Lineltems T O Number BOLto A Articles gt a a E Article gt a Number The screenshot below shows the
512. r 71 last function in XPath 1 0 582 last function in XPath 2 0 see fn lastQ 590 Legal information 601 Legal values ANSI X12 321 Lib compiler settings 440 Library add custom 222 adding XQuery functions 242 adding XSLT 2 0 functions 240 adding XSLT functions 234 C 229 custom 16 defining component UI 226 function 16 generator function 139 import user def functions 196 XPath2 16 library modules in XQuery document 587 Library type enumerations for C 517 for C 495 496 License 605 information about 601 License metering in Altova products 603 Load DB loading errors 99 Local customization EDIFACT 330 X12 341 Logo display on startup 497 option for printing 497 Makefile 424 Map large database 158 large database complete 159 large database partial 160 MapForce API 460 engine 254 integration 524 introduction 3 Overview 8 parent 480 plug in for Eclipse 368 plug in for VS NET 362 terminology 10 MapForce API 460 accessing 561 overview 461 MapForce API Type Library 471 MapForce integration example of 526 527 528 MapForce plug in applying MapForce nature 383 building code automatically 380 building code manually 379 code generation 378 create new mapping project 377 Editor View perspective 374 importing examples folder 376 MapForce view enumerations for 521 MapForceCommand in MapForceControl 563 MapForceCommands in MapForc
513. r The schema structure is practically identical to the Access database hierarchy The same method can also be used to map flat format XML SQL databases The MS Access database Altova mdb is supplied in the MapForceExamples Tutorial folder Schema prerequisites e All tables related to Altova appear as child items of the target root element e To preserve the table relationships all mappings have been created under the Altova table in the database component The diagram below shows the mapping of the hierarchical Access database to Altova_Hierarchical xsd altova ii fy Altova Hierarchical i PAE OAltova p J 4 Primarykey p a n p 1 ow iw i Lh a a i Y Office Y PrimarypKey ForeignKey ba od i seul Fra HEI gt F ischemal ocatial gt bo ad noi Laer bool LEF L i F Phone E Address Y PrimaryKey Mapping multiple flat file tables to one XML output file The following diagram shows the same type of mapping to a flat file SQL XML database schema Schema prerequisites e The schema structure has to follow the SQL XML specifications e XMLSpy has the ability to create such an SQL XML conformant file from an SQL database by using the menu option Convert Create Database Schema You can then use the schema as the target in MapForce e In this case each table name is mapped to the row child element of the same element 2006 Altova GmbH Altova MapFor
514. r Manual 2006 Altova GmbH MapForce and Databases Mapping XML data to databases 119 Ce a kog ko ka E Office Y PrimarpKey 4 ForeignKey jeie ka kop koa fso r kaa aa kaa koni kog ho jeie i Phone E 4 Address E Department kaa Lt LEP wt wt LER kry LER Lt Lt wt Lt iL r ho i ka a SELECT IIFIMA Atova PrimaryKey E MULL 0 MAS Altova PrimaryKey 1 AS Primary ke INSERT INTO Stova Name PrimaryKey VALUES Microtech OrgChart Primary Key SELECT llFIMA Ottice Primary Ke IS NULL OMA Ottice Primarykey o 1 45 Primary ke INSERT NTO Office Foreignkey Desc EMail Established Mame Primary KET L VALUES PrimaryKeys Microtechnology products are currently the bleeding edge of com SELECT IIFIMAS Ottice Primary Ke IS MULL OMA Ottice Primarykey i 1 45 PrimaryKey INSERT INTO Office Foreignkey Desc EMail Established Mame PrimaryKey VALUES CPrimaryKey Microtech established ts new office on Feb 30 nextotticecimicr 6 Click the Run SQL script icon to run the script and insert the new tables 7 Double click the Altova table to see the effect in MS Access 2006 Altova GmbH Altova MapForce User Manual 120 MapForce and Databases Mapping XML data to databases EB Altova Table eA aS 1 Organization Chart PrimaryKey Desc EMail Est
515. r Manual 2006 Altova GmbH MapForceControl Command Table 559 27 3 12 Help Menu Commands from the Help menu Menu Text Table of Contents ndex 2323 Registration DC_REGISTRATION DC_OPEN_ORDER_PAGE Support Center DC_OPEN_ SUPPORT PAGE FAQ on the Web IDC_SHOW_FAQ Components Download DC_OPEN_ COMPONENTS_PAGE MapForce on the Internet DC OPEN XML_SPY_ HOME MapForce Training IDC_OPEN MAPFORCE_TRAINING_ PAGE About MapForce ID APP ABOUT 2006 Altova GmbH Altova MapForce User Manual 560 MapForceControl Command Table 27 3 13 Commands not in Main Menu Commands not in the main menu Menu Text Edit FlexText Configuration Priority Context nsert Input Replace component with internal function structure Add Active File to Project C Sharp ava XQuery XSLT 1 0 XSLT 2 0 enerate All Open Properties Po CommandName ID D_FUNCTION_REMOVE 32385 ID_ FUNCTION_REPLACE_WITH_COMPONENTS 32386 ID_FUNCTION_INSERT_INPUT_AT_POINT 32384 3 ID_ POPUP_PROJECT_GENERATEXQUERY ID_POPUP_PROJECT_GENERATEXSLT ID_POPUP_PROJECT_GENERATEXSLT2 ID_ POPUP_PROJECT_GENERATE_ALL ID_POPUP_PROJECT_GENERATE_CODE ID_ POPUP_PROJECT_OPEN_MAPPING D_POPUP_PROJECT_PROJECTPROPERTIES ID_POPUP_PROJECT_REMOVE D_PREV_PANE Altova MapForce User Manual 2006 Altova GmbH MapForceControl Accessing MapForce API 561 27 4 Accessing MapForce AP
516. r in the database CustomerNr has been designated as the priority context and is placed in the a parameter of the equal function The CustomersAndaArticles database is then searched once for the same number The b parameter contains the Number item from the database If the number is found then the result is passed to the bool parameter of the filter function The node row parameter passes on the Customer data to on true when the bool parameter is true i e when the same number has been found The rest of the customer data is then passed on as Number FirstName LastName items are all connected to the corresponding items in the target schema Designating the b parameter of the equal function i e item Number as the priority context would cause MapForce to load the first Number into the b parameter Check against the CustomerNr in a if not equal Load the next Number into b check against a and lterate through every Number in the database while trying to find that number in ShortPO 2006 Altova GmbH Altova MapForce User Manual 92 MapForce How To Priority Context ShortPO E CompletePO gt a E ShortPO gt E CompletePO CustomerNr i ls a Customer E Lineltems p o ow Number E Y Lineltem H ioe FirstName ArticleNr P i LastName Amount e 2 Address 5 ow Street a Lt Lt Lt 4 State E 4 Lineltems E 4 Lineltem if HEBAnticles rE E
517. r target files e Directly edit the parameters passed to the run method of MappingMain1 Object To use an XML input stream as the XML data source e Navigate to the run method declaration in the code and configure the specific parameters there To add extra error handling code Edit the code below the catch Exception e code Mono makefile If you generated C code and specified a mono makefile in the Generation tab of the Tools Options dialog box e The makefile is placed in the output folder e Edit the MappingConsole cs file in the outoput Mapping folder as mentioned above 2006 Altova GmbH Altova MapForce User Manual 438 Code Generator Integrating MapForce code in your application 25 5 3 MapForce code in C applications Having generated the C code in MapForce and defined a folder named output as the output folder 1 Navigate to the output Mapping folder and open the workspace file mapping dsw in MS Visual Studio 6 0 E output Altova E AltovaDB E AltovaFunctions E AlkovaxXML 2 Double click the Mapping cpp file to open the mapping project file fl Workspace Mapping 8 project s ze Altova files H E AltovaDe files ze AltovaFunctions files HEE Atova ML tiles 24 CompletePo tiles eel CustomersAndArticles tiles At 24 Mapping files Et a Source Files ker TERETE re on Mappinghaint cap ue E StdAtx chp Header Files Resource Files fey AtovaFunctions a Complete
518. rce and target components 1 Connect two parent items that share identically named child items in both components 2 Right click the connector and select the Connect matching child elements option MW Ignore Namespaces W Recursive M Mis Attributes and Elements Existing Connections V Ignore existing output connections f Retain C Overwrite Delete all existing OUR Cancel 3 Select the required options discussed in the text below and click OK to create the Mappings Mappings are created for all the child items that have identical names and adhere to the settings defined in the dialog box Please note The settings you define here are retained and are applied when connecting two items if the Auto connect child items icon in the title bar is active Clicking the icon switches between an active and deactive state Ignore Case Ignores the case of the child item names Ignore Namespaces Ignores the namespaces of the child items Recursive Having created the first set of connectors the grandchild items are then checked for identical names If some exist then connectors are also created for them The child elements of these items are now checked and so on Mix Attributes and Elements Allows the creation of connectors between items of the same name even if they are of different types e g two Name items exist but one is an element the other an attribute If set active a c
519. rce driven mixed content vs standard mapping 77 4 3 Source driven mixed content vs standard mapping This section describes the results when defining standard mappings or using standard connectors on mixed content items The files used in the following example Tut Orgchart mfd are available in the MapForceExamples Tutorial folder Creating standard connections between mixed content items 1 Right click the para connector and select Target Driven Standard from the popup window The connector now appears as a solid line E Y Office ie gt Office ow Name a gt gt Name E Desc I p Desec a Opara p BO para ow bold ip gt H bold i Y italic i be J italic 2 Click the Output tab to see the result of the mapping lt OTTICE lt Name Nanonull Inc stame Desc fof sparas foi od lt bold gt Yereno bold PPG ebold NMano grid lt bold gt gt i i sitalic multi core processors lt Jitalic gt i i sitaliceoffshore vitalic gt i i lt jpara io parai s Descs slOTfice lt OTTice lt Name Manonull Europe 4ts lt Mame gt Desc gt i spara gt ii i ebold gt five research scientists lt bold i i etalic Europesttalic Result e all text nodes of the para element have been removed e mapped bold and italic text content remain e However bold and italic item sequence follow that of the target XML schema file Target Driven Standard p
520. rdT ype gt lt QrderNord 11 lt Orderho lt Productho 4 1579 227 Productho gt o lt UnitvVeight 10 Unityveight o lt Unitho gt 3 lt Unitho sUnitCost 400 lt UnitCost lt Unit descristion Microtome Unit descriptian gt Detail i lt Detail gt f sRecordType Ds Recordtype OrderNo d 11 lt 0rderho gt lt ProductNo B 152 427 Productho i lt Unitvveight Unityveight i lt Unitho 6 Unitho i eUnitCost 1 200 lt UnitCost lt Unit descristion Miscellaneous Unit description eiDetail gt Header 2006 Altova GmbH Altova MapForce User Manual 176 MapForce CSV and Text files Creating hierarchies from CSV and fixed length text files The second example uses a slightly different CSV file and is available in the MapForceExamples Tutorial folder as Head detail inline mfd however No record designator H or D is available A common skey field the first field of the CSV file still exists for both header and detail records Head key Detail key The field is mapped to OrderNo in the schema target Header and all respective Detail fields are all on the same line Please note The key fields are mapped to the respective OrderNo items in the schema target The Detail item in the schema target file has been duplicated and is displayed as Detail 2 This allows you to map the second set of detail records to the correct item The result of this mapping is exa
521. re lt Back ext gt Enh Cancel An Eclipse project folder and optionally some more folders and files inside this folder have been created Java Eclipse SDK File Edit Navigate Search Project Run Window Help C4 OB O Q H ee ss classpath project You can now create MapForce mappings and MapForce project files inside this Eclipse project or copy existing ones into it Whenever a mapping or MapForce project file changes the corresponding mapping code will be generated automatically Code generation errors and warnings will be shown in the MapForce view called Messages and added to the Problems view of Eclipse A MapForce Eclipse project is an Eclipse project with the MapForce nature assigned to it and therefore uses the MapForce builder If one or more MapForce project files are present in the Eclipse project the code generation language and output target folders are determined by the settings in these files lf a MapForce project file is not present in the Eclipse project 2006 Altova GmbH Altova MapForce User Manual 382 MapForce plug in for Eclipse MapForce code generation But the Eclipse project has been assigned the JDT nature e Then the mapping code generation defaults to Java language and the project s Java source code directory is used as the mapping code output directory Saving a mapping automatically generates the mapping code in Java and compilation of the Java code Use
522. re application or runtime environment such as a business to business application or Web service Program coding is most commonly done through the use of high level XML processing Application Program Interfaces API such as Microsoft MSXML and Apache Xerces Version 2 2 0 and higher which are freely available for various programming languages Altova MapForce User Manual 2006 Altova GmbH Code Generator Introduction to code generator 413 25 1 Introduction to code generator In the case of XML Schemas the MapForce code generator s default templates automatically generate class definitions corresponding to all declared elements or complex types which redefine any complex type in your XML Schema preserving the class derivation as defined by extensions of complex types in your XML Schema as well as all necessary classes which perform the mapping In the case of complex schemas which import schema components from multiple namespaces MapForce preserves this information by generating the appropriate C or C namespaces or Java packages Additional code is implemented such as functions which read XML files into a Document Object Model DOM in memory representation write XML files from a DOM representation back to a system file as well as XML validation and transformation The output program code is expressed in C Java or C programming languages C The C generated output uses either MSXML 4 0 or Apache Xerces 2 2 or l
523. rea it Altova MapForce User Manual 2006 Altova GmbH MapForce and EDI UN EDIFACT to XML Schema mapping 303 WH New Design Altova MAPFORCE File Edit Insert Component Connection Output View Tools Help Deh Blom k BBX eH ee or wee e Libraries Core ei logical functions equal result a equal or qreater result a equal or less result a greater result a less result a logical and result Ic logic al rat result Ic logical or result Ic Hot equal result Ic w ORDERS E Envelope La math functions add result w ceiling result c 5 Click the Envelope entry and hit the key on the numeric keypad to view all the items 6 Click the expand icon at the lower right of the component window and resize the window WH New Design Altova MAPFORCE File Edit Insert Component Connection Output View Tools Help O S W EI Cw iREX j f SLT JAWA Ce lee g Bh ah Libraries E H core m ORDERS ei logical functions equal result a A Envelope equal or qreater result a Interchange equal or less result a H UHB greater result a A s001 less result 4 ee FON logical and result Ic i FOO logical not result Ic o s002 logical or result Ic e OOO not egual result lc FOO07 l how FOOOB L5 math functions o Oso add result v FOOIO ceiling result c divide result floor result fl 7 ies FOoOo0 7 ce FO
524. ready has a license to the Restricted Source Code through their separate license agreement with Altova or other agreement with 2006 Altova GmbH Altova MapForce User Manual 606 Appendices License Information Altova Altova reserves all other rights in and to the Software With respect to the feature s of UModel that permit reverse engineering of your own source code or other source code that you have lawfully obtained such use by you does not constitute a violation of this Agreement Except as otherwise permitted in Section 1 h reverse engineering of the Software is strictly prohibited as further detailed therein b Server Use You may install one copy of the Software on your computer file server for the purpose of downloading and installing the Software onto other computers within your internal network up to the Permitted Number of computers If you have licensed SchemaA gent then you may install SchemaAgent Server on any server computer or workstation and use it in connection with your Software No other network use is permitted including without limitation using the Software either directly or through commands data or instructions from or to a computer not part of your internal network for Internet or Web hosting services or by any user not licensed to use this copy of the Software through a valid license from Altova c Concurrent Use If you have licensed a Concurrent User version of the Software you may install the Softwar
525. recognizes the prefixes listed above as being bound to the corresponding namespaces e Since the built in functions namespace listed above is the default functions namespace in XQuery the fn prefix does not need to be used when built in functions are invoked for example string Hello will call the fn string function However the prefix fn Can be used to call a built in function without having to declare the namespace in the query prolog for example fn string Hello e You can change the default functions namespace by declaring the default function namespace expression in the query prolog e When using types from the XML Schema namespace the prefix xs may be used without having to explicitly declare the namespaces and bind these prefixes to them in the query prolog Example xs date and xs yearMonthDuration If you wish to use some other prefix for the XML Schema namespace this must be explicitly declared in the query prolog Example declare namespace alt http www w3 org 2001 XMLSchema alt date 2004 10 04 e Note that the untypedAtomic dayTimeDuration and yearMonthDuration datatypes have been moved with the CRs of 8 June 2006 from the XPath Datatypes namespace to the XML Schema namespace so xs yearMonthDuration lf namespaces for functions type constructors node tests etc are wrongly assigned an error is 2006 Altova GmbH Altova MapForce User Manual 588 Appendices Engine information re
526. report in Authentic View of XMLSpy or Authentic Desktop Altova MapForce User Manual 2006 Altova GmbH MapForce tutorial 31 Personal Expense Re port M Detailed report Employee Information Fred Landis Project Manager First Hame Last Hame Title E landsidnanonull com 125 456 s E Mail Phone Expense List Date ipppy mintid oi i 1 Lods Travel Development Si L di ee Biz jet 3 66 add Lodging oe Wil 1 Lod Lodging Sales ote L Motel maria add Travel 121 2 Type Expense To Expenses Description it TE 1 Lods Travel Accounting ae n Ambassador class Jla add Lodging a Wl 1 Loda Travel Marketing ee ME x as Hone Fong OOO add Lod Meal Sales oe Wael Late For Free add Travel add Lodging 2006 Altova GmbH Altova MapForce User Manual 32 MapForce tutorial Setting up the mapping environment 3 1 Setting up the mapping environment This section deals with defining the source and target schemas we want to use for the mapping e Start MapForce Creating the source schema component 1 Click the Insert XML Schema File icon 2 Select the mf ExpReport xsd file from the Open dialog box You are now prompted for a sample XML file to provide the data for the preview tab 3 Click Yes and select the mf ExpReport xml file The source schema component now appears in the Mapping tab Libraries Eo Eure E omf Ex
527. ric function to check if the source value may be converted into a number and then an if else component to pass a different value in case it fails e g a constant containing 1 on the value false parameter Altova MapForce User Manual 2006 Altova GmbH Chapter 17 MapForce Exceptions 250 MapForce Exceptions 17 MapForce Exceptions MapForce provides support for the definition of exceptions You can define the condition that will throw an error When the condition is satisfied a user defined message appears and the mapping process is stopped The ExpenseLimit mfd file in the MapForceExamples folder is a sample mapping that contains an exception function To insert an exception component e Select the menu option Insert Exception or click the Exception icon Ol in the icon bar a Tame gt E Y Company Root ele gt Street gt 7 El Address i l i City l svn Name i gt G4 Person i i Street i S Manager gt n City i l sven Programmer E Person I ee Degree sean Manager gt 7 i sven First i aa Programmer i ei Last oo Degree i i ice Y Title i First 1 PhoneExt ol 0 UR RO e Last l oOo Email m Fite ees a Title i PhoneF xt 5 J edero one Ay O Email Taj result Please delete Mr Wa The example above shows how exceptions are defined in mappings The exception should be t
528. riggered when the Last name of a person equals Matise e The equal component checks to see if Last equals Matise and the bool result is passed on to the filter component e When the condition is satisfied i e Matise is True the on true parameter of the filter component activates the exception and the mapping process is stopped Note that you can also connect the exception to the on false parameter if that is what you need e The error text supplied by the constant component is output e The error text appears in the Output tab and also when running the compiled code Please note It is very important to note the filter placement in the example e Both parameters of the filter component on true and on false must be mapped One of them needs to be mapped to the fault component and the other to the target component that receives the filtered source data If this is not the case the exception component will never be triggered e The exception and target components must be directly connected to the filter component Functions or other components may not be placed between the filter and Altova MapForce User Manual 2006 Altova GmbH MapForce Exceptions 251 either the exception or target components e When generating XSLT 2 0 and XQuery code the exception appears in the Messages window and a Preview failed message box appears Clicking the OK button in the message box switches to the respective XSLT2 or XQuery tab
529. rmation Function settings Opens the settings dialog box of the currently active user defined function allowing you to change the current settings Use this method to change the user defined function type i e double click the title bar of a user defined function to see its contents then select this menu option to change its type Implementation f Inline recommended Allows comples parameters filters and multiple outputs C Standard function Allows recursive calls Insert Input Inserts an input component into the mapping or into a user defined function If you are working in the main Mapping tab the dialog box shown below is displayed This type of input component allows you to e define an override value for the data that is being input by the current mapping input and e use this input component as a parameter in the command line execution of the compiled mapping Please see Input values overrides and command line parameters for more information 2006 Altova GmbH Altova MapForce User Manual 404 MapForce Reference Function Create Input a x Mame Trueval Datatype nteger M Connection required Preview Code generation I Use alternative value Value 2 If you are working in a user defined function tab the dialog box shown below is displayed This type of input component allows you to define simple inputs if this is a Standard user defined function complex inputs e g sch
530. rom component 2 e ifthe IDs are equal use the filter component to pass on the associated customer data from component 2 to the Customers XML file Altova MapForce User Manual 2006 Altova GmbH MapForce and Databases Mapping large databases with MapForce 161 H Production HIS Componentiype ac he enode row onrtrue E Protatype Ebo Tondalsel kani kon kani koa fa equal Ael esa bvauez E r kasi Unit C t p nt Lomponents ual ie koni fa equal resulti kani hp kosi kasi Ea eaii m FroducedAt L FAT estedAt l m Delivered t E Customers gt E Customers prode ow ortuelh ub TE C Customer booo lonfalset Number 4 FirstName Beas LastName E Address Street EE Nonae i Unit Unit Components k Do Sn F I E su m SernalNr m Produced t mTestedAt m DelveredAt Please note Try to restrict the number of tables used in a single database component to about 10 related tables This will ensure speedy loading and processing as well as make the mapping process more intuitive 2006 Altova GmbH Altova MapForce User Manual 162 MapForce and Databases Database filters and queries 7 8 Database filters and queries When generating program code MapForce optimizes database access by generating direct database queries where po
531. roperties Standard mapping means the normal method of mapping used in MapForce i e e Mixed content text node content is not supported mapped The sequence of child nodes is dependent on the target XML schema file In this example For each para element first map all bold items then map all italic items This results in the child ttem sequence shown above bold bold italic italic The content of each item is mapped if a connector exists Please note If one of the child nodes items use the anyType datatype then the node content is not mapped only the empty item node name is transferred to the target component 2006 Altova GmbH Altova MapForce User Manual 78 Source driven mixed content mapping source driven mixed content vs standard mapping The anyType datatype allows unconstrained content including mixed content and MapForce cannot automatically ascertain the varied structure of such types of nodes Change the datatype to anySimple type or a more specific type e g xs string if empty nodes appear in the output window or define a complexType in the schema and map the respective items Copy all mapping 1 Right click the para connector and select Copy all from the popup window The connector now appears as a solid line with the child items branching out of and below it Please see Copy all connections for more information a Desc i Desc El para para Altova MapForce User
532. rs in Altova products 597 XSLT2 0 date constructor 240 Z Zoom factor in Output window 254 2006 Altova GmbH
533. rs 0 info New Element gt The definition appears as shown below Seqment name W2 info Additional Name Information gt Date ref FSS mergedEntries 4 gt Data name HLOOO type string maxLength 35 mindeccurs 0 info New Element Seqment gt Please note The new X1000 field is defined using the name attribute as opposed to other fields of the segment which use the ref attribute The F93 field is defined at the beginning of the X12 Segment file using the Data name element and is only referenced here The new field can now be referenced from different Segments or Composites Previewing the new field in MapForce l Dg 1 Select the menu option Insert EDI or click the Insert EDI icon 2 Click the X12 Nanonull tab and select the 850 Purchase Order transaction 3 Click the Cancel button to skip the selection of the source EDI file for the moment The 850 component is now visible in the mapping window 4 Navigate to Envelope Interchange Group Message LoopN1 N2 to see the new X1000 element ac gt TXI Tax Information HE LoopLDT 0 LoopAMT 0 LoopN9 gi LoopN1 LES ee E QNI Party Identification PE 42 N2 Additional Name Information F93 Name how ka Pio be m A1000 New Element AA IN2 Individual Mame Structure Compete E N3 Party Location Altova MapForce User Manual 2006 Altova GmbH MapForce and EDI
534. rs present C csv f Fired Tel Ext Email Title string string string 25 25 Y calabyi nanonull comt Office Ml f furthercnanonull comeet Account 8 Click into the Custom text box of the Fixed Length Field Settings group and enter the hash character This has the effect of removing the identical fill character from the text file being input 2006 Altova GmbH Altova MapForce User Manual 182 MapForce CSV and Text files Mapping Fixed Length Text files to a database Fited Length Field Settings Fill Character Space Period f Custom Assume record delimiters present Tel Ext Email string string 3 25 Calaby 502 uCallabydenanonull com Further 471 ffurtherenanonull com 9 Click OK to complete the definition Ps El Rows gt gt er First if i see Last Th The Text file component appears in the Mapping window Data can now be mapped to and from this component Altova MapForce User Manual 2006 Altova GmbH MapForce CSV and Text files Mapping Fixed Length Text files to a database 183 Mapping text files to a database This section uses the fixed length text file to update the Telephone extension entries in the altova mdb database E Person Table Sees tat Phone gt ae Callaby Office Mane Frank Further 477 Accounts R 1 Select the menu option Insert Database click the Microsoft Access radio button then
535. rson xmins xsi http Nne sw orgl2001 CAML Schema instance si nolames Name Organization Chart Mame lt Office gt Mame Manonull Inc lt hMame gt sfOttice gt lt OTfice gt lt Name NManonull Europe Ats Mame gt sfOTtice gt lt flompany Person Altova MapForce User Manual 2006 Altova GmbH Source driven mixed content mapping Default settings mapping mixed content 771 4 1 Default settings mapping mixed content Creating mixed content connections between items 1 Select the menu option Connection Auto Connect matching children to activate this option if it is not currently activated 2 Connect the Desc item in the source schema with the Desc item in the target schema A message appears asking if you would like to create a mixed content connection You are also notified that the text and child items will be transferred in the same order they appear in the XML source file 3 Click Yes to create a mixed content connector Please note Although the Desc is not of mixed content a message appears because the auto connect option has been activated and para exists in both source and target components Para is of content and makes the message appear at this point The mixed content message also appears if you only map the para items directly without having the autoconnect option activated 4 Office il p Name 2 Opara P A para E Y italic Location All chi
536. rve section e g reserve myReservedWora 3 Regenerate the program code XML Schema support Please note that the attribute nillable true is not supported during the code generation process 2006 Altova GmbH Altova MapForce User Manual 430 Code Generator Code generation mapping example 25 4 Code generation mapping example The mapping example shown below uses the Marketing Expenses mapping project MarketingExpenses mfd available in the MapforceExamples folder Please also see Integrating code in your application for more information E ExpReport MarketingE xpenses concal i B expense reportl gt gt El marketing expel gt i detailed gt i i j5 i Person resulti i E CuMTency i l FullName sees total sum gt i oe 3 Title i l E Person foots Pei f OTie Ji pre i om Email i i i LER LER LER LSR ho ho kon koa kog kon r UE s E a E kon C Marketing Ii l Mapping Project Output e The code below shows the source file path as well as the target XML file produced by the mapping Multiple source files can appear however only one target file may be associated C Projects Files XMLSpyExeFolder MapForceExamples ExpReport xml MarketingExpenses xml e f multiple targets exist then the MappingMain section shown below is repeated for each target MappingMainl MappingMainlObject New MappingMainl
537. ryKey i e update the Department name if it has changed Database Table Actions All input data are compared to the OB table data using the operators LF all comparisons are true then the specie action is executed Acton on input data Update if m PrimaryKey fia Foreignkey mi Name Delete data in child tables Ignore input child data Person Table action Person table e Table action Update if equal defined for PrimaryKey Database Table Actions All input data are compared to the DB table data using the operators defined IF all compartons are true then the specitic action ie executed 4 chon on input data Update if nsert Rest Y m PrimaryKey fia Foreignkep HEM ail m First m Last m PhoneE xt litle e Table action Insert Rest defined as the second table action should the first comparison Update if fail Click the Append Action button to append a new Table action column Altova MapForce User Manual 2006 Altova GmbH MapForce and Databases Mapping XML data to databases 125 UPDATE Department SET Foreignkey 1 MName Admin WHERE Primarykey 1 SELECT Foreignk ey Frimaryk ey FROM Department WHERE Frimary k e 1 UPDATE Ferson SET EMailj 4 Aldrichiemicrotech com First Slbert Last Aldrich PhoneEst 582 UPDATE Ferson SET EMail h bandereeimicrotech corm First Bert Last Bander PhoneExt 4 1 Tit UPOATE Ferson SET EM
538. s 0 maxOceurs 5 info CTA Contact information gt SSeqment name CTA info CONTACT INFORMATION gt Data ref F3139 mindccurs 0 r gt Composite name COS6 minOdecurs 0 info DEPARTMENT OR EMPLOYEE DETAILS gt Data ref s F3413 mindeccurs 0 r gt Data reft F3412 mindteccurs 0 gt Data name LOOO type string waxLength 35 minOeccurs 0 info WNew Ele Composite gt Segment gt 2Seqment ref COM mindecurs 0 mwaxOccurs gt Group gt Previewing the new field in MapForce 1 Select the menu option Insert EDI or click the Insert EDI ae Icon 2 Click the EDIFACT Nanonull tab and select the ORDERS message 3 Click the Cancel button to skip the selection of the source EDI file for the moment The ORDERS component is now visible in the mapping window 4 Navigate to Envelope Interchange Group Message SG2 SG5 CTA C056 to see the new X1000 element Altova MapForce User Manual 2006 Altova GmbH MapForce and EDI Customizing an EDIFACT message 333 w ORDERS ee MAD Name and address 4214 NAD NAME AND ADDRESS l OLOC PLACE LOCATION IDENTIFICATION l i ESC FID FINANCIAL INSTITUTION INFORMATION 44 5G3 RFF Reference 2 Ha SGA DOC Document message details 2 4 5G5 CTA Contact information 2 HA OQCTA CONTACT INFORMATION oe F 3139 CONTACT FUNCTION CODE a C056 DEPARTMENT OR EMPLOYEE DETAILS on F313 Department or employee name code oo
539. s XSLTDefaultOutputDirectory objOptions XSLTDefaultOutputDirectory XSLTGen objDocument GenerateXSLT else if languageID 1 objOptions CodeDefaultOutputDirectory objOptions CodeDefaultOutputDirectory JavaCode objDocument GenerateJavaCode i else if languageID 2 objOptions CodeDefaultOutputDirectory objOptions CodeDefaultOutputDirectory CPPCode objDocument GenerateCppCode else if languageID 3 objOptions CodeDefaultOutputDirectory objOptions CodeDefaultOutputDirectory CSharpCode objDocument GenerateCHashCode lt SCRIPT gt 2006 Altova GmbH Altova MapForce User Manual 528 MapForceControl Integration at the Application Level Connect to Custom Events The example implements two event callbacks for MapForceControl custom events to show the principle lt custom event OnDocumentOpened of MapForceControl object gt lt SCRIPT FOR ob jMapForceControl event OnDocumentOpened obyDocument LANGUAGE Jjavascript gt alert Document objDocument Name opened lt SCRIPT gt a AE N E Ee 2 lt custom event OnDocumentClosed of MapForceControl object gt lt SCRIPT FOR ob jMapForceControl event OnDocumentClosed obyjDocument LANGUAGE Javascript gt alert Document ob jDocument Name closed lt SCRIPT gt Altova MapForce User Manual 2006 Altova GmbH MapForceControl Integr
540. s appended after the last in the path notation of the base URI notation e If the value of the first argument is the zero length string the base URI from the static context is returned and this URI includes the file name of the document from which the base URI of the static context is derived e g the XSLT or XML file static base ur e The base URI from the static context is the base URI of the 1 XSLT stylesheet or the base URI specified in the prolog of the XQuery document e When using XPath Evaluator in the XMLSpy IDE the base URI from the static context is the URI of the active XML document e The ASCII character set only is supported 2006 Altova GmbH Altova MapForce User Manual 594 Appendices Technical Data 28 2 Technical Data This section contains useful background information on the technical aspects of your software It is organized into the following sections OS and Memory Requirements Altova XML Parser Altova XSLT and XQuery Engines Unicode Support Internet Usage Altova MapForce User Manual 2006 Altova GmbH Appendices Technical Data 595 28 2 1 OS and Memory Requirements Operating System This software application is a 32 bit Windows application that runs on Windows NT 4 0 Windows 2000 and Windows XP Memory Since the software is written in C it does not require the overhead of a Java Runtime Environment and typically requires less memory than comparable Java based applicatio
541. s in the Annotation Settings group 2 Use the remaining groups to define the position and alignment of the label Altova MapForce User Manual 2006 Altova GmbH Source driven mixed content mapping Mixed content example 75 4 2 Mixed content example The following example is available as ShortApplicationinfo mfd in the MapForceExamples folder A snippet of the XML source file for this example is shown below lt Page xmlns xusi http s w ws org Z00L AMLSchema instance HElinoWamespaceiSchemaLocation SecticonedPage xid gt lt Item lt Title gt xMLSpy lt Title gt MainSection author altovwa gt Altova Trademark gt sMLopy Trademark SubsSection Altova Trademark gt s HMLipyt Trademark gt 005 Enter is ene industry standard HKeyord gt ANL lt KRewword gt development environment editing debugging and transforming all tHeyword gt sML Reyuord gt technolo automatically generating runtime code in multiple programming languages Hainsection Item gt The mapping is shown below Please note that e The Subsection item connector is of mixed content and is mapped to the Description item in the target XML schema Trademark text is mapped to the Bold item in the target e Keyword text is mapped to the Italic item in the target a SectionedPage E Page All the applications El Item One specific application I kani ii l i Title The application s
542. s must be variables Variables must be prefixed by the character Local variables are defined in a subroutine Global variables are declared explicitly outside of subroutines Multiple parameters are separated by the comma character within round parentheses e Parameters can pass values Parameters passing values Parameters can be passed in two ways by value and by reference using the keywords ByVal and ByRef respectively syntax define sub CompleteSub Sub CompleteSub Sparam ByVal SparamByValue ByRef SparamByRef ll aes e ByVal specifies that the parameter is passed by value e ByRef specifies that the parameter by reference 2006 Altova GmbH Altova MapForce User Manual 452 Code Generator The way to SPL Spy Programming Language Function return values To return a value from a subroutine use the return statement Such a function can be called from within an expression Example define a function Sub MakeQualifiedName ByVal SnamespacePrefix ByVal SlocalName if SnamespacePrefix return SlocalName else return SnamespacePrefix amp amp SlocalName endif EndSub Subroutine invocation Use call to invoke a subroutine followed by the procedure name and parameters if any Call SimpleSub or Call CompleteSub FirstParameter SParamByValue ParamByRef Legal parameter types Variables strings numbers true and false are the only data types that may currently be u
543. s target components 312 component settings 312 converting old config files 322 EDIFACT auto completion rules 315 EDIFACT validation rules 315 validating 25 X12 auto completion rules 318 X12 legal values 321 X12 validation rules 318 EDIFACT 300 as target 312 auto completion rules 315 code generation C class 334 custom eg 334 customizing 325 customizing configuration 334 customizing set up 326 global customization 328 inline customization 332 local customization 330 mapping to XML 302 merged entries 337 target validation rules 315 terminology 301 Edit 392 Empty text file create new 186 encoding default for output files 496 file 177 186 in XQuery document 587 End User License Agreement 601 605 Engine AltovaX Query command line 192 Mapforce 254 Enumerations 514 516 517 518 520 for MapForce View 521 in MapForceControl 578 Environment code generation 109 Erase delete user defined func 196 Error defining exceptions 250 validation 25 Error handling general description 469 ErrorMarkers 490 492 Evaluation period of Altova s software products 601 602 604 Events of Document 481 Events for Project 500 Exception out of memory 429 throw 250 webservice fault 360 Exists node test 102 Explicit datatype 240 Export user defined function 196 2006 Altova GmbH 620 Index Extend function parameters 16 external functions in X
544. s to be split by lines records or columns Horizontal Splits the fragment into two horizontal sections Enter a value into the Split line field or drag the tab on the vertical ruler Vertical Splits the fragment into two vertical columns Enter a value into the Split line field or drag the tab on the horizontal ruler 2006 Altova GmbH Altova MapForce User Manual 280 FlexText FlexText Reference C DB a Zs _ PW ltova 2ce s In WOALF tet Mode fied length Westem Splitline 7 Splt base head 4 ES MapForceFlexText ERS MapForceFlexText3 Sample Text g M 1 22a F o Container ship Mega 111 41579227 10 3 400 Microtome BE 111 5152427 7 6 1200 Miscellaneous F Split Line The number of lines after which the fragment should be divided into two Split base Head splits by the number of split lines from the top Tail splits by the number of split lines from the bottom use when no of lines records unknown MODE Delimited floating Default settings are Separator none Split base head Altova Secawan w CALF tet Mode delimited floating 1 Mw estem Separator 400 Split base head Fy MapForceFlexText Fy MapForceFlexText3 Sample Text 1J111 332 1 22537 7 5 Container ship Mega 2 111 41579227 10 3 400 Microtome b 111 B152427 7 6 1200 Miscellaneous p 4 222 978 4 7563 1 69 ir freight Mini 45 5222 Z2Z40561 1
545. s tyle cainconinencsotagsavencqtaneamnisagnesa eea sansa caneatiosanni ney ShosienaeacaeaReacahsnanacasinns 571 TV tea na sats ao aces E tig ance EEA EE A E AT AN 572 Tc WM oC e E T E NT 572 P E AEE E AE E E A 572 Reid Oil vase ccatntey snonnsosaetaeaucatateaumnsaenosecnetyentuna sansa camonnsosanameyenthaimeamedansoiidaoianitaaiorennes 572 Poom WS oeasecsis see seers teas TAEAO A A A 572 IVECO sistas sees ce see ee seo sc soe sean eee ose anaes Ses ees Seat asses 573 EGC vndanatinnn E E E E E O E 573 NeW enera a ae a a a E a a a a 573 NewDocument deprecated PA E T A A E E A E 573 Open E E E E E E E E E E aR 573 OpenDocument deprecated EE E E E EEN E E E E T 574 QueryStatus E E E E E E E 574 Reload eee e E E E E E E E E E E E E E E T 574 SAVO E E EE EEE E E E E E T T E e 574 SIVEC Huish a E T E EE E E E E E E E E E E 574 SaveDocument deprecated EE E E E E E a 575 e o cuee shee tee aebaceneaan sien aes aacnszentoeae ones sees sel noeuaeenawsesa teeta eee 575 OnDocumentClogedeecrsisiiecesesieis siais ene in E EEE EEEE EETAS 575 OnDocumentOpened EE E E EE E EE E E E E E E 575 OnModifiedFlagChanged EAA wade E E A a ne peace euat aie E EE e 575 27 5 5 MapForceControlPlaceHolder ccccccccccccccececeeeeeseeeeseseseeeeceeeeeeeeeeeeaaas 576 POPETI OS EEE E T N E O A E A 576 Placeholder Window ccsssssccceecceccsseccccccesccsecccseuscseeececseeecsseucscseueeccseuuessseueecens 576 PHO OCU ec autcisoncacprienRnvur arcs Sauie a oa
546. sages v 4 Bi BiG 4 5 5 xX oo CompletePO mfd Mapping validation successful 0 errorfs 0 warning s Altova MapForce User Manual 2006 Altova GmbH MapForce plug in for MS Visual Studio NET Differences between NET and standalone versions 365 22 2 Differences between NET and standalone versions The Enterprise and Professional MapForce plug ins are integrated into all versions of MS Visual Studio NET in the same way Please note there is no support for MapForce projects in the Visual Studio NET version Changed functionality in the Visual Studio NET editions Menu Edit Undo and Redo The Undo and Redo commands affect all actions copy paste etc made in the development environment including all actions in MapForce Menu Tools Customize Toolbar Commands Customize Toolbars Commands Toolbars _ Image Editor F Layout MapForce Code Generation and Validation F MapForce Create Elements MapForce Main Toolbar MapForce Output Bar F MapForce Select Language F MapForce Text Bar Menu Bar F Query Designer Recorder Report Borders F Report Formatting Source Control Standard Use large icons Show ScreenTips on toolbars Show shortcut keys in Screenvips These tabs contain both Visual Studio NET and MapForce commands Menu View The View menu contains the submenu MapForce which allows you to enable or disable the MapForce tool panes It also gives access to
547. san E putPersor mfd Libraries Project The Project tab shows the project and WSDL name as well as each of the operations defined in the WSDL file The two operations are getPerson and putPerson Creating webservice mappings 1 Double click the getPerson operation in the Project tab A new mapping getPerson mfd containing two WSDL components is created The getPersonSoapIn component contains the query item which will be used to query the database through the webservice The getPersonSoapOut component contains the Person items defined in the WSDL file Person database bservice Folder getPersonS caplnput getPersonS cap0 utput query Wed a EE Input getPersonSoapin z A Output getPersonSoapUut http AAW altova com s 2DB t onfdjpart Query ElGJpatt Result B Ba WS 2DBScapPort H n1 Person ae http Aawwy altova coms oom First A PhoneEXT Y Email Defining the database query mapping 1 Select Insert Database using the wizard to insert the person mdb database available in the Tutorial folder The items in the database match those in the getPersonSoapOut component Map the Person items to same items in the getPersonSoapOut component Use the concat function to concatenate the persons First and Last names Insert a contains function and connect the result item of the concat function with the value parameter 5 Click the part Query item in the getPersonSoapln component
548. screen help system The latest version of the user manual is available at www altova com i in HTML format for online browsing and ii in PDF format for download and to print if you prefer to have the documentation on paper 30 day evaluation period After downloading this product you can evaluate it for a period of up to 30 days free of charge About 20 days into this evaluation period the software will start to remind you that it has not yet been licensed The reminder message will be displayed once each time you start the application If you would like to continue using the program after the 30 day evaluation period you have to purchase an End User License Agreement which is delivered in the form of a key code that you enter into the Registration dialog to unlock the product You can purchase your license at the online shop at the Altova website Distributing the product If you wish to share the product with others please make sure that you distribute only the installation program which is a convenient package that will install the application together with all sample files and the onscreen help Any person that receives the product from you is also automatically entitled to a 30 day evaluation period After the expiration of this period any other user must also purchase a license in order to be able to continue using the product For further details please refer to the End User License Agreement at the end of this section Altov
549. se lines if present in a message Default true e Data element separator see EDIFACT X12 specification Default e Composite Separator see EDIFACT X12 specification Default e Segment Terminator see EDIFACT X12 specification Default e Decimal Notation see EDIFACT X12 specification Default e Release Character see EDIFACT X12 specification Default Right click an EDI component and select Component Settings to open the EDI component settings dialog box The UN EDIFACT settings are used as defaults for both EDI components 2006 Altova GmbH Altova MapForce User Manual 314 MapForce and EDI UN EDIFACT and ANSI X12 as target components Component Settings i x Input EDI Instance Browse Output EDI Instance for Code Generation Browse Input file encoding Uricoae ure Little endian byte order Unicode UTF 8 Big endian byte order ED Settings Data Element Separator m Auto complete missing elds Composite Separator B W Begin new line Repetition Separator after each segment Segment Terminator Decimal Notation l Extended Release Character EO Configuration Hles Valtova maptorce2 006M apForceE D1 2M anonullse50 Contig Cancel Clicking the Extended button opens the respective extended EDI settings dialog box Defining your own separators can be non printable You can use any characters in the first three combo boxes of this
550. se printed materials are owned by Altova GmbH or the respective supplier This software product is protected by copyright laws and international treaty provisions This software product 1998 2006 Altova GmbH All rights reserved The Sentry Spelling Checker Engine 2000 Wintertree Software Inc STLport 1999 2000 Boris Fomitchev 1994 Hewlett Packard Company 1996 1997 Silicon Graphics Computer Systems Inc 1997 Moscow Center for SPARC Technology Scintilla 1998 2002 Neil Hodgson lt neilh scintilla org gt ANTLR Copyright 1989 2005 by Terence Parr www antlr org All other names or trademarks are the property of their respective owners Altova MapForce User Manual 2006 Altova GmbH Appendices License Information 605 28 3 4 Altova End User License Agreement THIS IS A LEGAL DOCUMENT RETAIN FOR YOUR RECORDS ALTOVA END USER LICENSE AGREEMENT Licensor Altova GmbH Rudolfsplatz 13a 9 A 1010 Wien Austria Important Read Carefully Notice to User This End User License Agreement Software License Agreement is a legal document between you and Altova GmbH Altova It is important that you read this document before using the Altova provided software Software and any accompanying documentation including without limitation printed materials online files or electronic documentation Documentation By clicking the I accept and Next buttons below or by installing or otherwi
551. se report item in the source schema and drag A connector line is automatically created from the output icon and is linked to the mouse pointer which has now changed shape 2 Move the mouse pointer near to the Company item in the target schema and drop the connector the moment the mouse pointer changes back to the arrow shape A small link icon appears below the mouse pointer and the input icon is highlighted when the drop action will be successful A connector has now been placed between the source and target schemas A mapping has now been created from the schema source to the target document E ExpReport T arge G expense report p a ow 5 detailed a currency i Person LC First E expense report JZ detailed i E Employee i Title Auto mapping MapForce allows you to automatically connect child elements of the same name in both schemas For more information please see the section on Connector properties 1 Right click the Person connector and select Connect matching children from the pop up menu If the child items are automatically connected auto connect child items is active Altova MapForce User Manual 2006 Altova GmbH MapForce tutorial Mapping schema items 35 ExpReport T arget expense report El Y Company detailed i H 417 Employee CUTency Connect Matching Children 7 Person Delete MW Ignore Namespaces M Recursive a Mis Attributes and Eleme
552. se see Priority Context in the Reference section for an example fh equal E T resulti rjg Show library in function header Displays the library name in the function component Replace component with internal function structure Replaces the user defined component function with its constituent parts Cut Copy Paste Delete The standard MS Windows Edit commands allow you to cut copy etc any components or functions visible in the mapping window All connectors will be retained except for those which would have to be replaced Altova MapForce User Manual 2006 Altova GmbH MapForce overview Projects 19 2 4 Projects MapForce supports the Multiple Document Interface and allows you to group your mappings into mapping projects Project files have a mfp extension Two types of projects can be defined e Acollection of individual mappings i e a standard project e A related set of mappings which make up a WSDL mapping project Both project types support code generation for the entire project To create a project 1 Select File New and double click the Project File icon x Cancel Webservice Project tro 2 Enter the project name in the Save Project As dialog box and click Save to continue A project folder is added to the Project tab Tutonal project Happing Output By New Design 3 Select File New and double click the Mapping icon This opens a new mapping file
553. se using the Software you agree to be bound by the terms of this Software License Agreement as well as the Altova Privacy Policy Privacy Policy including without limitation the warranty disclaimers limitation of liability data use and termination provisions below whether or not you decide to purchase the Software You agree that this agreement is enforceable like any written agreement negotiated and signed by you If you do not agree you are not licensed to use the Software and you must destroy any downloaded copies of the Software in your possession or control Please go to our Web site at http www altova com eula to download and print a copy of this Software License Agreement for your files and http www altova com privacy to review the privacy policy L SOFTWARE LICENSE a License Grant Upon your acceptance of this Software License Agreement Altova grants you a non exclusive non transferable except as provided below limited license to install and use a copy of the Software on your compatible computer up to the Permitted Number of computers The Permitted Number of computers shall be delineated at such time as you elect to purchase the Software During the evaluation period hereinafter defined only a single user may install and use the software on one computer If you have licensed the Software as part of a suite of Altova software products collectively the Suite and have not installed each product individually then the Soft
554. seDefault CodeGenSettings Language and CodeGenSettings OutputFolder Children of this project item can have their own property settings related to code generation Errors 1700 The object is no longer valid 1706 Error during code generation GenerateCodeEx Method GenerateCode as ErrorMarkers Description Generates code for this project item and its children The code language and output location are determined by CodeGenSettings UseDefault CodeGenSettings Language and CodeGenSettings OutputFolder Children of this project item can have their own property settings related to code generation An object that can be used to iterate through all messages issued by the code generation process is returned These messages are the same as those shown in the Messages window of MapForce Errors 1700 The object is no longer valid 1701 Invalid address for the return parameter was specified 1706 Error during code generation Altova MapForce User Manual 2006 Altova GmbH The MapForce API Object Reference 511 GenerateCodeln Method GenerateCodeIn i_nLanguage as ENUMProgrammingLanquage Description Generates code for the project item and its children in the specified language The output location is determined by CodeGenSettings UseDefault and CodeGenSettings OutputFolder Children of this project item can have their own property settings related to code generation Errors 1700 The object is no longer valid 1701 Invalid
555. seconds 2 TempMarket ingExpenses gt For further information please see Generating Java code using JBuilder 2006 Altova GmbH Altova MapForce User Manual 418 Code Generator Generating program code Generating Java code using JBuilder If you are using Borland JBuilder e Navigate to the Java subdirectory and open the Mapping jpx file to compile the Java code Cy JBuilder 9 C Temp MarketingExpenses com mapforce MappingApplication jayra File Edit Search View Project Run Team Wizards Tools Window Help o gt mE g afussn Jaha E E Mappingjpx 7 xes MappingApplication Mapping jpx GD Project Sources a Mappingd pplication java ii com altova Q com atova functions al This file was generated by MAPFORCE 2004 0 corm altova types ip corm aktora xml 6 YOU SHOULD NOT MODIFY THIS FILE BECAUSE IT WIL 3 i com mapforce T OVERWRITTEN WHEN YOU RE RUN CODE GENERATION Agn ExpReport MarketingExpenses mapforce png ry Mapping Application java K EA Mappinglonsole java di ry Mapping rane java l EA Mappinghlaint java m a corm maptorce ExpReport Fi com mapforce MarketingExpenses Refer to the MAPFORCE Documentation for further http rwn altowa com mapforce package com mapforce a e i i min ff ti TF H DO lo O I import javax swing UIManager import java awt I E i 20 public class Mapping4 pplication boolean packFrame false public Mapp
556. sed within parameters Do not use expressions To invoke a function any subroutine that contains a return statement simply use its name inside an expression Do not use the call statement to call functions Example SQName MakeQualifiedName namespace entry Altova MapForce User Manual 2006 Altova GmbH Code Generator The way to SPL Spy Programming Language 453 Subroutine example Highlighted example showing subroutine declaration and invocation A sample SPL fife create Soutputpath amp S module amp output tet define sub SinpleSubf sub 4 S5impleSub called endsub execute sub SimpleSubt call SParanby Value ParamBy alue ParanbyRet ParanbyRet Original Value SParamByV alue Original Value SParamBbyFRet define sub Completesubl sub SS param byval paramByValue byref paramByRef JCompleteSub called param Sparam paramBbyValue SparamBbyValue paramnbyret SparamnbyFRet SParamByReft Local Variable SparanbyValue new value SparamBbyReft new value Set values inside sub SParamByReft Local Variable SparanbyValue new value SparamBbyReft new value JGompleteSub finished endsub run sub ConpleteSubl 3 call t FirstParameter ParamnBbyValue ParanbyValue SParanByValue ParamBbyRet ParanByRet cloze The same sample code create Soutputpath amp Smodule amp outpu
557. seeeseeeeeeseeseesseeseesseesereseessrereeeseesseeseesseeseeesee 528 27 2 Antesration at Document Level oi cescisscsarsvasescudsaesagncessadondteccaonavecansudsteaaanceszatendtbsasovusseas 529 ZIDZA Use Map orceControl scsics acnastexacetusnecionstnvesetiastcindataraiebusbieseteinncsolasdadedatens 530 27 2 2 Use MapForceControIDocument cccccccccccecceeeeeeeeeeeessesseeeceeeeeeeeeeeaaaas 531 27 2 3 Use MapForceControlPlaceHolder ssssasessdsiesvassanctwncnamerdusntaieessdianvadcanaieeenenes 532 27 2 4 Query MapForce Commands ccccccccccccccecceececcaeeesssseeeeeeeeecececeeeeeeeaaas 533 Dee Ea e N E E E 534 O E E ET ENE E E E AATE A 534 Lait a Te oiacirene r E e EE AONE AE 534 Placing the MapForceControlrs iesssarcsasveensarenninenctesnreneansyantsecancetensnnenndiseenennsssenes 534 Adding the Placeholder Control sisis nereascacanereansnerusnesssnennsneaeanencarevearestanpecgnsnnnnvenee 535 Retrieving Command Information aseessa 537 Handling Event seisasscnnencensnecorveicsne cornntetaaciasnvicnasesnsneduaprauenneatainaneoauanessnaetayennieats 539 Testing the Extn leicsccsstensteseenensanvereasvesnsatennnncantieniiantannisniawsanadtansntennsntectetnnaveats 540 TT IVT a E E NE ease 542 Instantiate the MapForce Contro lecssoersismeneiireiiiosia i 542 Create Editor WindoWeecirciertitirriceiei iieis iEn Eine ETCEN N ENE ei iaae eiia 542 Create Project Window ermosopiriibensrimennre hennon nianna ninine Eana 542 Create Pl
558. ser Manual 2006 Altova GmbH The MapForce API Overview 465 26 1 3 Example Project Support See also Code Generation The following JScript example shows how you can use the MapForce project and project item objects of the MapForce API to automated complex tasks Depending on your installation you might need to change the value of the variable st rSamplePath to the example folder of your MapForce installation To successfully run all operations in this example below you will need the Enterprise version of MapForce If you have the Professional version running you should comment out the lines that insert the WebService project Users of the Standard edition will not have access to project related functions at all Oi DIP AP oF FPP 7 global variables ff 7777 FF tAd var objMapForce null var objWshShell null var objFSO null adapt the following path to your needs var strSamplePath C Program Files Altova MapForce2006 MapForceExamples EMER ELE LOOSE OGL Oleg me clcths la Mee Pe Ler el eel Le eee Lee sere eke function Exit strErrorText WScript Echo strErrorText Woecript 0Ou1t 1 function ERROR strText objErr if objErr null Exit ERROR Ob Err number UxErir F 4 opjerr description a a 4 Setar Text else Exit VERROR strText function CreateGlobalObjects the Shell and FileSystemObject of the windows scripting host of
559. ser or System DSN Not available Creating the database component in MapForce 1 Select File New in MapForce to create a new mapping 2006 Altova GmbH Altova MapForce User Manual 62 MapForce tutorial Database to schema mapping 2 Click one of the programming language icons in the title bar Java C or C 3 Click the Insert Database icon in the icon bar Select a Source Database Please select a source database or a shored connection and click on nest Microsoft SOL Server ADO Oracle OCI MySOL ODBC Sybase ODBC C IBM DBE2 0DEC C Arn ADO C Any ODBC Next Cancel Click the Microsoft Access radio button Click the Next button to continue Click the Browse button to select the database you want as the data source altova mdb in the MapForceExamples Tutorial folder in this case The connection string appears in the text box ool Select a MS Access Database f Click browse and select an Existing Microsoft Access Database JFiles ltova MAPFORCE 2004 MapForceE wamples Tutorial altova mdb Browse mea 7 Click the Next button This opens the Create Schema dialog box Altova MapForce User Manual 2006 Altova GmbH MapForce tutorial Database to schema mapping 63 Create Schema Microsoft Jet Connection Access altova Database Tables T able C Views System Ba Address Ba Altova Ba Department Be Office Ba Person Dat
560. sert Project Build Tools Window Help wing Unicode Debug r ER ERE 1B SH ilk KindDefaut i H Ie amp Go 2 E I 5 H E Altova classes Ee AltovaFunctions classes Eel AltovasML classes MappingMsinl cpp eel ExpReport classes This file was generated by MAPFORCE 2004 Happing classes E MappingM aint YOU SHOULD HOT MODIFY THIS FILE BECAUSE IT WILL BE Globals OVERWRITTEN WHEH YOU RE RUN CODE GENERATION eel MarketingExpenses classes Refer to the MAPFORCE Documentation for further details http www altova com maptorce POPPER LL ALE OE EOE PE OL OL OE OPP ODE OPEL A EOL OPP PPE FAP LAE OEE ELE OE PE EOE SE include StdaAfz h finclude Resource h using namespace std finclude ExpReport EzprReport h include Market ingExpenses Market ingExpenses h include MappingMsainl h ifdet _DEBUG fdefine new DEBUG NEW undef THIS FILE static char THIS FILE _ FILE endif koid MappingMainl Run tstring ExpReportSourceFilename tstring Mar AA Qpen the source s WriteTrace Loading ExpReportSourceFilename n CEzepReportDoc ExpReportDocSourcetbject ExpFkFeport Cespense reportType ExpReportSource0bject w_ExpReportDocSourceObject Load ExpReportSourceFilenamne m_ExpFeport Instance ExpReportSourceObject 4 Select the menu option Build Build Mapping exe Altova MapForce User Manual 2006 Altova GmbH Code Generator Generating program code
561. sert a filter component by clicking the Insert Filter icon z in the toolbar Altova MapForce User Manual 2006 Altova GmbH User defined functions Standard user defined function 203 mE Articlehr default Articlenr E H output E Articles A Articles E 7 Article Y Humber Use the diagram below as an aid to creating the mappings in the user defined function please take note of the following 8 Right click the a parameter and select Priority context from the pop up menu 9 Double click the output function and enter the name of the output parameter in this case Name defaut Article W output 1 E Articles gt JA t Articles 4 Article ih filter Number iprode row oriu x boo orrfalsel This ends the definition of the user defined function Please note Double clicking the input and output functions opens a dialog box in which you can change the datatype of the input parameter as well as define if the function is to have an input icon Connection required in this dialog The user defined function e has one input function ArticleNr which receives data from the ShortPO XML file e compares the ShortPO ArticleNr with the Article Number from the Articles input XML instance file inserted into the user defined function for this purpose e uses a filter component to forward the Article Name records to the output component if the comparison returns true e has one output function Name which
562. speed of the mapping generation This section will deal with methods enabling you to optimize data access and generally speed up the mapping process In general use as few filter components as possible and 1 Avoid concatenating filter components 2 Connect the on true on false parameters to parent items if possible instead of child items directly 3 Connect the on false parameter to map the complement node set delivered by the on true parameter 4 Don t use filters to map to child data if the parent item is mapped 5 Use the Priority context to prioritize execution of unrelated items Avoid concatenating filter components Every filter component leads to a loop through the source data thus accessing the source n times When you concatenate two filters it loops n n times solution Use logical and components to combine the boolean expressions of two filter components The result is a single filter component looping only n times Connect the on true on false parameter of the filter component to target parent items Filter components work best when they are connected to parent items containing child items instead of individual items directly The filter boolean expression is therefore evaluated against the parent before looping through the child elements Using filters mapped from a database table will generate e SELECT FROM table WHERE lt expression gt if the parent item is mapped or SELECT FROM table a
563. ss as the parties may designate by notice given in the manner set forth above This Software License Agreement will bind and inure to the benefit of the parties and our respective heirs personal and legal representatives affiliates successors and permitted assigns The failure of either of us at any time to require performance of any provision hereof shall in no manner affect such party s right at a later time to enforce the same or any other term of this Software License Agreement This Software License Agreement may be amended only by a document in writing signed by both of us In the event of a breach or threatened breach of this Software License Agreement by either party the other shall have all applicable equitable as well as legal remedies Each party is duly authorized and empowered to enter into and perform this Software License Agreement If for any reason any provision of this Software License Agreement is held invalid or otherwise unenforceable such invalidity or unenforceability shall not affect the remainder of this Software License Agreement and this Software License Agreement shall continue in full force and effect to the fullest extent allowed by law The parties knowingly and expressly consent to the foregoing terms and conditions Last updated 2005 05 05 2006 Altova GmbH Altova MapForce User Manual Index 615 Index Config transforming to new format 322 NET differences to MapForce standalone 365 NET
564. ssage type ORDERS and the second the message description text Browse EDI collections i x EDIFACT EDIFACT Nanonull x12 ORDERS Cancel Fou didn t find EDI collection you were looking for click this button to view what other collections are currently available from Altova Download additional EDI collections Altova MapForce User Manual 2006 Altova GmbH MapForce and EDI Customizing an EDIFACT message 327 Please note MapForce searches through all sibling subfolders under the MapforceEDI directory and scans for a file called EDI Collection The folder name containing an EDI Collection appears as a tab in the dialog box The listbox shows the current content of the collection file which in our example only contains an ORDERS message entry The goal of this section is to redefine the CTA Contact Information segment by adding the X1000 field to make it available to individual messages CTA consists of one field F3139 and one composite C056 There are several ways the customization can be achieved e Globally by customizing the EDSD segment file All segments in all messages that use composite C056 will contain reference the new element e Locally by customizing the ORDERS config file All segments in the current message that use composite C056 will contain the new element e Inline by customizing the ORDERS config file Only the customized segment CTA in the current message will co
565. ssages window Messages Y va mam A S 8 x Note that you can use multiple message tabs if you project contains many separate mapping files Click one of the numbered tabs in the Messages window and click the preview tab for a different mapping in your project The validation message now appears in the tab that you selected The original message in tab 1 is retained however Use the different icons of the Messages tab to e Filter the message types errors or warnings scroll through the entries Copy message text to the clipboard Find a specific string in a message Clear the message window Validation messages e Validation successful X Error s Y Warning s Warnings alert you to something while still enabling the mapping process and preview of the transformation result to continue It is therefore possible for a mapping to have 0 errors and Y warnings Errors halt the transformation process and deliver an error message An XSLT XQuery or Output preview is not possible when an error of this type exists Clicking a validation message in the Messages window highlights the offending component icon in the Mapping window Component connections and validation results Free standing components e Do not generate any type of error or warning message 2006 Altova GmbH Altova MapForce User Manual 26 MapForce overview Validating mappings and mapping output Partially connected components can generate two types of
566. ssible The MAPFORCE filter component in conjunction with specific functions is what makes this possible The filter component generally retrieves every record of a specific table and checks each to see if the filter condition is satisfied If it is the record is forwarded to the on true on false parameters This generates a select statement something like select type from expense item This method is time consuming when using large databases and an alternative method is used which transfers the workload to the database MapForce analyzes the mapping and checks for specific functions that support direct queries Select statements are then generated for these functions e g select from expense item where type Travel Most of the work is now done by the database and the resulting dataset is then passed on for further processing The MapForce functions that support direct queries are show below Operators available for all database types MapForce function Database function equal not equal lt gt equal or greater gt equal or less an less Ea greater gt logical or or logical and and add subtract vos multiply nan divide ri modulus o Functions for all database types logical not not Altova MapForce User Manual 2006 Altova GmbH MapForce and Databases Database filters and queries 163 MS SQLServer specific functions MapForce function flo
567. ssociated container Note that the Repeated Split container is currently active and the preview displays all current records lines in the Sample Text pane Container default settings are Mode fixed length Orientation horizontal Offset 1 ees Mode fed length Orientation Horizontal Offset Fe MapForceFlexText1 Sample Text 1 111 332 1 22537 7 5 Container ship Mega p 2 111 41579227 10 3 400 Microtome amp amp 3 111 5152427 7 6 1200 Miscellaneous BE 4 222 976 4 7563 1 69 a4ir freight Mini BF S222 Z2Z4W0561 10 5 10000 Gas Chromatograph gt Default result Each line of text appears as a line record in the new container as the Offset is 1 Click the new container to preview its contents The Sample Text scroll arrows let you scroll through each of the 11 blocks fragments produced by these settings Repeated split Fel Mode fised length Onentatian horizontal Offset Fe MapForceFlexText 1 Y Sample Text IAB SO O O 1J111 332 1 22537 7 5 Container ship Mega MODE Fixed length This is the default value Altova MapForce User Manual 2006 Altova GmbH FlexText FlexText Reference 275 Orientation Allows you to define how the text fragment is to be split by lines records or columns Horizontal Splits the fragment into multiple horizontal sections see above Enter a value into the Offset field or drag the tab on the vertical ruler Vertical
568. sy i 5 a Field J e Field 1 gt I Field 2 _ Field 5 i n Field 3 TEN Field soe Field 4 eee Freld3 Field5 3 Map the various items to specific target components and click the Output tab to preview the results Mapping preview of the top text component 2006 Altova GmbH Altova MapForce User Manual 272 FlexText Using FlexText templates in MapForce lili 332 1 225357 7 5 Centeiner ship Megs 111 A1579227 10 2 400 Microtome 111 B152427 7 6 1200 Miscellaneous i r 222 970 4 7863 1 69 Air freight Mini 222 20hN561 10 5 10000 Cas Chromatograph 1 3 4 5 6 7 3 9 a a ro Mapping preview of the lower text component 1100 897 227_1 7162735 LOx 1110 9832 22991_30 002 No0x 1120 1212 37_01 008 s0x Altova MapForce User Manual 2006 Altova GmbH FlexText FlexText Reference 273 19 6 FlexText Reference The reference section describes the various features of FlexText and shows how best to use them to achieve specific results 2006 Altova GmbH Altova MapForce User Manual 274 FlexText FlexText Reference 19 6 1 Repeated split Using this option initially creates a single container The container contains the text defined by the condition set in Repeated Split When you first select this option default parameters are automatically set and the resultant fragments appear in the a
569. t Config inside a subfolder of the MapForceEDI folder Altova MapForce User Manual 2006 Altova GmbH MapForce and EDI Converting customized EDI configuration files 323 8 Add the new file name to the EDI Collection file of the folder by adding the line lt Message Type lt YourType gt File lt YourConfig gt Conftig Description lt YourDescription gt gt inside the lt Messages gt tag 9 Start MapForce You can now use your customized message Please see Customizing an EDIFACT message or Customizing an ANSI X12 transaction for more information on customization specifics Converting the configuration files using a Command Line XSLT Processor You can also convert the configuration file using a command line XSLT Processor such as the AltovaXML Processor which is available from the Components and Free Tools Download Center of the Altova com website To convert a configuration file using the Altova XSLT Processor Command line syntax for AltovaXML AltovaXML xslt1 xsltfile in xmlfile out outputfile options To convert EDI configuration files this actually means AltovaXML xslt1 xsltfile in Old_Config_file out New_Config_file 1 Open a command prompt and enter e g AltovaXML xslt1 Convert EDI config xslt in old850 Config out new850 Config Please enclose the path parameters in double quotes if they contain any space characters Checking transformed configuration files The convers
570. t putPersonSoap0ut Jpart Confirmation 4c strin AGInput putPersonSoapin lG patt Put ni Person oom First nl string Y Last ni string Title nl sting Tr val Y PhoneEXT nl string 4 Email nl string rezult ae E a T Fete Te Tege wlojololo jo lo lo Cpoye pve je pe ye ye Mm am T T TT T Coy J Say in Oo hij we EL el el e ee nvarchar S0 3 alast m nvarchar S0 Le into our spam datab l 1 Using a WSDL client e g XMLSpy create and send a SOAP request 2 Select SOAP Create a new SOAP request 3 Enter the WSDL file location on the server e g http 127 0 0 1 axis services WS2DB wsdl and hit OK Please enter the WSDL file location local path or url oS x Choose a file http 1 27 0 0 1 axis services wS2DB wedl Browse window Cancel Please choose a file from your hard disk or select one of the other windows curently open in skiLS py 4 Select the SOAP operation name that you want to use putPerson Person Put in this case and hit OK to create the SOAP Request document The SOAP Request document supplies Person placeholder elements for the user to fill In Altova MapForce User Manual 2006 Altova GmbH MapForce and Webservices Generating Java webservices with MapForce 357 SOAP ENV Envelope umlns S04P ENV http r fschemas xmlioap oarg soap er SOAP ENV Body mi putPerson xumulnsim http rr mm altora coun WSD DE ery
571. t 2253 7 r lt Totalveight lt Header lt Header lt Record ype 111 Record ype lt OrderNosO lt 0rderho gt lt Total Veight 10 Totalyveight lt Header lt Header Record Types 11 RecordType gt lt OrderNoeO Orderho lt TotalVeight 7 lt Totalveight lt Header lt fOrder of Oth Bi ha sYxml version 1 0 encading LITF e gt lt Order xmins xsi hith An a org 24001 AML Schema instance sHeader gt Record ype 1100 RecordT ype lt OrderNor897 lt Orderho gt lt TotalWeight 22 1 Totahveight lt Totallnittlost 16235 lt Totallntlost lt Header lt Header Record yper1110 lt RecordT ype lt OrderNo 9832 lt 0rderNa lt TotalWeight 22991 3 TotalVeight lt Totallnittlost 2 Totallntlost lt Header lt Header Record Types 120 RecordT ype lt rderNo 1 21 3 lt 0rderha lt TotalVeight 33 01 Totahveight lt Totallnittlost 8 Totallntlost lt Header lt Order Configuring the CSV container data Altova MapForce User Manual 2006 Altova GmbH FlexText FlexText Reference 293 Split once b Mode delimited line based Separator 1100 Split base head i Record separator Field separator Quote character Escape character First row contains field names no 4 Fey Head det mft ample Text ni Field string U Field 1 Field 2 Field 3 Field 4 1 A 4 1100 B97 i Ylbe255 LOX IAO G a a991 300A
572. t T Shirtt Mame PPP sAmount 17 lt J4mount PoP shrticles etLinettem JLinetems sA ompleteF 0 gt Please note When creating Copy all connections between a schema and a user defined function of type Inline the two components must be based on the same schema It is not necessary that they both have the same root elements however 2006 Altova GmbH Altova MapForce User Manual 210 User defined functions Complex user defined function XML node as output 10 4 Complex user defined function XML node as output This example is provided as the lookup udf out mfd file available in the MapForceExamples folder What this section will show is how to define an inline user defined function that allows a complex output component Note that the user defined function FindArticle consists of two halves A left half which contains the input parameter e asimple input parameter POArtNr A right half which contains e acomplex output component Article CompletePO with its XML child nodes mapped to CompletePO E ShortPo DajaQShortPO CustomerNr i E Lineltems E Lineltem 4 ArticleNr O FindArticle Amount e i a e 4 Article Com 4 Number SinglePrice P Amount Price gt Y LastName g Address Lo d Street H 4 Lineltems 7 Lineltem E 7 Article Y Number T it ot ot it ot ot it ot it ot it 4 SinglePrice Amount Price ot ot T The
573. t is no longer valid 1706 Error during code generation GenerateCodeEx Method GenerateCode as ExrrorMarkers Description Generates code for all project items of the project The code language and output location are determined by properties of the project and project items An object that can be used to iterate through all messages issued by the code generation process is returned These messages are the same as those shown in the Messages window of MapForce Errors 1500 The object is no longer valid 1501 Invalid address for the return parameter was specified 1706 Error during code generation Altova MapForce User Manual 2006 Altova GmbH The MapForce API Object Reference 503 GenerateCodeln Method GenerateCodeIn i_nLanguage as ENUMProgrammingLanquage Description Generates code for all project items of the project in the specified language The output location is determined by properties of the project and project items Errors 1500 The object is no longer valid 1706 Error during code generation GenerateCodelnEx Method GenerateCodeIn i_nLanguage as ENUMProgrammingLanquage as ErrorMarkers Description Generates code for all project items of the project in the specified language The output location is determined by properties of the project and project items An object that can be used to iterate through all messages issued by the code generation process is returned These messages are the same as thos
574. t tab lt xml version 1 0 encoding UTF 0 7 gt OrgChart xmn xsi http kay wa ora 200i AML Schema instance sOTtice gt lt MamesMartin Mame lt Name Hammer Mame gt o sMame Bander stame Mame King stamne sfOitice lt flrglhart 1 2 3 5 G F oi g T _ Discarding database relationships Create mappings of the same fields from different root tables e g Department and Office e PrimaryKey is mapped from the Department root table e Last is mapped from the Person root table Altova MapForce User Manual 2006 Altova GmbH MapForce and Databases Database relationships and how to preserve or discard them 141 SEL HER Altova HE Department i 2 egual m PrimaryKey HE 2 result 7 fry filter bnoderow on truel on talzely Ay Result of the above mapping OrgChart gt E 4 OrgChart I Jl 5 7 Desc E 4 Addre i wee 1 Lae J j laa kanai ta al m larai koa Te i i i i i i l ol Ll Le Le I Lr I Lil Le Lt Li This mapping method does not deliver the same result as the table dependencies between the Department and Person tables are now not taken into account The result contains the last names of all 21 persons in the database the filtering by the Department primary key has clearly not succeeded lt xml version 1 0 encoding UTF 8 H lt 0rgChart smns xsi http wey sw org 2001 AML Schema instance Office
575. t to Ignore 10 Double click the Store text and add descriptive text e g Key 111 and Key 222 Type sting Content starts with 1 111 Trim No Content starts with 3 222 E Output For the first aa je SOJE Type sting hl 15 Trim No 11 Save the FlexText template e g Flex Tutorial mft Altova MapForce User Manual 2006 Altova GmbH FlexText Using FlexText templates in MapForce 271 19 5 Using FlexText templates in MapForce Using the FlexText template in MapForce 1 Start or switch back to MapForce and select Insert Text file Insert Text Component Altova MapForce provides different methods to process text files depending on ther complexity Please choose below Design graphically new structure based on 4 sample file i Open existing FlesT est configuration file to map it with other sourcestargets Use simple processing for standard CSW delimited and or FLF fixed length files Continue 2 Click the Open existing FlexText configuration file button and select the previously defined FlexText template e g Flex tutorial mft The structure of the MapForce component mirrors that of the containers in Design view in FlexT ext i Fles tutorial O Text file Preview i E Root i F 4 Rows gt 14 Split once oo Kep 111 i Repeated split ae Key 222 e 3 E 7 Switch T r he Kep 222 e E Split once bo e c
576. t txt define sub SimpleSub Sub SimpleSub SimpleSub called endsub execute sub SimpleSub Call SimpleSub SParamByValue Original Value ParamByValue SParamByValue SParamByRef Original Value ParamByRef SParamByRef define sub CompleteSub SParanbyRet Sub CompleteSub Sparam ByVal SparamByValue ByRef SparamByRef 2006 Altova GmbH Altova MapForce User Manual 454 Code Generator The way to SPL Spy Programming Language CompleteSub called param Sparam paramByValue SparamByValue paramByRef SparamByRef SParamByRef Local Variable SparamByValue new value SparamByRef new value Set values inside Sub SParamByRef Local Variable SparamByValue new value SparamByRef new value CompleteSub finished endsub run sub CompleteSub Call CompleteSub FirstParameter SParamByValue ParamByRef ParamByValue SParamByValue ParamByRef SParamByRef GLOSES Altova MapForce User Manual 2006 Altova GmbH Code Generator The way to SPL Spy Programming Language 455 25 7 10 Built in Types The section describes the built in types used in global variables which describe the parsed schema Namespace Namespace abstraction Name type Description ___ The URI of this namespace The prefix of this namespace ContainsPublicClasses boolean True if the Classes collection contains at least one non inter
577. t window on or off When generating code the Messages output window is automatically activated to show the validation result Overview Switches the Overview window on or off Drag the rectangle to navigate your Mapping view 2006 Altova GmbH Altova MapForce User Manual 408 MapForce Reference Tools 24 10 Tools Customize The customize command lets you customize MapForce to suit your personal needs Options Opens the Options dialog box through which you can e Add or delete user defined XSLT functions or custom libraries e Define general settings such as the default output encoding e Define your specific compiler settings Libraries General Generation C Settings f Microsoft Visual Studio 2005 Microsoft Visual Studio NET 2003 IW Microsoft Visual C 6 0 f MSXML 4 amp ML Library C weres amp ML Library Static Library LIB C Dynamic Link Library LOLL I MFC Support CH Settings Microsoft Visual Studio 2005 f Microsoft Visual Studio NET 2003 Microsoft Visual Studio NET 2002 Borland CHBuilder Project Mono Makefile C Settings Defines the specific compiler settings for the C environment Please note that the MFC Support check box must be activated for the source code to be compilable C Settings Defines the specific compiler settings for the C environment Altova MapForce User Manual 2006 Altova GmbH MapForce R
578. ta sources and map data to multiple XML Schemas EDI documents or other databases 2006 Altova GmbH Altova MapForce User Manual Chapter 2 MapForce overview 8 MapForce overview 2 MapForce overview MapForce has four main areas the Library pane at left the Mapping tab group at right as well as the Overview and Messages panes below The actual mapping process is achieved by manipulating the on screen graphical elements in the mapping window e The Libraries pane displays language specific and user defined libraries as well as the individual library functions Functions can be directly dragged into the Mapping tab The Add Libraries button allows you to import external libraries into the tab group e The Mapping tab displays the graphical elements used to create the mapping transformation between the two schemas The source schema is the mf ExpReport component window displaying the source schema tree The target schema is the ExpReport Target window displaying the target schema tree Connectors connect the input and output icons of each schema item Schema items can be either elements or attributes The XSLT XSLT2 and XQuery tabs display a preview of the transformation depending on the specific language selected The Output tab displays a preview of the transformed or mapped data in a text view e The Overview pane displays the mapping area as a red rectangle which you can drag to navigate your Mapping
579. target document l ole a ie sie td 9 Start XMLSpy or Authentic Desktop and open the supplied mf ExpReport xml document Select the menu option Tools Options and click the XSL tab Enter xml in the Default file extension of output file field and click OK Select the menu option XSL XQuery XSL Transformation Select the previously generated MapToExpReport Target xslt file and click OK An XSL Output xml file is created XMLSpy automatically selects the correct XSLT engine for the transformation Select the menu option Authentic Assign a StyleVision Power Stylesheet Select the supplied stylesheet ExpReport Target sps and click OK Click the Authentic tab to switch to the Authentic view Company expense Report Travel Title Hame Tal Email Detal Project Manager Fred Landis 123 456 765 flandisi inanonull com add Expense detai Fred Landis Domestic daily rate add DomesticDailyRate Foreign daily rate add ForeigniD aily Domestic cash advance add CashAdvance Foreign cash advance add CashAdvanc Click the add Expense detail text in the Detail column The field changes to a check box 10 Click the check box to see the detailed expenses 2006 Altova GmbH Altova MapForce User Manual 46 MapForce tutorial Generating XSLT 1 0 and 2 0 code Company expense Report Travel EMPLOYEES Title Project Manager Harme Fred Landis Fred Landis Domestic daily rate Domestic cash advance Expens
580. tart using the functionality of MapForce You will generally either open an existing Document create a new one or generate code for or from this document Altova MapForce User Manual 2006 Altova GmbH The MapForce API Overview 463 26 1 2 Example Code Generation See also Code Generation The following JScript example shows how to load an existing document and generate different kinds of mapping code for it ff Resa Deg GOODI ea iS Generate Code for existing mapping works with Windows scripting host fg eRe eee Belper Function Hae e See ae See function Exit strErrorText WSCript FCho ST amp Errorilexc WSoript Quit 1 3 function ERROR strIext ObDJErT af objErr J null Exit TERROR obJErr number amp UxXEETE TJ op err description t T BECTTexC else Exit ERROR strText fo MAIN ig gt create the Shell and FileSystemObject of the windows scripting try objWshShell WScript CreateObject WScript Shell objFSO WScript CreateObject Scripting FileSystemObject catch err Exit Can t create WScript Shell object fy as open MapForce or access running instance and make it visible try objMapForce WScript GetObject MapForce Application objMapForce Visible true remove this line to perform background processing c
581. te items do not have output icons you cannot use them as data sources Please see the Duplicating input items section in the tutorial for an example of this Remove duplicate Removes a previously defined duplicate item Please see the Duplicating input items section in the tutorial for more information Database Table actions Allows you to define the table actions to be performed on the specific target database table Table actions are Insert Update and Delete please see Mapping data to databases for more information Database Key settings Allows you to define the Key settings of database fields please see Database Key settings for more information Cut Copy Paste Delete The standard MS Windows Edit commands allow you to cut copy etc any components or functions visible in the mapping window All connectors will be retained except for those which would have to be replaced Change Root element Allows you to change the root element of the XML instance document Useful in the target schema window as this limits or preselects the schema data Edit Schema definition in XMLSpy Starts XMLSpy and opens the schema file ready for you to edit Component Settings Opens the Component Settings dialog box Allows you to select the input and or output XML Instance as well as define database specific settings for code generation Please see Component Settings for more information on these settings 2006 Altova GmbH Altova MapFor
582. te to the designated folder and compile your project 4 Compile and execute the program code using your specific compiler Two XML files are generated by the application Please note A JBuilder project file and Ant build scripts are generated by MapForce to aid in compiling the Java code see the section on JDBC driver setup for more information 2006 Altova GmbH Altova MapForce User Manual 52 MapForce tutorial Mapping multiple source items to single target items 3 7 Mapping multiple source items to single target items In this section two simple employee travel expense reports will be mapped to a single company report This example is a simplified version of the mapping you have already worked through in the Multiple target schemas documents section of this tutorial Aim of this section To merge two personal travel expense reports into a company expense travel report Please note that the files used in this example have been optimized to show how to map data from two input XML files into a single item in the target schema this is not meant to be a real life example Files used in this section mf ExpReport xml Input XML file used in previous section mf ExpReport2 xml The second input XML file mf ExpReport combined xml The resulting file when the mapping has been successful ExpReport combined xsd The target schema file into which the two XML source data will be merged ExpReport combined sps The StyleVision Styl
583. ten always useful try objWshShell WScript CreateObject WScript Shell objFSO WScript CreateObject Scripting FileSystemObject catch err Exit Can t create WScript Shell object create the MapForce connection if there is a running instance of MapForce that never had a connection use it otherwise we automatically create a new instance try objMapForce WScript GetObject MapForce Application catch err 2006 Altova GmbH Altova MapForce User Manual 466 The MapForce API Overview Exit Can t access or create MapForce Application a print project tree items and their properties recursively function PrintProjectTree objProjectItemIter strTab while objProjectItemIter atEnd get current project item objItem objProjectItemIter item try ff SSSSS print common properties strGlobalText strTab objItem Kind objItem Name n Iy Scene print code generation properties if available try if objItem CodeGenSettings_UseDefault strGlobalText strTab Use default code generation settings n else strGlobalText strTab code generation language is objItem CodeGenSettings_Language output folder is T ob jiltem CodeGenSettings Outputrolder n catch err if a print WSDL settings if available try strGl
584. the document content from the file system save Method save as boolean Dispatch Id 1003 Description Save saves the current document at the location Path SaveAs Method OpenDocument strFileName as string as boolean Dispatch Id 1004 Altova MapForce User Manual 2006 Altova GmbH MapForceControl Object Reference 575 Description SaveAs sets Path to strFileName and then saves the document to this location SaveDocument deprecated Method SaveDocument as boolean deprecated Description SaveDocument saves the current document at the location Path Events The MapForceControlDocument ActiveX control provides following connection point events OnDocumentOpened OnDocumentClosed OnModifiedFlagqChanged OnDocumentClosed Event OnDocumentClosed objDocument as Document Dispatch Id 2 Description This event gets triggered whenever the document loaded into this control gets closed The argument objDocument IS a Document object from the MapForce automation interface and should be used with care OnDocumentOpened Event OnDocument Opened objDocument as Document Dispatch Id 1 Description This event gets triggered whenever a document gets opened in this control The argument objDocument IS a Document object from the MapForce automation interface and can be used to query more details about the document or perform additional operations OnModifiedFlagChanged Event OnModifiedFlagChanged
585. the left hand window border Align tree right Aligns all the items along the right hand window border This display is useful when creating mappings to the target schema Change Root element Allows you to change the root element of the XML instance document Useful in the target schema window as this limits or preselects the schema data Edit Schema Definition in XMLSpy Selecting this option having previously clicked an XML Schema document opens the XML Schema file in the Schema view of XMLSpy where you can edit it Duplicate input Inserts a copy clone of the selected item allowing you to map multiple input data to this item Duplicate items do not have output icons you cannot use them as data sources Please see the Duplicating input items section in the tutorial for an example of this Remove duplicate Removes a previously defined duplicate item Please see the Duplicating input items section in the tutorial for more information Database Table actions Allows you to define the table actions to be performed on the specific target database table Table actions are Insert Update and Delete please see Mapping data to databases for more information Database Key settings Allows you to define the Key settings of database fields please see Database key settings for more information Component Settings Opens a dialog box which displays the currently selected component settings If the component is an XML Schema file then the Co
586. ther windows curently open in MLS py If there is no XML source file associated with the suey please skip this step 3 Click the Browse button and select the XML file that is to act as the data source e g mf ExpReport xml 4 Click the Select XML button to execute the XQuery lt sml version 1 0 encoding gt sa Company xmins a hittp iimy company cannamespace xming xsi http Jay wes org 2001 AML Schema instance xstechemaLocation hite fimy company c CUPROGRA 1 Altova MAFF FORCE 004 apF orceExamples T utorialiexpReport Target xed gt saEmployees lt a Title Project Manager amp Title sacNamesFred Landis a Name ea Tel 2123 456 78 lt e Tel gt ee Email t landis inanonull com a Email sacexpense tem Currency USD Bill to Development Pf ea Dates 2003 01 022 3 Date of sec Travel Travel Cost 337 88 s gt i sla expense item sarexpense tem Currency USD Bill to 4ccounting i i ea Date gt 2003 07 07 lt a Date i se Travel Travel Cost 1 014 22 i sla expenze item a expense tem Currency USD Gill to Marketing ea Date 2003 02 02 a Date fo sg Travel Travel Cost 2000 s gt i sla expense item gt fa Employee sla Company Text Grid Schema SOL Authentic Browser fexpMapToExpReport Target xq fed mf ExpReport ml fa4 Query Output xml An XQuery Output xml file is created which contains the mapped data
587. tion The first function checks if a Category entry exists in the Applications table As one does not exist for the Notepad application Misc is mapped to the Category item of the Text file The second function checks if a Description entry exist and maps the string No description if one does not exist which is also the case with the Notepad application 2006 Altova GmbH Altova MapForce User Manual Chapter 8 MapForce CSV and Text files 168 MapForce CSV and Text files 8 MapForce CSV and Text files MapForce now includes support for the mapping of flat file formats i e CSV files and Text files as both source and target components Please note that you need to select one of the programming languages Java C or C as the mapping output to be able to work with text or CSV files This bi directional mapping support includes e XML schema to from flat file formats e Database to from flat file formats e UN EDIFACT and ANSI X12 to from flat file formats There are two ways that mapped flat file data can be generated saved e By clicking the Output tab which generates a preview using the built in MapForce engine selecting the menu option Output Save output file or clicking the a icon to save the result e By selecting File Generate code in Java C or C then compiling and executing the generated code Please note All the following examples using CSV files as source or target components can a
588. tion of XML document for XQuery 587 schema awareness of XPath 2 0 and XQuery Engines 590 Script ANT 417 Search output tab 27 XSLT Output tab 392 Select from where DB query 162 Separators user defined 312 Set null 164 Setting connector 401 fill character 186 Settings c and c 440 changing component 397 fixed length text file 186 ShowltemTypes 480 ShowLibraryFunctionHeader 480 shutdown of application 476 Soap webservice fault 360 Software product license 605 Solution file 424 Source multiple and code generation 430 Source driven mixed content mapping 68 creating mapping 71 text node settings 71 vs standard mapping 77 SPL 442 adding text to files 450 code blocks 443 comments 444 conditions 448 foreach 449 global objects 446 subroutines 451 using files 447 variables 445 Split once 279 Standard mapping with children 77 mixed content mapping 77 user defined function 201 vs source driven mapping 77 XSLT library 16 Starting plug in for Eclipse 372 startup of application 476 Store as CSV 289 Store as FLF 294 Store value 296 Substitute missing node 102 null 164 Sum nodes in XSLT 1 0 244 Sun ONE Studio Java generate code 420 Support database info 142 Supported databases 106 Switch 283 Sybase database info 151 2006 Altova GmbH 628 Index T Table actions database 135 hierarchy 114 pare
589. tion or CPU 41 alterations modifications or attempts to change the Software without Altova s written approval 111 causes external to the Software such as natural disasters the failure or fluctuation of electrical power or computer equipment failure iv your failure to maintain the Software at Altova s specified release level or v use of the Software with other software without Altova s prior written approval It will be your sole responsibility to 1 comply with all Altova specified operating and troubleshooting procedures and then notify Altova immediately of Software malfunction and provide Altova with complete information thereof 11 provide for the security of your confidential information 111 establish and maintain backup systems and procedures necessary to reconstruct lost or altered files data or programs SOFTWARE ACTIVATION UPDATES AND LICENSE METERING a License Metering Altova has a built in license metering module that helps you to avoid any unintentional violation of this Software License Agreement Altova may use your internal network for license metering between installed versions of the Software b Software Activation Altova s Software may use your internal network and Internet connection for the purpose of transmitting license related data at the time of installation registration or update to an Altova operated license server and validating the authenticity of the license related data in order to protect Altov
590. tor of XMLSpy Note that this section does not describe how to use these functions For more information about the usage of functions see the World Wide Web Consortium s W3C s XQuery 1 0 and XPath 2 0 Functions and Operators CR of 8 June 2006 General Information Standards conformance e The Altova XPath 2 0 Engine implements the World Wide Web Consortium s W3C s XPath 2 0 Candidate Recommendation of 8 June 2006 The Altova XQuery 1 0 Engine implements the World Wide Web Consortium s W3C s XQuery 1 0 Candidate Recommendation of 8 June 2006 The XPath 2 0 and XQuery 1 0 functions support in these two engines is compliant with the XQuery 1 0 and XPath 2 0 Functions and Operators CR of 8 June 2006 e The Altova XPath 2 0 Engine conforms to the rules of XML 1 0 Third Edition and XML Namespaces 1 0 Default functions namespace The default functions namespace has been set to comply with that specified in the standard Functions can therefore be called without a prefix Boundary whitespace only nodes in source XML document The XML data and consequently the XML Infoset that is passed to the Altova XPath 2 0 Engine and Altova XQuery 1 0 Engine is stripped of boundary whitespace only text nodes A boundary whitespace only text node is a child whitespace only text node that occurs between two elements within an element of mixed content This stripping has an effect on the value returned by the fn position fn last fn count and fn
591. torial folder and has the following format 111 392 1 22537 7 5 Container ship Hega 111 1579227 10 3 468 Microtome 111 B152427 7 6 1288 Miscellaneous 222 978 4 7563 1 69 Alr fFreight Mini 222 2AN561 18 5 1808688 Gas Chromatograph General outgassing pollutants 1100 897 22 1 71 6235 L0 11108 9832 22991 30 002 HOX 1120 1213 33 01 008 50 Aim of the tutorial e To separate out the records containing 111 and 222 keys into separately mappable items e To discard the plain text record e To create a CSV file of the remaining records 1 Start MapForce and open a new mapping file 2 Select Insert Text file or click the Insert Text file icon E 3 Click the Design graphically new structure button Insert Text Component Altova MapForce provides different methods to process text files depending on their complexity Please choose below Design graphically new structure based on a sample file Open existing Flex Text configuration file to map it with other sources bargets Use simple processing for standard CSW delimited and or FLF fixed length files Continue 4 Enter a name for your FlexText template and click Save to continue e g Flex tutorial mift An empty design along with the Open dialog box are displayed Altova MapForce User Manual 2006 Altova GmbH FlexText FlexText Tutorial 263 File name Encoding Codepage 1252 w estem Tab size E Altova_
592. tova MapForce User Manual 2006 Altova GmbH MapForce plug in for Eclipse Creating new MapForce files mapping and project file 377 23 5 Creating new MapForce files mapping and project file To create a new MapForce mapping or project files e Click the New MapForce combo box and select the required option OBx O Q HHG OA a Mapping ley New MapForce Project File ley Hew MapForce Project classpath project e New MapForce mapping creates a single mapping file e New MapForce Project File creates a MapForce project that can combine multiple mappings into one code generation unit You must select this option when you are creating webservices e New MapForce Project creates a new MapForce Eclipse project adding the folder to the Navigator window MapForce Eclipse projects are Eclipse projects with a MapForce builder assigned to them See Using MapForce Eclipse projects for automatic build for details 2006 Altova GmbH Altova MapForce User Manual 378 MapForce plug in for Eclipse MapForce code generation 23 6 MapForce code generation Build Integration MapForce mappings can be contained in any eclipse project Generation of mapping code can be triggered manually by selecting one of the Generate Code menu entries for the mapping or MapForce project file Full integration into the Eclipse auto build process is achieved by assigning the MapForce builder to an Eclipse project For man
593. transformed into the target schema document or database e Components and functions have small connection triangles called input or output icons These icons are positioned to the left and or right of all mappable items e Clicking an icon and dragging creates the mapping connector You can now drop it on another icon A link icon appears next to the text cursor when the drop action is allowed e Clicking an item name element attribute automatically selects the correct icon for the dragging action e An input icon can only have one connector If you try and connect a second connector to it a prompt appears asking if you want to replace or duplicate the input icon e An output icon can have several connectors each to a different input icon e Placing the mouse pointer over the straight section of a connector close to the input output icon highlights it You can now reposition the connector by dragging it elsewhere Number of connectors Input and output icons appear on most components there is not however a one to one relationship between their numbers e Each schema item element attribute has an input and output icon e Database items have input and output icons e Duplicated items only have input icons This allows you to map multiple inputs to them Please see Duplicating Input items for more information e Functions can have any number of input and output icons one for each parameter E g the Add Function has two
594. tus 13634 amp 0x02 btnFuncSettings disabled objDoc1 QueryStatus 13632 amp 0x02 i btninsertInput disabled ob jDocl QueryStatus 13491 amp 0x02 btnGenXSLT disabled objDocl QueryStatus 13617 amp 0x02 btnGenXSLT2 disabled objDocl QueryStatus 13618 amp 0x02 btnGenxXQuery disabled objDocl QueryStatus 13586 amp 0x02 btnGenCPP disabled objDocl QueryStatus 13589 amp 0x02 btnGenCSharp disabled objDocl QueryStatus 13588 amp 0x02 btnGenJava disabled objDocl QueryStatus 13587 amp 0x02 set activity status of simulated toolbar lt SCRIPT gt 2006 Altova GmbH Altova MapForce User Manual 546 MapForceControl Integration at Document Level Visual Basic Source code for an integration of MapForceControl into a VisualBasic program can be found in the folder MapForceExamples ActiveX VisualBasic relative to your MapForce installation Altova MapForce User Manual 2006 Altova GmbH MapForceControl Command Table 547 27 3 Command Table Tables in this section list the names and identifiers of all commands that are available within MapForce Every sub section lists the commands from the corresponding top level menu of MapForce The left most column shows the command s menu text to make it easier for you to identify the functionality behind the command The last sub section is a collection of those commands that are not accessible via the main
595. ty context and enables it once again User defined functions and Copy all connections When creating Copy all connections between a schema and a user defined function of type Inline the two components must be based on the same schema It is not necessary that they both have the same root elements however Please see Complex output components defining for an example Altova MapForce User Manual 2006 Altova GmbH User defined functions Standard user defined function 201 10 2 Standard user defined function This example is provided as the lookup standard mfd file available in the MapForceExamples folder Aim To create a generic look up function that e supplies Articles Number data from the Articles XML file to be compared to Article numbers of a different XML file ShortPO in this case ShortPo H CompletePo E ShortPO P i F CompletePO 4 CustomerNr gt E a Y Customer E Y Lineltems E Lineltems 1 Lineltem 3 Q Lineltem oaaae a oaa Amount 4 Number SinglePrice Y Amount Price e Insert the ShortPO xsd and assign ShortPO xml as the source XML file e Insert the CompletePO xsd schema file and select CompletePO as the root element e Insert a new user defined function using the method described below To create a user defined function from scratch 1 Select the menu option Function Create User defined function 2 Enter the name of the function e g LookupArti
596. type ned string gt BRonald t First gt Last xsi type s ysd string Superstringt Last Title wsLitype xsed string Dr Title gt PhoneEXT xueiitype ned string gt 444 PhoneExT Email xeLiitype ned string gt rosstrings com E Person gt Person xsSLitwpe n0 Person gt SFLrst ws Llitype ned string gt PRobertt First gt Last xeSLi type xed string Darkmatter Last Title xsiitype xned string gt Mathematiciant Tit PhoneEAT xusiitype ned string 2994 PhoneEXT gt Email xsiitype xed string gt rodarkW strings com Person Person uslitype n0 Person gt sFirst xsSLitype ned string gt BRoger First Last xsSLlitype xed string Gravityt Last gt gt Title xwsLitype ned istring Crisis manager Ti PhoneEXT xweiitype ned istring gt lLl t PhoneExT Email xeLitype ned string gt rogWstrings com E Person gt The SOAP Response document is returned by the webservice and contains four persons from the Access database 2006 Altova GmbH Altova MapForce User Manual 356 MapForce and Webservices Generating Java webservices with MapForce 21 3 2 Using the webservice putPerson operation e Double click the getPerson mapping icon below the Mappings folder in the Project window to view the mapping This opens the putPerson mfd file in an additional tab Thank you for adding putPersonSoaplnput putPersonSoap0 utput Preview AE O0utpu
597. ual code generation see Build mapping code manually For automatic generation of mapping code please see Using MapForce Eclipse projects for automatic build and Adding MapForce nature to existing Eclipse Project Altova MapForce User Manual 2006 Altova GmbH MapForce plug in for Eclipse MapForce code generation 379 23 6 1 Build mapping code manually To manually build mapping code for a single mapping 1 Open or select the mapping and select File Generate Code in or File Generate Code in Selected Language You are prompted for a target folder for the generated code 2 Select the folder and click OK to start code generation Any errors or warnings are displayed in the MapForce Messages tab To manually build mapping code for multiple mappings combined into a MapForce project 1 Open or select the MapForce project file 2 Select the root node or any other node in the project document 3 Select Generate Code or Generate Code in from the right mouse button menu The target folder for the generated code is determined by the properties of the selected node or properties of its parents 4 Any errors or warnings are displayed in the MapForce Messages tab 2006 Altova GmbH Altova MapForce User Manual 380 MapForce plug in for Eclipse MapForce code generation 23 6 2 Using MapForce Eclipse projects for automatic build The MapForce plug in has a built in project builder This builder can be identified by th
598. uments Errors 1000 The application object is no longer valid 1001 Invalid address for the return parameter was specified HighlightSerializedMarker Method HighlightSerializedMarker i_strSerializedMarker as String Description Use this method to highlight a location in a mapping file that has been previously serialized If the corresponding document is not already loaded it will be loaded first See Document GenerateCodeEx for a method to retrieve a serialized marker Errors 1000 The application object is no longer valid 1001 Invalid address for the return parameter was specified 1007 The string passed in _ strSerializedMarker is not recognized a serialized MapForce marker 1008 The marker points to a location that is no longer valid Name Property Name as String read only Description The name of the application Errors 1000 The application object is no longer valid 1001 Invalid address for the return parameter was specified NewDocument Method NewDocument as Document Description Creates a new empty document The newly opened document becomes the ActiveDocument This method is a shortened form of Documents NewDocument Errors 1000 The application object is no longer valid 1001 Invalid address for the return parameter was specified Altova MapForce User Manual 2006 Altova GmbH The MapForce API Object Reference 475 NewProject Method NewProject as Project Description Creates a
599. upper function Ucase JF OJD SQL Execution exec multiple stat in one command separator n n Q ee special error handling ee retrieve parameter types Transactions Flat transactions supported y Start flat transaction via execution of SQL command Nested transactions supported not supported by Access not supported by Access n n n n n n set transaction isolation MF begin transaction API call 2006 Altova GmbH Altova MapForce User Manual 144 MapForce and Databases Database feature matrix MF commit transaction API call ME rollback transaction API call MF rollback to save point Altova MapForce User Manual 2006 Altova GmbH MapForce and Databases Database feature matrix 145 7 5 2 Database info MS SQL Server ee MS SQLServer supported OO i Pose own authentication Pe Trusted authentication Connections OLE DB ee oe Select Method Cursor issues ee TY irsedin Sates rise nal Statomonis sa SSS A E ice suppon iF sreadback dent vaiue IDENTITV es ee es Sareen special issues when using Flat transactions supported Start flat transaction via y execution of SQL command Nested transactions supported set transaction isolation MF begin transaction BEGIN TRANSACTION MF commit transaction COMMIT TRANSACTION MF rollback transaction ROLLBACK TRANSACTION must be applied with limits DATETIME datatype n
600. used in this section are available in the MapForceExamples Tutorial folder Altova MapForce User Manual 2006 Altova GmbH MapForce and Webservices WSDL info supported protocols 347 21 1 WSDL info supported protocols The WSDL file needed to produce a webservice describes the webservice completely MapForce important sections definitions of the WSDL file are Types Messages and Operations The WSDL file on which the webservice is based has to be created outside of MapForce you can use XMLSpy to create it for example PortT ype A lt portType gt element defines a webservice i e it e defines the Operations that can be performed e the messages that are involved in each operation Types The lt types gt element define the datatypes that are used by the webservice WSDL types use syntax identical to XML Schema MapForce displays these elements datatypes as items in a message component allowing you to map them to other item constructs directly Messages The lt message gt element defines the parts of each message and the data elements of an operation These are the messages exchanged by the client and server There are three types of messages Input Output and Fault In MapForce each message is a component e g getPersonSoaplIn to which you can map other items Messages can consist of one or more message parts Operations Operations consist of messages An operation can have e one Input message e
601. va Altova h Altova AltovaException h Altova SchemaTypes h Altova SchemaTypeString h Greetings h namespace helloworld CSchemaString Greetings HelloFunctionResponse const CSchemaBoolean amp rGreetingType if rGreetingType return CSchemaStrang _t Helloe World 3 return CSchemastriang _F Hello Useri 3 In contrast to Java or C you do not need to compile your source files They will be copied to the generated code and are compiled with the rest of the generated mapping code C compile errors If you get a compiler error at the line shown below add the path to the msado15 DLL import mMsadoL gt 0 1 vename EOF ENnNdOfFile You have to add the path where the msado15 dll is stored into the directories section of your Visual Studio environment 1 In VS select from the menu Tools Options 2 Select the Directories tab 3 Select Include files in the pull down Show directories for 4 Add anew line with the path to the file 2006 Altova GmbH Altova MapForce User Manual 232 Adding custom libraries Writing your libraries for English systems usually C Program Files Common Files System ADO 5 Rebuild then everything should be fine Altova MapForce User Manual 2006 Altova GmbH Chapter 12 Adding custom XSLT 1 0 functions 234 Adding custom XSLT 1 0 functions 12 Adding custom XSLT 1 0 functions MapForce
602. va MapForce User Manual 2006 Altova GmbH MapForceControl Command Table 549 27 3 2 Edit Menu Commands from the Edit menu MenuText _ CommandName D ID_EDIT_UNDO ID_EDIT_REDO ID_EDIT_FIND Cut Paste ID_EDIT_FINDNEXT Copy CY ID_EDIT_COPY Paste CH ID_EDIT_PASTE ID_EDIT_CLEAR Select All ID_EDIT_SELECT_ALL 2006 Altova GmbH Altova MapForce User Manual 550 MapForceControl Command Table 27 3 3 Insert Menu Commands from the Insert menu Menu Text Po CommandName ID XML Schema File ID_INSERT_XSD Database ID_INSERT_DATABASE D Constant Filter Nodes Rows F Else Condition ID_INSRT_ CONDITION Exception ID_ INSERT EXCEPTION Altova MapForce User Manual 2006 Altova GmbH MapForceControl Command Table 551 27 3 4 Project Menu Commands from the Project menu Menu Text CommandName _ _ D Add Files to Project Add Active File to Project Create Folder Open Mapping for Operation Create Mapping for Operation Add Mapping File for Operation Remove Item ID_PROJECT_REMOVE_ITEM nsert Web Service ID_POPUP_PROJECT_INSERT_WEBSERVICE 230 Open WSDL file In XMLSpy ID_POPUP_PROJECT_OPENINXMLSPY Generate Code for Entire Project ID_POPUP_PROJECT_GENERATE_PROJECT Generate code in XSLT 1 0 ID_PROJECT_GENERATEXSLT Generate code in XSLT 2 0 ID_PROJECT_GENERATEXSLT2 ID_PROJECT_GENERATEXQUERY Generate code invlava Generate code inG Sharp Generate code inGrs Project Setti
603. valid contents and can be parsed Altova MapForce User Manual 2006 Altova GmbH Code Generator The way to SPL Spy Programming Language 457 Sample e For every type declared in the schema xsd a class is generated e All elements are generated as members inside the containing class e To find out which type the generated member has which class we have to use to store the value use the TypeObject property Example lt xs complexT ype name TypeA gt lt xs sequence gt lt xs element name B type TypeB gt lt xS sequence gt lt xs complex I ype gt lt xs complexT ype name TypeB gt CodeGen would create two classes class TypeA TypeB B class TypeB Explanation When class TypeA is generated the member B is also generated To find out the type of B use the TypeObject method of the element which returns the class TypeB So we can get the name and use it there Facet This class consists of the constraint itself and several boolean variables The boolean variables tell you the kind of constraint you re currently dealing with The names of the Boolean variables are identical to those used in the schema specification Name Type Description Constraint string Holds the value of the facet_ IsLength boolean ooo o IsMinLength boolean IsMaxLength boolean ooo IsMinInclusive boolean ooo IsMinExclusive fooolean o IsMaxinclusive boolean o IsMaxExclusive boolean IsTotalDigis boole
604. w i Y DomesticD ailyRate vse ForeignD ailyR ate i Expense detail 4 expense item i Currency 7 ae Bill to AO Trave i Lo Travel Cost 4 Destination Ke i Car Rental er falsell E ExpReport T arget Preview KEE 4 Company Foot element a 4 Employee l i 4 Title i Name of Email 7 DomesticD ailyR ate l l rete _ ForeignD e Y Expense detail i expense item oe Currency Bill to T E ae Date Travel i on Travel Cost 4 Destination 4 Car Rental tend Air Travel l om Misc Travel a Accommodation a DomesticAcc I i b DomesticAcc Cost 2006 Altova GmbH Altova MapForce User Manual 50 MapForce tutorial Multiple target schemas documents 3 6 1 Viewing and generating multiple target schema output Clicking the Preview icon lets you select which of the schema targets you want to preview To view specific XSLT output 1 Click the Preview icon in the title bar of the second schema component to make it active E ExpReport T arget Preview i Sele sie aes Preview J E Company ii gt El Company a Employee 2 E Employee F Title gt aE Y Title i ae 7 Name A i de Name e i paue on Email 2 Click the Output tab of the Mapping tab group lt xml version 1 0 encoding UTF 0 t lt Company xmn xsi http Hne ws org 00 AML Schema
605. ware License Agreement governs your use of all of the software included in the Suite If you have licensed SchemaAgent then the terms and conditions of this Software License Agreement apply to your use of the SchemaAgent server software SchemaA gent Server included therein as applicable and you are licensed to use SchemaA gent Server solely in connection with your use of Altova Software and solely for the purposes described in the accompanying documentation In addition if you have licensed XMLSpy Enterprise Edition or MapForce Enterprise Edition or UModel your license to install and use a copy of the Software as provided herein permits you to generate source code based on i Altova Library modules that are included in the Software such generated code hereinafter referred to as the Restricted Source Code and 11 schemas or mappings that you create or provide such code as may be generated from your schema or mapping source materials hereinafter referred to as the Unrestricted Source Code In addition to the rights granted herein Altova grants you a non exclusive non transferable limited license to compile into executable form the complete generated code comprised of the combination of the Restricted Source Code and the Unrestricted Source Code and to use copy distribute or license that executable You may not distribute or redistribute sublicense sell or transfer to a third party the Restricted Source Code unless said third party al
606. warning e f a function component input icon is unconnected an error message is generated and the transformation is halted e If the function output icon is unconnected then a warning is generated and the transformation process continues The offending component and its data are ignored and are not mapped to the target document Validating mapped OUTPUT Clicking the Output tab uses the MapForce XSLT 1 0 2 0 or XQuery engine to transform the data and produce a result in a Text view If the data is mapped to an XML Schema then the resulting XML document can be validated against the underlying schema If the target component is an EDI file then the output as validated against the EDI specification please see UN EDIFACT and ANSI X12 as target components for more information e Click the Validate button kj to validate the document against the schema A Output XML document is valid message or a message detailing any errors appears Altova MapForce User Manual 2006 Altova GmbH MapForce overview XSLT Output tab generating XSLT or program code 27 2 7 XSLT Output tab generating XSLT or program code The XSLT XSLT2 XQuery and Output tabs of the Mapping tab group supply a preview of e the generated XSLT or XQuery code and e the resulting transformation produced by the MapForce engine Please note The result generated by the MapForce engine is an on the fly transformation of database Text or EDI data without
607. webservices e copy the compiled files to the correct location on the webserver e deploy the webservice on the webserver 1 Copy the compiled com directory and all subdirectories generated by MapForce to the WEB INF classes directory of Axis com directory if the Base Package Name is the supplied default com mapforce define using Files Mapping settings In this example c tools jakarta tomcat 5 5 9 webapps axis WEB INF classes 2 Start Apache Tomcat using the startup bat batch file supplied in your tomcat installation directory bin 3 Deploy the webservice by entering ant deploy This executes the deploy section of the build xml file and deploys the webservice on the webserver Use ant undeploy when you want to remove the service from the server Deployment check Axis 1 Switch to your browser and enter http 127 0 0 1 axis to open the Apache Axis page Altova MapForce User Manual 2006 Altova GmbH MapForce and Webservices Generating Java webservices with MapForce 353 Apache AXIS Hello Welcome to Apache Asis What do you want to do today Validation Validate the local mstallation s configuration see below if this does mot work Last View the list of deployed Web sences all Call a local endpoint that list s the caller s http headers Yast Visit the Apache Axis Home Page Adrunister Axis disabled by default for security reasons SOAP Momter disabled by default for security reaso
608. with this File type Should the system S7 automatically switch to this perspective for this File type The associated option is accessible in the the MapForce preferences dialog as well M Do not ask again 2006 Altova GmbH Altova MapForce User Manual 374 MapForce plug in for Eclipse MapForce Editor View and Perspectives 23 3 MapForce Editor View and Perspectives The MapForce perspective can be automatically set if you activate the Automatically switch to MapForce perspective at file open in the Window Preferences dialog box You can also use the option described below to enable the perspective To enable the MapForce perspective in Eclipse e Select the menu option Window Open perspective Other MapForce MapForce Tut ExpReport mfd Eclipse SDK ee ee Ioj x File Edit Navigate Search Project Insert Component Connection Function Output View Run Window Help lo lo v E E mapForce i Java WUT Hie HO WW ce ce fh hee Se OQ Mie Ee Libraries z E BS Tut Orgchart mfd EG Tut ExpReport mfd pE HS Core mf ExpReport E peas ai conversion functions EI expense report exp aja 4 boolean result boolean number resul number string result string an sees detailed Cais aa Den F i cumency f concat Person gt see TA I 2 Y First amy result H d i Last Pra valued bel a Title a Sq 4 Phone
609. xpenses xml Finished Press any key to continue 2006 Altova GmbH Altova MapForce User Manual 426 Code Generator Generating program code 25 2 3 Generating C code Prerequisites and default settings C code generation for both MapForce and XMLSpy support Visual C 6 0 7 1 Visual Studio NET 2003 and Visual Studio 2005 directly sin and vcproj files are generated in addition to the dsw dsp files for Visual Studio 6 0 The Generation tab under menu option Tools Options allows you to choose the target IDE and code generation settings The menu option File Mapping settings defines the mapping project settings The default settings are Application name Mapping Database specfic settings can be viewed by clicking a database component and selecting the menu option Component Component Settings To generate C code in MapForce 1 2 Select the menu option File Generate code in C You are then prompted for the target directory of the generated files Select the directory you want to place the files in and click OK to confirm eg c codegen C A C Code generation completed message appears when the process was successful If not an error message appears detailing the specific error s Open the mapping dsw or mapping slin file in the Mapping subdirectory i e c codegen C mapping in Microsoft Visual C Mapping Microsoft isual C MappingMaini cpp E File Edit View In
610. xt file or click the insert Text file icon This opens the Insert Text Component dialog box Insert Text Component Altova MapForce provides different methods to process text tiles depending on ther complexity Please choose below Design graphically new structure based on 4 sample file Open existing Flex Text configuration file to map it with other sources bargets Use simple processing for standard CSW delimited and or FLF fixed length files Donte Click the Use simple processing radio button and click the Continue button This opens the Text import export dialog box in which you can select the type of file and specific settings you want to work with Click the Input file button and select the Altova FLF txt file You will notice that the file is made up of a single string and contains fill characters of type 2006 Altova GmbH Altova MapForce User Manual 180 MapForce CSV and Text files Mapping Fixed Length Text files to a database kd Text import export Se eae x Input Output File agram FilestAlkovas M apForce2U054 M apForceE samples TutoriahAkowa FLF bt OF Output file Cancel Input file encoding f itthe endian byte order lu code UTF 8 T Big endian byte order CSW Settings Field delimiter Text enclosed in coy Tab Semicolon f Comma Space f Custom c Not f fe o r Fixed First row contains field names 3 Cl
611. y entry and hit the key on the numeric keypad to view all the items 5 Click the expand window icon and resize the window ExpReport T arget Eli expense report gt a E Company seas detailed E Employee l E cumency on Title 24 Person ow Name First R Y Last Title 7 m Phone i Email expense item Lae J ia Le T7 _ I kaa r Li bs ad teal a ka ho kog Be i D a L ul Ll Lt ow ho oe i a Le el Le 1 Le M Email 4 DomesticD ailyR ate gt ForeignDailyRate i Expense detail Li M M Ln I kog Ts beg kaa Pap oe ieee ees ieee ieee ieee ieee ia al kaa r m pny r e a F T a es eS koni a E expense item vane Currency cae Bill to a Y Date E Y Travel i be Travel Cost ho dirai type ERPE T explo iw nu L ka koni kog Te i D a L LE Ll Lt oJ kag Mo i a a Jt T LJ 1 Le M M ry a A i Meal re mealtype j LF Ler kaa ho F a 4 Destination We are now ready to start mapping schema items from the source to the target schema 2006 Altova GmbH Altova MapForce User Manual 34 MapForce tutorial Mapping schema items 3 2 Mapping schema items This section deals with defining the mappings between the source and target schema items 1 Click the expen
Download Pdf Manuals
Related Search
Related Contents
HP ProLiant N36L + DVD RW + 250GB SATA LFF NEW SRS10Aシリーズ 取扱説明書の同梱終了のお知らせ(2015 117949 Bedienungsanleitung 48890_PT:BD, page 1 SMC Networks EX500-GEN1 Network Card User Manual Radio Swing Manual de instrucciones ーインキュペータ室` ng…支援室入居ガィ ド Model/Modèle: S31131 - dolphin plumbing Copyright © All rights reserved.
Failed to retrieve file