Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Need to link in an XML/XSL page

Posted on 2014-11-02
4
Medium Priority
?
131 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 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Suggested Courses
Course of the Month12 days, 1 hour left to enroll

916 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