Translating Elements and Types with No Strict Type Definitions

The translator creates some ATML TD elements and types as equivalent TestStand data types.

The translator uses the following guidelines to create a PropertyObject variable in TestStand for every element or type in the TD instance document with the limitations specified above. The created variable maintains the parent-child relationship and stores the attributes specified for each element.

  • If an element contains child elements and attributes, the translator creates a PropertyObject container, with the same name as the element, to contain all the PropertyObject created for the child elements. If an element contains two or more child elements with the same name, the translator appends _1, _2, and so on to the names.
  • Incremental Update —If an element contains child elements, the translator updates the PropertyObject containers created for each child element according to the following rules:
    • If the child element includes an ID attribute, the translator uses the ID to uniquely identify the child element. If the element does not define an ID attribute, the translator uses all attributes to uniquely identify the child element.
    • If the translator locates a PropertyObject for the child element in the translated sequence file, the translator recursively updates the child element. If the translator cannot locate a PropertyObject for the child element, the translator creates a new PropertyObject for the child element and records the change in the log file.
    • If additional child elements exist in the translated sequence file after the translator completes adding or updating all child elements from the source TD instance document, the translator deletes the extra elements from the sequence file and records the change in the log file.
  • If an element contains only attributes, the translator creates a PropertyObject container named ATMLAttributes under the PropertyObject created for the element to contain all the attributes as strings. The translator sets the name of the string variable to the name of the attribute and sets the value of the string to the value of the attribute.
    • Incremental Update - If an element contains attributes the ATMLAttributes container of a PropertyObject created, the translator updates the element according to the attributes defined for the element.
  • If an element is a text element with no attributes, the translator creates a string variable with the same name as the element. The translator sets the value of the string to the value of the element.
    • Incremental Update - If an XML element is a text element with no attributes, the translator updates the value of the string variable with the same name as the element.

If the translator encounters an element or attribute with the name Value in the TD instance document, the translator creates a corresponding TestStand variable named NI_ATMLValue because Value is a reserved keyword in TestStand.