Getting Additional xProperty Information

Every xProperty has a complex structure that includes the following information:

  • A value

  • A definition

  • Private permission

  • Flags

  1. Note: Due to performance considerations, the default server only returns the xProperty value in the AML response.

You can extend the syntax of the @select attribute to get additional information about the xProperties defined for an item by using the following attributes:

  • $value

  • @permission_id

  • @explicit

  • @defined_as

The following example gets all Parts contained in the database. It includes the item_number and all the defined xProperties for each returned item in the response:

<AML>

<Item type=Part" action="get" select="item_number, xp-*(@defined_as)"></Item>

</AML>

 

 

<Result>

    <Item type="Part" typeId="3B135425…" id="0FA8ED…">

        <item_number>999-888</item_number>

        <xp-length defined_as="class" is_null="0"/>

    </Item>

    <Item type="Part" typeId="4B135425…" id="1FA8ED…">

        <item_number>999-777</item_number>

        <xp-length defined_as="class" is_null="0"/>

        <xp-width defined_as="class|explicit" is_null="0"/>

        <xp-height defined_as="explicit" is_null="0"/>

    </Item>

</Result>

 

The following example gets additional information about the defined xProperty (permission_id, explicit):

<Item type="Part" action="get" select="item_number, xp-cost($value, @permission_id, @explicit), xp-length($value, @permission_id, @explicit)">

</Item>

 

<Result>

    <Item type="Part" typeId="3B135425…" id="0FA8ED…">

        <item_number>999-888</item_number>

        <xp-cost explicit="1">10</xp-cost>

        <xp-length permission_id="123..." explicit="0" />10<xp-length>

    </Item>

</Result>


The following example gets additional information about the defined xProperty (is_defined):

<Item type="Part" action="get"

    select="item_number, xp-*($value, @defined_as)">

</Item>

 

<Result>

    <Item type="Part" typeId="3B135425…" id="0FA8ED…">

        <item_number>999-888</item_number>

        <xp-height defined_as="class|explicit"/>10<xp-height>

        <xp-cost defined_as="explicit">10</xp-cost>

        <xp-length defined_as="class"/>10<xp-length>

    </Item>

</Result>