Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 11th, 2005, 03:36 PM
Authorized User
 
Join Date: Aug 2004
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to humour
Default XSLT and images


I want to use XSLT to transform XML into HTML and have been successfully doing so to grab textual data and do suth things as bold sentences and format titles and headings.

What I want is some XSLT to help render the HTML image tag. I want an XML file of contacts in my company and a clickable graphic image that represents in graphic form their email address.

My xml looks something like this:

<content_home>
        <content>contact</content>
        <title>Personnel</title>
        <paragraph>
        <text format="nbold" endLine="false">Johns
                   Email</text>
        </paragraph>
        <paragraph>
            <image>johnemail.gif</image>
        </paragraph>
</content_home>

My XSLT file is as follows:
<xsl:for-each select="key('content', 'contact')">
     <h2><xsl:value-of select="title"></xsl:value-of></h2>
         <xsl:for-each select="paragraph">
        <xsl:choose>
        <xsl:when test="text[@format='bold'] and text[@endLine='false']">
            <b><xsl:value-of select="text"></xsl:value-of></b>
        </xsl:when>
         <xsl:when test="image">
                    <xsl:value-of select="image"></xsl:value-of> >
         </xsl:when>
<xsl:otherwise>
            <b><xsl:value-of select="text"></xsl:value-of></b><br /><br />
        </xsl:otherwise>
        </xsl:choose>
    </xsl:for-each>
</xsl:for-each>

 
Old June 22nd, 2005, 01:37 AM
Authorized User
 
Join Date: May 2005
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to meetnaveen4u
Default

I think we should call a javascript function for displaying clickable graphic image. or u can do like this.
<xsl:text disable-output-escaping="yes">&lt;a href='javascript:callEmail("</xsl:text>
<xsl:value-of select="emailid"/>"<xsl:text disable-output-escaping="yes">");'&gt;</xsl:text>
<img src="/images/email.gif" border="0"/>
<xsl:text disable-output-escaping="yes">&lt;/a&gt;</xsl:text>


Thanks
Naveen.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Load Images from and Save Images to a Database cyndie VB.NET 2 August 17th, 2008 06:42 AM
Rendering base64 images from XML in XSLT jilly XSLT 7 June 29th, 2007 07:56 AM
dynamic xslt -> xslt creation namespace problem jkmyoung XSLT 2 July 15th, 2006 12:42 AM
Rendering images with XSLT trufla XSLT 1 May 21st, 2006 11:37 AM
images with xslt chris davies XSLT 2 December 9th, 2005 05:36 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.