Welcome to WebmasterWorld Guest from 34.204.173.36

Forum Moderators: open

Message Too Old, No Replies

Pull url out of returned value

     
8:33 pm on Jul 28, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 10, 2008
posts: 1130
votes: 0


I have a prebuilt system so I can't change the back end.
When I call <xsl:value-of select="udt:Application" disable-output-escaping="yes" />

I get html like
<a href="someplace/somefile.pdf">somefile.pdf</a>

What I want to be able to do is make the link just say application, no matter what the file name is. This is the html I would like
<a href="someplace/somefile.pdf">Application</a>
I really have no idea about how to do this because I'm somewhat a noob with xsl. Examples are welcome, but if someone can just give me the names of things I would need to use I can probably google them and get it. Thanks in advance!
2:28 pm on Aug 2, 2011 (gmt 0)

Senior Member from CA 

WebmasterWorld Senior Member httpwebwitch is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Aug 29, 2003
posts:4061
votes: 0


hmm. instead of <xsl:value-of>, write a template that matches the input <a> node, outputs a new one with @href matching the @href of the input, with <xsl:text>Application</xsl:text> inside the <a>

you'll need:

<xsl:apply-templates>
<xsl:value-of>
2:45 pm on Aug 2, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 10, 2008
posts: 1130
votes: 0


I'm not for sure I understand what you mean?
5:59 pm on Aug 3, 2011 (gmt 0)

Senior Member from CA 

WebmasterWorld Senior Member httpwebwitch is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Aug 29, 2003
posts:4061
votes: 0


Sorry about that. XSLT is hard to talk about in English sometimes.

I mean, if you have an XML node with a structure like:
<a href="someplace/somefile.pdf">somefile.pdf</a>


then you can use an XSLT "template" to turn it into:
<a href="someplace/somefile.pdf">Application</a>


the node "udt:Application" contains HTML, but it happens that HTML is valid XML and can be further transformed by - instead of outputting the <xsl:value-of> - sending it to a template that changes it into something else.

Some rules defined in a <xsl:template> will accept input sent to it by <xsl:apply-templates>.

example:
[w3schools.com...]