Exercise: Create a Canonical Item Extension XML File
Using the following example, create a canonical extension xml file for variant data called canonical-with-variants-datahub-extension.xml.
So what is different about this canonical extension XML file as opposed to ones you have created earlier?
- In the canonicalItems section, there is a new type called CanonicalCategory. When thinking about how this type is used, visualize how shoe might be the parent of a product family. Then consider how high heel and open toed strapless would be children of the parent shoe. In this way, Data Hub organizes products into categories, and their variants are linked to them.
- The CanonicalItems section has a type you have seen in the raw extension XML file, CanonicalVariant. There is also a CanonicalCategory in this section, which mirrors the RawCategory definition you have seen in the raw extension XML file.
- Using the following instructions, you create a canonical extension xml file for variant data. The XML definition is based on the one dimensional data file defined in the topic Addressing Variant Data (see Related Links). You can download an answer to this exercise from the Solution Book.
- Create an empty folder for working. Using the following example, create a canonical extension xml file called canonical-with-variants-datahub-extension.xml.
- The canonical items are defined in the regular way.
- After the canonical items are defined, define a new section called CanonicalVariants. A hint for the structure follows:
<type>CanonicalVariant</type> <description>Canonical representation of apparel variant</description> <status>ACTIVE</status> <attributes> <attribute> <name>identifier</name> <model> <localizable>false</localizable> <collection>false</collection> <type>String</type> <primaryKey>true</primaryKey> </model> </attribute>
- Add the canonical categories as shown in the following hint:
<item> <type>CanonicalCategory</type> <description>Canonical representation of apparel category</description> <status>ACTIVE</status> <attributes> <attribute> <name>identifier</name> <model> <localizable>false</localizable> <collection>false</collection> <type>String</type> <primaryKey>true</primaryKey> </model> </attribute>