Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Frames in XML

 
adrian mills
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I want to use frames in my XML.Actually the frame content is set in a request attribute.
I want to display a frame in an XML using XSLT.Has anyone done something like this.

I have a report which is displayed in XML format using a XSLT.
I want to add a image in a frame at the top of this XML file.
How can I add a frame to an XSLT.
The frame will contain a map object.The url of the map object will be set in a request attribute.

Can anyone give me a suggestion as to how to include a frame in an XSLT.

Thanks in advance...
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't use "frames" in XML. That's purely an HTML concept.
In other words, you first need to figure out what kind of HTML files you want to generate,and then figure out what kind of XSLT stylesheets you need to transform your XML document into those HTML files.
 
adrian mills
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK how can I use an image whose location is a URL on the web?
This image is dynamically fetched from the web..
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As you normally would in HTML (I'm assuming this is the destination format since you mention frames) - with an <img /> tag where the src attribute is the URL of that image.
 
adrian mills
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
My XML is something like this

<MapImage>
<Source>url</Source>
</MapImage>


I am using the following XSL
<img width="350" height="350">
<xsl:attribute name="src"><xsl:value-of select="Source"/></xsl:attribute>
</img>


But the image doesnot get displayed.
When I do a view source
I get <img height="350" width="350" src=""/>
The url is not replaced can some one tell me where I am going wrong?

Thanks a lot to all who have replied till now.
Hope to get u r cooperation ..
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try,.

<img width="350" height="350">
<xsl:attribute name="src"><xsl:value-of select="//*/Source"/></xsl:attribute>
</img>
or
<img width="350" height="350">
<xsl:attribute name="src"><xsl:value-of select="MapImage/Source"/></xsl:attribute>
</img>
or
<img width="350" height="350">
<xsl:attribute name="src"><xsl:value-of select="./Source"/></xsl:attribute>
</img>

its all depends on how you call the template and from what node.

Check this xpath/xsl tutorial from http://www.w3cshools.com , pretty good.
 
adrian mills
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Balaji the first option has worked.I have not yet figured why?
I will try as of now I had to get it started working.
Thanks a lot for your help.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic