Develop > Business logic layer > Work with the data service layer > Create a query


Generate the XPath key using the wcs_xpathkey utility

The XPath key generator command-line utility takes an XPath expression as input and generates an XPath key. This key is used to locate the XPATH_TO_SQL_STATEMENT template in the query template file.

The name of the XPath to SQL template is the same as the key for two-step queries. For single-step queries, it is a combination of the XPath key and the name of the access profile. To generate the XPath key:


Procedure

  1. Open a command line prompt and navigate to WCDE_INSTALL\bin.

  2. Run the following command, where MyXPath is your XPath expression:

    wcs_xpathkey MyXPath
    

    For example:

    wcs_xpathkey /CatalogEntry[(@catalogEntryTypeCode='ProductBean' or @catalogEntryTypeCode='ItemBean') and ParentCatalogGroupIdentifier[ExternalIdentifier[GroupIdentifier='Coffee Table']]]
    

    The output from this command would be:

    /CatalogEntry[(@catalogEntryTypeCode=) and ParentCatalogGroupIdentifier[ExternalIdentifier[GroupIdentifier=]]]
    


Related concepts

Data service layer

Access profiles

Query template file

Related reference

SQL parameters

Query template file tags

Data service layer naming conventions

WebSphere Commerce extended XPath notation


+

Search Tips   |   Advanced Search