Using XPath queries to XML views tutorial
Examples Using XPath queries with options.

## XML serialization text

You can get xml serialization text of the selected entity by the query

    XPATH [__view "xmlview_name"] /xpath_query

e.g. for given 'cat' xml view the full serialization text can be received by the query

    XPATH [__view "cat"] /*

or

    XPATH [__view "cat"] /category

see xp_v_2_sample

## Select all columns instead of a serialization text

You can select all columns of the selected entity instead of its serialization text by using __* option:

    XPATH [__* __view "cat"] //product

    ProductID ProductName SupplierID CategoryID QuantityPerUnit UnitPrice UnitsInStock UnitsOnOrder ReorderLevel Discontinued
    INTEGER    VARCHAR     INTEGER     INTEGER     VARCHAR  DOUBLE PRECISION  SMALLINT    SMALLINT    SMALLINT    SMALLINT
    ______________________________________________________________________________________________________________________

     1         Chai           1          1     10 boxes x 20bags     8          39          0          10            0
     2         Chang          1          1     24 - 12 oz bottles   19          17         40          25            0
     3      Aniseed Syrup     1          2     12 - 550 ml bottles  10          13         70          25            0
    .  .  .  .  .  .

This is only valid when __view is specified and the result set is homogeneous.

## Select the key instead of the serialization text

You can select the key of the selected entities instead of the serialization text by using __key option:

    XPATH [__key __view "cat"] /*;

    CategoryID
    INTEGER NOT NULL
    _______________________________________________________________________________

       1
       2
       3
       4
       5
       6
       7
       8