How do I add a hyperlink in XML file?
-
I am doing a website and for the text, i have imported a xml file to display the text on the website. However I would like to be able to click on one of the text(extract from my xml file) as a hyperlink. Please help here! =)
-
Answer:
If it is a problem with the way that XML is handling the "<a >" element, then you can try using a named entity such as "<" and ">" for the respective less-than and greater-than characters, or use their numeric equivalents (depending on the character-set chosen). If you are using a XSL, then you will need something similar to either of the following: <xsl:for-each select="urls/url"> <br/> <xsl:element name="a"> <xsl:attribute name="href"> <xsl:value-of select="@address" /> </xsl:attribute> <xsl:value-of select="@desc" /> </xsl:element> </xsl:for-each> <xsl:template match="A"> <a> <xsl:attribute name="href"> <xsl:value-of select="@href"/> </xsl:attribute> <xsl:apply-templates /> </a> </xsl:template> <xsl:template match="text()"> <xsl:value-of select="."/> </xsl:template> .
Dreyers at Yahoo! Answers Visit the source
Other answers
use < and > to escape the XML parsing.
Andy T
Related Q & A:
- How can I do a resource in PDF file?Best solution by Stack Overflow
- How can I add a clickable link to a question or answer on yahoo?Best solution by Yahoo! Answers
- How can I add a picture to a video?Best solution by Answerbag.com
- How do I add a photo to a Wikipedia page?Best solution by en.wikipedia.org
- How do I add a photo to a question?Best solution by Answerbag.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.