隱藏目錄

XML File Structure and Example

Notes about the XML file structure:

  • The system trims leading spaces in attribute names.
  • The system sometimes trims leading spaces in attribute values.
  • Use lower case for all elements and attribute names.
  • Use of an unknown element or attribute name causes the import to fail.

The following example describes most aspects of the XML file structure.

<?xml version="1.0"?>
<xml>
  <transactions>
    <transaction 
      date="1196854268"
      type="wf_import_document_attributes"
      vaultname="2008 file vault">
      <document 
        aliasset=""
        pdmweid="0"
        idattribute="Number"
        id="89-NOAO-4200-1236"
        idcfgname="">
        <configuration name="">
          <attribute name="Cost" value="0.44"/>
          <attribute name="ArticleID" value="A-012-BB"/>
        </configuration>
      </document>
    </transaction>
  </transactions> 
</xml>

where:

XML Element XML Attribute Description
<?XML version="1.0"?>   The file must start with this element.
<XML>   This element wraps the transactions element.
<transactions>   The file contains only one transactions element.
<transaction ?gt;   The file can contain multiple transaction elements.
  date The number of seconds elapsed since 12:00 AM January 1st 1970. Must be an integer greater than 0.
type Indicates that the transaction contains data to import into files or items in the vault.
  Vaultname Name of the vault this transaction relates to. The import rule processes transactions with a matching vault name.
  Aliasset The alias set to use to look up child attribute nodes. The attribute names in the XML file are matched with the alias-mapped variable.

For example, an alias set containing the variable X2Number with an attribute NR in the XML file is configured to match the data card variable Number.

An empty value matches the data card variables with the attribute names in the XML file.

<document ?gt;   Contains criteria for matching the import values with a file or item in the vault. It matches the unique internal ID of a file or item, or a variable value.
  Pdmweid Matches the transaction with the internal DocumentID from the Documents table of a file or item in the vault database.

When you use this attribute, [id], [idattribute], and [idcfgname] are ignored. To use another matching technique, set the value to 0 or omit this attribute.

  Idattribute The data card variable or alias to use to match a file or item in the vault.
  Id Variable value to use when searching for files or items. Searches for the value using the variable name, idattribute, and the optional configuration, Idcfgname, in the VariableValue database table .

If multiple files or items match, values are imported for all but are written only to those that pass the import transition action.

  Idcfgname Name of the configuration, if any, to which to match the variable value. If this attribute has no value, all configurations of a file are considered for matching.
<configuration ?gt; name Configuration of the file data card to update with the attribute values. If this attribute has no value, all configurations are updated.

Create multiple configuration elements to import different values to different configurations.

<attribute ?gt; name Name of the data card variable to update, in the form VariableAlias.Alias or Variable.VariableName.
  value Value to use when setting the specified variable. Cannot exceed 1024 characters.


提供對此主題的意見反應

SOLIDWORKS 歡迎您提供有關於文件呈現方式、正確性、及完整性的意見反應。請使用下方的表格直接將您對此主題的意見與建議傳送給我們的文件團隊。文件團隊並無法回答關於技術支援的問題。按一下此處來獲得關於技術支援的資訊

* 必要的

 
*電子郵件:  
主旨:   說明主題的意見反應
頁面:   XML File Structure and Example
*意見:  
*   我承認已閱讀且僅此接受隱私權政策,Dassault Systèmes 將遵循此政策之規定使用我的個人資料

列印主題

選擇要列印的內容範圍:

x

偵測到您使用的瀏覽器版本是舊於 Internet Explorer 7。要獲得最佳的顯示,建議您升級瀏覽器到 Internet Explorer 7 或更新的版本。

 不要再次顯示此訊息
x

Web 式說明內容版本:SOLIDWORKS PDM 2014 SP05

要從 SOLIDWORKS 中停用 Web 式的說明並改用本機說明,請按一下說明 > 使用 SOLIDWORKS Web 式說明

要報告在 Web 式說明介面及搜尋中遇到的問題,請聯絡您當地的技術支援代表。要針對個別說明主題提供意見反應,請使用個別主題頁面中的「提供對此主題的意見反應」連結。