[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: modify output document elements

Subject: Re: modify output document elements
From: "Graydon graydon@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 4 Mar 2020 18:01:05 -0000
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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.