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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XSLT Web Links Fine...Local Links Broken

Status
Not open for further replies.

JeffNolan1900

Technical User
Mar 21, 2007
26
0
0
US
Hello.
I have an xslt file that processes an xml and I have use a xsl choose to conditionally format any of the properties that have the name LINK to show the path as a hyperlink. Easy enough. If the link is web related: it works fine and opens the link. If the link is C:\image.jpg it fails?

The thing is I am using an internal browser that is part of a mapping application, that I imagine accesses Internet Explorer somehow. When the link opens, it opens in a pop-up that is in Internet Explorer, but when I try and open C:\image.jpg nothing happens...nothing at all.

Here is an exceprt from the xslt code that opens the link:
Code:
<xsl:template match="*">
    <xsl:param name="tag"/>
 
       <xsl:element name="tr">
       <xsl:attribute name="{$tag}">yes</xsl:attribute>
       <xsl:attribute name="class">r<xsl:value-of select="position() mod 2"/></xsl:attribute>
       <xsl:attribute name="style">display:block;</xsl:attribute>
         <xsl:choose>
          <xsl:when test="name()='LINK'">
           <td><xsl:value-of select="name()"/></td>
           <td><a target="_new"><xsl:attribute name="href"><xsl:value-of select="."/></xsl:attribute></a><xsl:value-of select="."/></td>
          </xsl:when>
          <xsl:otherwise>
          <td><xsl:value-of select="name()"/></td>
          <td><xsl:value-of select="."/></td>
          </xsl:otherwise>
         </xsl:choose>
       </xsl:element>
</xsl:template>

Here is a sample of the xml file:
Code:
<Water_Valve n="Water_Valve" i="8fc7da74-0956-4681-a787-1d4f16540cb4">
  <FID type="string">11111111</FID> 
  <VALVE_POSI type="string">asdf</VALVE_POSI> 
  <VALVE_NUM type="string">afds</VALVE_NUM> 
  <VALVE_TYPE type="string">afdfafsd</VALVE_TYPE> 
  <ENABLED type="string">asdf</ENABLED> 
  <LINK type="string">C:\logo.jpg</LINK> 
</Water_Valve>

Keep in mind if I use this in regular iexplore it works fine. This is something strange I can not seem to figure out and was just wondering in anyone here had seen anything like this.
 
><td><a target="_new"><xsl:attribute name="href"><xsl:value-of select="."/></xsl:attribute></a><xsl:value-of select="."/></td>
[tt]<td><a target="_[blue]blank[/blue]"><xsl:attribute name="href"><xsl:value-of select="."/></xsl:attribute>[blue]<xsl:value-of select="."/></a>[/blue]</td>[/tt]
 
Thanks for the input but that does not resolve the problem. Like I mentioned it works fine for html links, but does not work for local links. (C:\image.jpg)
 
If you haven't read it carefully, let me put it this way. Your script would work no where because it has zero-pixel-worth of clickable space. It won't work local or remote.
 
It does work remote. I changed the location of the </a>

Actaully, it worked remote with the </a> in the wrong location, which is strange to tell you the truth...But it does not work local. No matter which location I put the </a>
 
I have nothing then to add. I don't believe "wrong" thing would do the "right" thing. If td does not have onclick handler set by attachEvent, I don't believe it. But I am not challenging you, only that I cannot help where I know not.
 
Like I mentioned, I am using a mapping program's internal browser. It works fine if I take it out of the mapping program's environment and send it into Internet Explorer. It is just that for some reason the internal program can not handle it.

I have tried appending: file:// and file:/// and file:/ and file:\\ etc... and nothing seems to work. I click the link and it just sits there, like I did not click it.

Does anyone have any other suggestions for how to handle this?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top