473,513 Members | 4,753 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

external url link from an xml document and transforming it...

6 New Member
Hi,
I am really new to xml and this may sound dumb, but could someone please help me out by providing the code to linking to an external url from an xml file?

Right now I have the xml reading:
...<links><url_text>view larger</url_text> <url>www.domain.com/largerimages/sample.html</url>
</links>...

And I have the xslt document reading:

...<td><a>
<xsl:attribute name="HREF">http://<xsl:value-of select="url"/></xsl:attribute>
<xsl:value-of select="url_text"/></a></td>...

I have read that the following, above the <head> tag should read:
<xsl:template match="links"> but when I put links in the quotations, the whole file seems to disappear...

Thanks for anyone who can help...
Jan 2 '07 #1
2 2760
aparna8
4 New Member
Hi
If you are asking for xml to html conversion,then this might help you.

Expand|Select|Wrap|Line Numbers
  1.   <xsl:template match="/">
  2.     <xsl:for-each select="links">
  3.      <td>      
  4.       <xsl:variable name="url" >
  5.        <xsl:value-of select="url" />
  6.       </xsl:variable>     
  7.       <a href="http://{$url}"><xsl:value-of select="url_text" /></a>
  8.     </td>
  9.     </xsl:for-each>
  10. </xsl:template>
  11.  
Jan 3 '07 #2
streammalvern
6 New Member
Thank you! That worked perfectly!!!! I was missing a couple of things from my code. Thanks again!!!!

Hi
If you are asking for xml to html conversion,then this might help you.

Expand|Select|Wrap|Line Numbers
  1.   <xsl:template match="/">
  2.     <xsl:for-each select="links">
  3.      <td>      
  4.       <xsl:variable name="url" >
  5.        <xsl:value-of select="url" />
  6.       </xsl:variable>     
  7.       <a href="http://{$url}"><xsl:value-of select="url_text" /></a>
  8.     </td>
  9.     </xsl:for-each>
  10. </xsl:template>
  11.  
Jan 3 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
1788
by: Mirjana Rakuljic | last post by:
Hi, I need help with transforming XML document. I generate xml document from query using Oracle XSU (DBMS_XMLQUERY) and the document I get is like this: <?xml version = '1.0' encoding =...
6
3411
by: Christopher Benson-Manica | last post by:
Just FMI, if an external stylesheet is linked to a page (with <link>), will subsequent <style> tags override the values in the external stylesheet? -- Christopher Benson-Manica | I *should*...
12
3076
by: relaxedrob | last post by:
Hi All! I have a page with with the following style information: <link rel="stylesheet" type="text/css" href="/eEmployment/eTech.css" /> <style type="text/css"> DIV.Application {...
10
1905
by: Pasquale | last post by:
hello wverybody... i've got a terrible matter with JS my browsers (either IE and NN) load the external scripts uncorrectly...they load the files from the half part of them and not from the...
4
2006
by: Cathie | last post by:
Hi All, I am trying to get my style sheet to work. It works fine in IE but I can't get it to work in .net. Below is the function I use for transforming, where advancedOptionsFile is the path...
1
8101
by: pseudomagazine | last post by:
Little problem: Using the document.write() function and an enormous string, I have managed to create self-generated pages with functions calling code located in external scripts. The code that...
0
2008
by: =?Utf-8?B?c25naWxi?= | last post by:
I am having 3 issues with the WebBrowser control which may all be related. The HTML for the page is the standard Weather Magnet from weather.com. The actual HTML is at the bottom of this page. ...
5
3680
by: althafexcel | last post by:
hi everyone Im trying to include an external js in my aspx page under the head tag, it doesn't load or it displays an object expected error whenver the function from the .js is called. Actually...
3
2568
by: tjtryutyu | last post by:
I know very little javascript. Nonetheless, I found some example code that opens links into a new window if they contain "external" on the "rel attribute. For example: <a href="http:example.com"...
0
7254
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7373
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7432
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7094
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5677
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3230
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1585
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
796
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.