| eBay SDK for .NET | |
| Attributes & Catalogs > Working with Attribute XSL Stylesheets | |
| < Back | Next > |
Working with Attribute XSL Stylesheets
This chapter is intended for developers who are creating applications that will render Item Specifics, return policies, and Pre-filled Item Information in a graphical user interface. If you are not familiar with these features, see Working with Attribute-Based Features. If you are using the Attributes Library, the information in this chapter will mostly only be of interest if you are implementing your own data-source provider classes. The sample data-source providers in the Attributes Library manage most of the following functionality for you.
The Item Specifics meta-data for any given category can change periodically as the needs of the eBay community change. The Item Specifics meta-data changes are not necessarily backward compatible. Therefore, to help you implement Item Specifics more quickly and easily and to make the meta-data changes more transparent, we provide two types of XSL stylesheets that you can use to render Item Specifics in a dynamic way rather than hard-coding the meta-data in your application. Both types of stylesheets work with data you present while a seller is creating an item to list (Sell Your Item). They do not work with data retrieved in other workflows (such as View Item or Search).
- The Item Specifics SYI XSL stylesheet is meant to be used for rendering characteristics returned from GetAttributesCSCall and GetProductSellingPagesCall, or classes that implement the IAttributesXmlProvider interface, if you are using the Attributes Library. A seller uses these characteristics to select Item Specifics to include in their listing. This stylesheet does not support functionality related to listing items, such as checking user input against validation rules. It also does not directly support rendering Item Specifics during the Revise Item, Re-list Item, or View Item flow. Retrieve this XSL styleseheet by using an implementation of the IAttributesXslProvider interface or GetAttributesXSLCall.
- The Product Finder XSL stylesheet is meant to be used for rendering characteristics returned from GetProductFinderCall. Once a you have selected characteristics, you can use them to build a query to pass in GetProductSearchResultsCall. This lets you search for a stock product, which you will use to pre-fill Item Specifics and other information in your listing.
Figure 20-1 Forms You Can Render by Using eBay's XSL Stylesheets
To implement Item Specifics and product finders the recommended way using the XSL stylesheets, you do not necessarily need to be able to design XSL stylesheets, but you should be able to apply an existing stylesheet to transform an XML document into an HTML form. This approach has been used successfully in desktop applications (such as eBay's TurboLister application) as well as Web-based clients. The eBay SDK for Java includes a sample called the Attributes Demo that you can use as a basis for your implementation.
In our experience, developers who use the XSL stylesheets are able to implement Item Specifics and Pre--filled Item Information much more quickly and easily than developers who do not.
Whenever the meta-data changes in a way that will not be backward compatible, we update the stylesheets to handle the changes. This solution offers a number of benefits:
- Faster application development: The XSL stylesheet contains most of the logic needed to handle the dependency relationships that have been defined for all the attributes. If you use the XSL stylesheet, you do not need to spend time learning about and writing code to handle all the dependencies yourself.
- Transparent handling of meta-data changes: Using the XSL solution helps your application handle changes to Item Specifics in a more transparent way. For example, if you hard-code Item Specifics data in your application and then eBay adds or changes dependencies between two attributes, your validation logic may no longer be correct and your listings may fail. However, if you design your application to retrieve the attribute meta-data and the XSL stylesheet every day and to use that data to render the Item Specifics, your application will always be up-to-date when changes are made to the meta-data on the eBay site.
- Familiar user interface controls: Sellers who are accustomed to the combination of user interface controls (drop-down lists and text boxes) that eBay uses should be able to easily understand how to work with Item Specifics in your application if you use similar controls. This does not mean your application needs to look exactly like the eBay user interface. You can override various aspects of the default look and feel provided by the XSL stylesheet.
We strongly recommend that you use the XSL stylesheets to render Item Specifics and product finders in a user interface. The Attributes Library includes a reference implementation of an XSL data-source provider that you can use directly or as a basis for your own customized implementation. To implement Item Specifics and product finders the recommended way, you do not need to be an expert with XSL and XSLT, but you should at least be able to apply an existing stylesheet to an XML document. This chapter provides basic instructions and examples that you can refer to as you implement your solution.
This chapter covers these topics:
Working with the Item Specifics XSL Stylesheet
| < Back | Next > |
| Attributes & Catalogs > Working with Attribute XSL Stylesheets | |
| © 2005–2007 eBay Inc. All rights reserved. | |