eBay SDK for .NET
Attributes & Catalogs > Retrieving Attribute and Product Meta-Data > Retrieving the Item Specifics SYI XSL Stylesheet 
 



< Back Next >

Retrieving the Item Specifics SYI XSL Stylesheet

The eBay Platform provides the Item Specifics SYI XSL stylesheet to give developers a dynamic and scalable way to render Item Specifics meta-data in an application. The stylesheet is updated as necessary when the attribute meta-data changes. It can render both standard and pre-filled Item Specifics.

Use GetAttributesXSLCall to retrieve the latest version of the stylesheet. You should not hard-code the stylesheet in your application. The Attributes Library includes a sample data-source provider class called AttributesXslDownloader, which executes GetAttributesCSCall and handles other common functionality that you need when working with the Item Specifics stylesheet. This class implements the IAttributesXslProvider interface and caches the data in memory. If you want to use the Attributes Library, you can use the sample downloader class or you can create your own implementation of the IAttributesXslProvider interface that stores the data in a different way (such as in a database).

This section describes the following process:

Prerequisites

Step 1:  Indicate the Stylesheet to Return

Step 2:  Make the API Call

Step 3:  Decode the Item Specifics SYI XSL Stylesheet

Step 4:  Store the Stylesheet for Future Use

Step 5:  Maintain the Item Specifics SYI XSL Stylesheet

Step 6:  Next Steps

Prerequisites

There are no special prerequisites when executing GetAttributesXSLCall or a data-source provider class that implements IAttributesXslProvider. Of course, in order for the data to be useful, you need to also execute GetAttributesCSCall or GetProductSellingPagesCall or a class that implements IAttributesXmlProvider to retrieve the XML that you will transform.

Step 1: Indicate the Stylesheet to Return

The first time you execute GetAttributesXSLCall, you should retrieve the latest Item Specifics SYI XSL stylesheet, and parse the response to determine the current version of the file. If you are using the Attributes Library, the same principle applies when working with data-source provider classes that implement IAttributesXslProvider, such as the AttributesXslDownloader class.

In subsequent calls, you can use the DetailLevel property to retrieve only the version of the file to check whether the version has changed. If it has, get the latest stylesheet. To retrieve a particular version of the file, specify values in the XSLFileName and XSLFileVersion fields. To retrieve the latest version, leave the XSLFileVersion field blank.

Currently, only XSL file is returned from this call. Whether or not you need to specify FileName depends on your application's design. In the future, this call might return more XSL files. If you design your application with the assumption that only one file will be returned, you may need to update your code immediately if the call starts retrieving other XSL files. If you specify FileName, your application will continue to only retrieve the desired file, and you can update your code at your convenience to handle other kinds of XSL files.

See GetAttributesXSL for information data filters like XSLFileName, XSLFileVersion, and DetailLevel.

You can expect the meta-data to be updated at least once or twice a month, but it may sometimes be updated more frequently than this interval. Use GetAttributesXSLCall or a data-source provider like the AttributesXslDownloader class to retrieve the XSL whenever it changes.

Thes properties are also summarized in GetAttributesXSL.

When you use the Attributes Library to retrieve the Item Specifics SYI XSL stylesheet for an eBay site, you create an instance of the AttributesMaster class and configure it to use a data-source provider, such as the AttributesXslDownloader class. See the AttributesDemo sample for an example of how to do this.

Step 2: Make the API Call

Making the API call with the Attributes Library entails invoking the AttributesXslDownloader.downloadXsl( )AttributesXslDownloader.DownloadXsl( ) method, which retrieves the stylesheet(s) from eBay and caches them in memory. If you create your own data-source provider class that implements the IAttributesXslProvider interface, your class would call the GetAttributesXSL( ) method defined on the GetAttributesXSLCall class to retrieve the XSL stylesheet(s).

See the AttributesDemo sample for an example of how to use the AttributesMaster class and an XSL data-source provider.

GetAttributesXSLCall returns a string that specifies the Item Specifics SYI XSL stylesheet for the site to which you sent the request.

See GetAttributesXSL for information about specific fields that are returned. See the generated library reference documentation for GetAttributesXSLCall and AttributesXslDownloader for additional fields and methods that you can use to access and manipulate the stylesheet data.

Step 3: Decode the Item Specifics SYI XSL Stylesheet

An XSL stylesheet that is returned in the XSLFile.FileContent property is initially formatted as a MIME base-64-encoded ASCII string. You need to decode the string before you can use the XSL stylesheet. When you use the GetAttributesXSL( ) method on GetAttributesXSLCall, it decodes the string for you.

Step 4: Store the Stylesheet for Future Use

Store the XSL stylesheet (e.g., as a string in a database or as a flat file) for future use.

When a user is creating a listing that will include standard or pre-filled Item Specifics, apply the stylesheet to render the characteristics returned from GetAttributesCSCall GetProductSellingPagesCall, or a data-source provider class that implements the IAttributesXmlProvider interface in your application's user interface. Once the user has selected the attributes to include in their listing and submits the page, the JavaScript that is included in the stylesheet will generate post data that you can use to determine the attributes and values that the user has selected.

For information about how to apply the Item Specifics XSL stylesheet and how to parse the post data, see Working with Attribute XSL Stylesheets.

Step 5: Maintain the Item Specifics SYI XSL Stylesheet

At the beginning of each day that you will render the Item Specifics XML, retrieve the latest stylesheet. Use the XSLFileVersion in combination with the XSLFileName property to retrieve a particular version of an XSL stylesheet.

Step 6: Next Steps

Once you have retrieved the Item Specifics SYI stylesheet, you use it to render Item Specifics or return policy options for a particular category the seller is listing in. See Working with the Item Specifics XSL Stylesheet. You do this when a seller wants to list the standard way with Item Specifics or list with Pre-filled Item Information. See Listing an Item with Attribute and/or Product Data.


< Back Next >


 
Attributes & Catalogs > Retrieving Attribute and Product Meta-Data > Retrieving the Item Specifics SYI XSL Stylesheet 
© 2005–2007 eBay Inc. All rights reserved.