Aras Innovator Platform

Using $value, @keyed_name, @type in a select attribute

The following example uses the property xp-document of type item where the data_source is Document. The Document ItemType has the properties name and description. In order to add name and description to the output of an AML request, you have to use $value to get access to the name and description properties of xp-document.

Query:

<Item type="Part" select="xp-document($value(name,description))" />

Return:

   <Item type="Part" id="%Part.ID%">

<xp-document keyed_name="xp_doc_keyed_name" type="Document">
                                            

              <Item type="Document" …>

                    <name>...</name>
                                            

                    <description>...</description>
                                            

              </Item>
                                            

        </xp-document>
                                            

</Item>

If the names of properties of xp-document are specified without using $value, a null value is returned as shown here:

Query:

<Item type="Part" select="xp-document(@defined_as, name, description)" />

Return:

<Item type="Part" id="%Part.ID%">

<xp-document keyed_name="xp_doc_keyed_name" type="Document" defined_as="..." is_null="0"/>

</Item>

Other Examples:

Query:

<Item type="Part" select="xp-document($value)" />

Return:

<Item type="Part" id="%Part.ID%" …>

<xp-document keyed_name="xp_doc_keyed_name" type="Document">%Document.ID%</xp-document>
                                            

</Item>

Query:

<Item type="Part" select="xp-document($value(*))" />

Return:

<Item type="Part" id="%Part.ID%" …>

    <xp-document keyed_name="xp_doc_keyed_name" type="Document">
                                            

      <Item type="Document" …>

        ... all document STANDARD properties ...

      </Item>
                                            

    </xp-document>
                                            

</Item>

Query:

<Item type="Part" select="xp-document(@defined_as, $value(*, xp-*))" />

Return:

<Item type="Part" id="%Part.ID%" …>

    <xp-document defined_as="class" keyed_name="xp_doc_keyed_name" type="Document">

      <Item type="Document" …>

        ... all document STANDARD properties ...

        ... all document xProperties ...

      </Item>
                                            

    </xp-document>
                                            

</Item>