Every business has its own set of unique business rules, which gives its competitive edge and allows it to comply with regulations. For example, you may have a business rule that gives a $10 discount to repeat customers who purchased over $50 worth of products or your ground shipping method in the United States should never ship to Hawaii.
Revindex Storefront employs powerful XSL 2.0 transform to apply dynamic business rules and calculate the resulting values. XSL (Extensible Stylesheet Language) is the industry standard XML transform language and can be found in different DNN core modules such as the Reports, XML, News Feed module and throughout the Internet. Although not necessary to operate the Revindex Storefront, understanding the basics of XSL will open endless possibility to describe your most complicated business rules needed to run your business.
To learn XSL, you must first understand XML (Extensible Markup Language). XML is very similar to HTML, the language used to describe Web pages. XML is made up of elements contained in open and close right-angle brackets. e.g. <element attribute="Some value">My value</element>
Computer is able to interpret the tags into useful value. XML language has a few simple rules:
The structure of XSL looks like XML. It uses open and close right-angle brackets and follows the same syntax as XML. In addition, it has built-in special purpose elements and functions that can manipulate XML data. The following example shows a sample XML input with a $75 sales order. The XSL business rule has an “if” condition that prints the $10 discount if the amount is greater than $50.
To write XSL, start with how you expect the XML output to be. In the previous example, you would write the <out> and <discountAmount> open and close tags as you see them. Add to the header and footer the standard <xsl:transform> and <xsl:template> open and close tags respectively. These tags tell the computer that you're writing XSL and match up with start of the XML input data. Finally, add the <xsl:if> condition and check for the $50 amount. Here, the "in/salesOrder/amount" is used to navigate and select the XML input data.
The common XSL special purpose elements for transforming XML data are listed below.
The XSL expressions can contain these operators.
XSL also provides hundreds of functions to manipulate data, such as rounding a decimal number, etc. The common functions are listed below. To see a full list of functions, please see https://www.w3schools.com/xml/xsl_functions.asp
To learn more about XML, please see http://www.w3schools.com/xml/default.asp and to learn more about XSL, please see http://www.w3schools.com/xsl/. You'll also find more help and example of XSL in the Revindex Forum and Support pages.
Powered by Revindex Wiki