Home
Monday, May 29, 2017
4:42:18 AM
Users online: 0   You are here >> Home > Programming

Forums | Programming Forums search
Forum FAQ
   
  1  
XLS XML to HTML
madrat007 
5/5/08 3:23:58 PM
Guru

NB: I made a typo in the Subject in which I cannot fix. It suppose to read "XSL XML to HTML" not "XLS XML to HTML".

Hello everyone,

I have an XML file with a whole bunch of URL's and Descriptions and I wish to use XSL to translate it to HTML a href. How would I go about it?

PS: I have searched Google, and it seems that examples shown are not for embedded tags as shown below:

XML file:
 
<Description>Blah blah blah <Link href=" http://www.atomicmpc.com.au"> <Item>Atomic MPC</Item></Link>
</Description>


HTML file (the output I want from that using XSL):
 
Blah blah blah <a href=" http://www.atomicmpc.com.au">Atomic MPC</a>


I tried to use:
 
<xsl:value-of select="Description"/> <a href="{Description/Link/@href}"><xsl:value-of select="Description/Link/Item"/></a>


Result:
 
Blah blah blah Atomic MPC <a href=" http://www.atomicmpc.com.au">Atomic MPC</a>
</Description>


The problem with that is that it printed Atomic MPC twice. Is there a way that I can print a partial or filter Description in XSLT?

Thanks in advanced for any input!


Edited by madrat007: 5/5/2008 04:07:55 PM

-----
:D

madrat007 
5/5/08 8:22:28 PM
Guru

Err, don't worry, I solved it by using "/text()" =_____=

-----
:D

LevonArmenian 
18/8/08 3:57:16 AM
Serf
I am sorry what means teg <description> and <Item>?

-----

Slace 
18/8/08 8:44:02 AM
Hero
Titan


Please avoid bumping old threads.

BTW - Welcome to the forums and please head on over to the FAQ - http://www.atomicmpc.com.au/forumfaq.asp

-----

Why can't a programmer tell the difference between Halloween and Christmas? 
Because OCT31 = DEC25


What's playing? http://www.last.fm/user/slace/

Mac Dude 
18/8/08 5:51:06 PM
Mod
SuperHero

Immortal


LevonArmenian feel free to ask this question in your own thread, this will get a better response...

-----
Watch Out!
Whatever hits the fan will not be distributed evenly

  1  
Forums | Programming