[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Is it possible to store XSLT code fragments as dat
On 20.06.2019 13:38, Costello, Roger L. costello@xxxxxxxxx wrote:
Hello XSLT experts! XSLT program can be written which inputs each expression and dynamically evaluates them. For example, I created several XPath expressions to query Book data; I stored the XPath expressions this way: evaluates the expression against the Book document: /> them is terrific!</xsl:variable> <xsl:sequence select="$result" /> </Query-Result> </xsl:for-each> </Results> </xsl:template>
then dynamically evaluate them. For example, I have a code fragment for converting the cost of a Book in U.S. Dollars (USD) to the cost in Great Britain Pounds (GBP):
group to provide an eval() function which would do exactly what I desire; but I checked the latest specification and it appears the eval() function wasn't accepted. Bummer.
Book data. I want the mapping operations expressed in a declarative manner so that Subject Matter Experts (SMEs) can review the mappings for correctness (e.g., upon reviewing the above code fragment the SME says: "Yes, that is the correct way to convert costs in USD to GBP"). Ideally, the mapping operations would be stored as data and then dynamically evaluated (after the SMEs have certified their correctness). What do you recommend? It appears that dynamic evaluation of XSLT code fragments is not possible, so what is the next best thing? In XPath 3.1 there is the transform function to run an XSLT 3 stylesheet from XPath 3 or XSLT 3 or XQuery 3 code, it allows you to use apply-templates or call-template or even run one of your user-defined functions. Saxon 9.8/9.9 support that even in the open-source HE edition.
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|