[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: How to 'execute' a table without manually converti
On Sun, 2023-02-19 at 18:21 +0000, Roger L Costello costello@xxxxxxxxx Alas, as you > know, Microsoft Word tables cannot be embedded into XSLT programs. Well, since these days they are encoded in XML in the Word files, they actually can. In practice nested maps or an xsl:choose or an element structure or functions or named templates or a combination, whatever seems to fit in best with the rest of the stylesheet probably. > I remember Liam saying (paraphrasing): "Any program longer than 6 > lines has bugs." I think i said that i had never seen a program longer than 6 lines that didn't have a bug. > How do *you* translate tables into code? Do you have a way that is > 100% guaranteed to faithfully/accurately encode the table? For a large decision table, i'd indeed want some static representation of it. The XPath fragments in your example suggest the use of maps (which preserve node identity), or possibly a map with a function for each row, so that the XPath expressions are contained in the body of the function and evaluated on demand. One way might look like this: <xsl:variable name="WidthPrecisionTable" as="map(*)" select=" map { '* *' : function($arg as node()) as item()* { $arg/following-sibling::argument[2] }, '* nonps' : function($arg as node()) as item()* { $arg/following-sibling::argument[1] } . . . } "/> liam -- Liam Quin,B https://www.delightfulcomputing.com/ Available for XML/Document/Information Architecture/XSLT/ XSL/XQuery/Web/Text Processing/A11Y training, work & consulting. Barefoot Web-slave, antique illustrations: B http://www.fromoldbooks.org
|
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
|