[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] xsl:fo in web browsers
Why not display XML using XSL Formatting Objects in Web browsers? I have this idea: Any browser with XSL, CSS and HTML 4.0 support can in principle transform the FO document instance into HTML with inline CSS. An example: The template below... <xsl:template match="title"> <fo:block background-color="yellow" border-style="solid" font-family="sans-serif" font-size="20pt" font-weight="bold"> <xsl:apply-templates/> </fo:block> </xsl:template> ...is displayed with the following HTML: <div style="background-color: yellow; border-style: solid; font-family: sans-serif; font-size: 20pt; font-weight: bold; ">Just testing an idea.</div> All you need is a mechanism that recognises the "fo" namespace in the result-tree and applies a new stylesheet to it. A simple example template for XSL:FO to HTML+CSS transformation: <xsl:template match="fo:block"> <div> <xsl:attribute name="style"> <xsl:for-each select="@*"> <xsl:value-of select="name()"/> <xsl:text>: </xsl:text> <xsl:value-of select="."/> <xsl:text>; </xsl:text> </xsl:for-each> </xsl:attribute> <xsl:apply-templates/> </div> </xsl:template> BTW: Have anyone made a complete stylesheet for XSL:FO to CSS or HTML+CSS tranformation? I can't see any reason not to put this feature into future Web browsers... -- Vidar Bronken Gundersen XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|