Solved

Need to link in an XML/XSL page

Posted on 2014-11-02
4
119 Views
Last Modified: 2014-11-03
The page in question is  here:wtc.

The title of each article is currently just a static title. I need to make it a link.

Here is the XML that provids the title:

<titles><title><style face="normal" font="default" size="100%">Frequent binge drinking five to six years after exposure to 9/11: Findings from the World Trade Center Health Registry</style></title></titles>

Open in new window


and here is the XSLT that transforms it for display:

 
<h3><xsl:value-of select="./titles/title/style"/></h3>

Open in new window


Now, I need to make that title a link by bringing together two separate pieces. One, this url:

http://www.ncbi.nlm.nih.gov/pubmed/

and the ID number from within the specific record's XML to tag on to the end of the URL. Example:

24018914 to make the clickable link as follows:

http://www.ncbi.nlm.nih.gov/pubmed/24018914

The ID number that needs to be tagged onto the URL comes from the XML as follows:

<accession-num><style face="normal" font="default" size="100%">24831753</style></accession-num> (ignore the style. There is nothing I can do about that)

I am attaching a txt record that have a FULL portion of one sample XML record. If someone can please show me the code to make the link work, I would greatly appreciate it.
0
Comment
Question by:WebDevMarty
  • 3
4 Comments
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 40418248
<h3><a href="http://www.ncbi.nlm.nih.gov/pubmed/{normalize-space(accession-num/style)}"><xsl:value-of select="./titles/title/style"/></a></h3>
0
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 500 total points
ID: 40418257
From your source it seems the style serves nothing
so you could
<h3><a href="http://www.ncbi.nlm.nih.gov/pubmed/{normalize-space(accession-num)}"><xsl:value-of select="normalize-space(titles/title)"/></a></h3>

have not checked your XSLT but assume this all happens in a "record" template
you have a direct path, so no need to repeat the context node (you can drop the '.' as well)
0
 

Author Closing Comment

by:WebDevMarty
ID: 40419316
THANK YOU! Works perfectly!
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 40419349
welcome
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
XSD Data to SQL Tables 2 27
Extract data from xml in c# 8 59
selectSingleNode in Access 2013 11 58
Fulfillment API php code sample 1 38
The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question