Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Cleaning up a string so I can output it >Thread Next - Re: Cleaning up a string so I can output it Re: Cleaning up a string so I can output itTo: NULL Date: 7/22/2009 12:09:00 PM Dylan wrote:
> Here's the relevant code:
>
> <tr>
> <xsl:variable name="testname" select="substring-after
> (@name,'test_')" />
> <xsl:variable name="testresult" select="failure "/>
> <td><xsl:value-of select="$testname"/></td>
> <td />
> <td onclick="document.getElementById
> ('results').innerHTML='{$testresult}'"><a name="{$testname}"
> class="info" href="#{$testname}"><xsl:value-of select="failure/
> @message"/><span><xsl:value-of select="failure"/></span></a></td>
> </tr>
>
> and then farther down the page:
>
> <td>
> <span id="results">Click on an error or failure and its details
> will be printed here</span>
> </td>
>
> The "<xsl:value-of select="failure"/>" "<span><xsl:value-of
> select="failure"/></span>" works to get the data for the popup, but
> the "<xsl:variable name="testresult" select="failure "/>" followed by
> "innerHTML='{$testresult}'" doesn't.
Can you show us how such a failure element in your XML input looks? Can
you explain what exactly happens when you say "doesn't work"? Do you get
a script error?
And why are you setting innerHTML? Shouldn't you set innerText for IE
and textContent for other browsers? xsl:value-of select="failure" will
create a text node while settings innerHTML parses as HTML so it is no
surprise if you get different results.
--
Martin Honnen --- MVP XML
http://msmvps.com/blogs/martin_honnen/
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
