Ways to Export XMLUsing MQL, you can export objects to XML format in either of two ways:
RestrictionsBe aware of the following restrictions related to exporting and importing in XML format:
The workaround is to go to the line number in the XML file and remove the offending character. The CDATA termination character string ]]> is replaced by ]Inserted_by_ENOVIA]Inserted_by_ENOVIA> in XML export files. XML Import files will do back replacement. Outside software reading, XML files should handle this replaced string. XML ClauseUse the XML clause as an OPTION_ITEM in any Export command to export
administrative or business objects in XML format. To ensure that the XML files
reside in the same directory as the XML DTD, you can export files to the XML
folder (in your ENOVIA_INSTALL directory) where the DTD is installed.
Alternatively, you can specify another location in your Export command and copy
the DTD into that directory. Use the
XML CommandUse the XML command to turn XML mode on or off as a global session setting. The complete XML command syntax is:
Omitting the on or off switch causes XML mode to be toggled on or off, depending on its current state. The XML mode is off by default when you start an MQL session. For example, to export a person named "guy" using an XML command along with an Export command, you can enter:
If you need to export several objects to XML format, using the XML command to turn on XML mode first can eliminate the need to re-enter the XML clause in each Export command as well as the possibility of an error if you forget. XML OutputThe XML export format typically generates a file 2 to 3 times larger than the standard export format. To conserve space, subelements are indented only if verbose mode is turned on. Indentation makes output more readable but is not required by an XML parser. Some XML viewers (like Internet Explorer 5.0) will generate the indentation as the file is parsed. The following example shows standard export output when you export a person named "guy" during an MQL session. While relatively compact, this output is not very intelligible to a user.
The next example shows XML output when you use the Export command, with XML mode turned on, to export a person named "guy" during a continuation of the same MQL session. While more intelligible to a user, this code creates a larger output file than the standard export format. MQL<3>xml on; MQL<4>verbose on; MQL<5>export person guy; <?xml version="1.0" encoding="ISO-8859-1" ?> <!-- (c)MatrixOne, Inc., 2000 --> <!DOCTYPE ematrix SYSTEM "ematrixml.dtd"> <ematrix> <creationProperties> <release>8.0.2.0</release> <datetime>2000-05-05T17:57:19Z</datetime> <event>export</event> <dtdInfo>&ematrixProductDtd;</dtdInfo> </creationProperties> <person id="0.1.31721.46453"> <adminProperties> <name>guy</name> </adminProperties> <fullName>Guy</fullName> <fullUser/> <businessAdministrator/> <systemAdministrator/> <applicationsOnly/> <passwordChangeRequired/> <access> <all/> </access> <adminAccess> <attributeDefAccess/> <typeAccess/> <relationshipDefAccess/> <formatAccess/> <personAccess/> <roleAccess/> <associationAccess/> <policyAccess/> <programAccess/> <formAccess/> <ruleAccess/> <siteAccess/> <storeAccess/> <vaultAccess/> <serverAccess/> <locationAccess/> </adminAccess> <queryList count="1"> <query> <name>.finder</name> <queryStatement> <vaultPattern>*</vaultPattern> <typePattern>GuyzViewTest</typePattern> <ownerPattern>*</ownerPattern> <namePattern>FileInDefaultFormat</namePattern> <revisionPattern>1</revisionPattern> </queryStatement> </query> </queryList> <password>de3IJEE/JIJJ.</password> <tableList count="1"> <table> <name>Test</name> <columnList count="1"> <column> <label>Description</label> <expression>description</expression> <usesBusinessObject/> <geometry> <xLocation>0.0</xLocation> <yLocation>0.0</yLocation> <width>70.0</width> <height>21.0</height> <minWidth>0.0</minWidth> <minHeight>0.0</minHeight> <autoWidth/> <autoHeight/> </geometry> <editable/> </column> </columnList> </table> </tableList> </person> </ematrix> |