[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: modify output document elements
On Wed, Mar 04, 2020 at 05:49:09PM -0000, Kammering, Raimund raimund.kammering@xxxxxxx scripsit: > I have a stylesheet which creates a HTML output document dynamically based on the incoming XML file. [snip] > Now I would like to modify the style of the details_table depending on the outcome of the test within the for-each loop. Since the table element has already been created, I do not know how one could do this without changing the overall logic. Is there a way to access the elements of the created HTML DOM tree from within the stylesheet? Or am I hunting in the wrong direction?! Stick the first pass -- your existing HTML document -- in a variable. Then run that variable through apply-templates with a distinct mode set on the templates to make the change you want. Remember to set up an identity template (XSLT 2) or mode definition (XSLT 3) for that mode. This really is pretty simple and efficient, even if it seems weird at first. And it has the advantage of keeping the two different sets of rules -- create the HTML table, set details_table -- distinct in the code. -- Graydon
|
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
|