Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

transforming links from XML to HTML

Status
Not open for further replies.

stinkybee

Programmer
May 15, 2001
218
GB
I seem to be unable to get links within the same HTML page working when transforming from XML. I can create hyperlinks but I seem to have a problem adding a 'name' attribute to an '<a>' tag.

here is what I have done.

<xsl:element name=&quot;a&quot;>
<xsl:attribute name=&quot;name&quot;>
<xsl:value-of select=&quot;linkname&quot;>
</xsl:attribute>
</xsl:element>
 
i always use...


<a>


<xsl:attribute name=&quot;name&quot;>


  <xsl:value-of select=&quot;linkname&quot;/>


 </xsl:attribute>


</a>





but notice the <xsl:value-of> tag. in your post you don't have the trailing &quot;/&quot;. this may be your problem as apart from this your code looks fine. the only other way you could be getting your problem is if the xsl can't locate the linkname in your xml tree.


 
Thanks for the advice but I still can not get it to work.
if I change the attribute name like this

<xsl:attribute name=&quot;href&quot;>
<xsl:value-of select=&quot;linkname&quot;>
etc

it picks the linkname up fine so the xsl must be locating the linkname in my xml file.

ps. I just forgot to write in the trainling / last time so thats not the problem.
 
so when you have
<xsl:attribute name=&quot;href&quot;>
it works but when you have
<xsl:attribute name=&quot;name&quot;>
it doesn't??

i've tried it here and it works fine with both <a>blah</a> and in <xsl:element name=&quot;a&quot;>blah</xsl:element>

sounds like a bug in your processor. (maybe there's a dodgy regex that's killing the attribute after it makes it)

what processor/browser are you using?
 
I thought I was using ie 5.5 but it appears I am only using ie5. Do you think this could be a problem?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top