XML File Generation from Within Salesforce B2C Commerce

Standard exports use the B2C Commerce-defined XML schema files. B2C Commerce provides a set of schema files that can be used to create the most common export files.

You can also import product and content images in a .zip file and export Analytics data in xls format

The typical B2C Commerce implementation includes generating XML documents for data transfer to a back-end system.

To create an XML document from data in the system, the standard practice is to create code that iterates over data in B2C Commerce and outputs this data to an XML file.

If you must write custom code, think about how many objects or how much XML to read into memory, how many objects to read before committing the transaction, and other constraints that are taken care of automatically with the standard feeds.

For example, if you are post-processing an order export into a proprietary XML format for a backend system, consider whether it makes sense to use a B2C Commerce script. It can be faster and more efficient to transform a file using a pure .NET or a Java platform with a large amount of memory allocated to the processing.

However, if you want to use a B2C Commerce script, use the XMLStreamReader and getXMLObject() method to get a specific order within the export file. Then use nextTag() to iterate through elements in the order and XMLStreamWriter to write out the order to the new file.

It isn't a good idea to read an entire export file or entire order into memory before writing it out using the XMLStreamWriter, as it can cause an out of memory error.

X Privacy Update: We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used. By continuing to use this site you are giving us your consent to do this. Privacy Policy.