Okay, so I know some basic HTML code. Links are simple, normally, you just write <a href="url">TEXT </a>. Now my question is how do I, instead of indicating the url determine the url based on the TEXT for which the code surrounds? The reason I ask is I'm doing a little XML with a stylesheet which is turning a bunch of data into tables. There is a particular column I would like to link all of the values to their respective files(sound files). How might I go about this?
Making a Link's text into the target URL
Collapse
X
-
Tags: None
-
Hi Jason,
I would suggest that in order to do what I think you're describing, you'll probably need some programming technology other than simple HTML. You might be able to use PHP, JavaScript, or even XSLT, based on your requirements and your comfort zone. If you're uncertain, I recommend PHP. The syntax is fairly intuitive, it does not rely on the visitor's browser, and it's supported by most shared hosting environments. You did mention the data source is XML, so that's why I mentioned XSLT as a potential candidate; but I'm hardly an expert on that.
Do the sound files you want to link to have exactly the same name as the link text, or something similar enough that you could just do a string replace to remove spaces? That would probably help to make your process easier.
Happy coding!
-thesmithman
Comment