Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Cleaning up a string so I can output it

From: Dylan <mejari@-----.--->
To: NULL
Date: 7/21/2009 2:53:00 PM
Hey there! I have a problem I've been wrestling with for a while and
wondered if anyone might be able to help.

I have an XML file of output from a Ruby script and I'm writing up a
style sheet to parse it for me. Right now I have most of it done;
multiple tables for different parts of the output, listing all the
data, etc... But I'm having a problem with getting some output to
write correctly. I have a CSS <style> defined that lets me give text a
popup window that I can use to display more info about a certain item.
Currently it's working perfectly. The info includes all sorts of
characters, including "<", ">", "'", etc... but it show up fine in the
pop ups. However, I'm trying to get that exact same data to show up
permanently when someone clicks on the text so that they can copy-
paste it if they need to, and I am unable to get the exact same data
that works so well in the popup to show up in plain text.

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.

Any ideas would be greatly appreciated. Thanks!

-Dylan


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent