CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2001
    Location
    Wyoming
    Posts
    9

    Displaying an image using XSL

    I am trying to display an XML document in IE5.5 using XSLT. I am having a problem displaying a .jpg file specified in the XML file. The XML looks like this:


    <img src="C:\BrassDev\GUI\Pier\Working\Images\FootingBeamShear.jpg" width="447" height="235">


    My XSL is as follows:





    Except the spaces after , this is displayed in IE5.5 as:



    How can I get the image displayed instead of the text? If I copy this out of the browser and insert it in an HTML document, or if I remove the spaces above, it displays properly. What am I missing? Thanks for your help.


  2. #2
    Join Date
    Jan 2002
    Posts
    2

    Re: Displaying an image using XSL

    Instead of value-of try copy-of.


  3. #3
    Join Date
    Apr 2000
    Location
    Dallas, TX
    Posts
    173

    Re: Displaying an image using XSL

    Another thing you could try:


    &ltIMAGE_FILE
    src="C:\BrassDev...and so on....jpg"
    width="447"
    height="235"/>

    <p>
    <img>
    <xsl:attribute name="src"><xsl:value-of select="IMAGE_FILE/@src" />
    <xsl:attribute name="width"><xsl:value-of select="IMAGE_FILE/@width" />
    <xsl:attribute name="height"><xsl:value-of select="IMAGE_FILE/@height" />
    </img>
    </p>





    Preston Park
    CTT+, MCT, MCSD
    http://www.prestonpark.com/

  4. #4
    Join Date
    Mar 2001
    Location
    Wyoming
    Posts
    9

    Re: Displaying an image using XSL

    That worked great. Thanks for your help.


  5. #5
    Join Date
    Mar 2001
    Location
    Wyoming
    Posts
    9

    Re: Displaying an image using XSL

    I get the same problem with copy-of as I had with value-of. Thanks for your time.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured