Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Cleaning up a string so I can output it

From: Dylan <mejari@-----.--->
To: NULL
Date: 7/23/2009 12:04:00 PM
On Jul 23, 4:29=A0am, Martin Honnen <mahotr...@yahoo.de> wrote:
> Dylan wrote:
> >>> =A0 =A0 =A0 =A0<td onclick=3D"document.getElementById
> >>> ('results').innerHTML=3D'{$testresult}'"><a name=3D"{$testname}"
> > <testcase name=3D"test_Actions" time=3D"39" assertions=3D"1">
> > =A0 =A0 <failure type=3D"Test::Unit::AssertionFailedError" message=3D"F=
ailed:
> > Actions Test Asset not found in search....">
> > Failed: Actions Test Asset not found in search.
> > &lt;true&gt; expected but was
> > &lt;&quot;Actions Test Asset not found in search&quot;&gt;.
> > (Test::Unit::AssertionFailedError)
> > P:/Tests/RunAll/deciphertest.rb:90:in `test_Actions' =A0 =A0</failure>
> > =A0 </testcase>
>
> > What happens when I click on the appropriate error is, well, nothing.
> > Nothing on screen changes, the text that is in place that is supposed
> > to change is the same as it was before.
>
> Does IE not at least display a script error?
> I suspect that the line breaks in the element content result in script
> errors as you use a JavaScript string literal and that can't contain
> line breaks.
> So you need to escape them when you construct the JavaScript code.
> There is also a single quote in the element context and that also needs
> to be escaped to not break the JavaScript syntax.
>
> Here is an example that escapes line breaks and single quotes:
> =A0http://home.arcor.de/martin.honnen/xslt/test2009072301Xsl.xml
> Test XML using that stylesheet:
> =A0http://home.arcor.de/martin.honnen/xslt/test2009072301.xml
> Works fine for me with IE 8.
>
> --
>
> =A0 =A0 =A0 =A0 Martin Honnen --- MVP XML
> =A0 =A0 =A0 =A0http://msmvps.com/blogs/martin_honnen/

That looks like what I need, thank you very much! However, I'm not
sure how to implement your solution in my code. I have the potential
for up to maybe a dozen <failure></failure> tags, each within separate
<testcase></testcase> tags, and I want it to be possible to click on
one failure case and have some text elsewhere on the page change to
have the failure text written there. I only want the information from
one failure at a time to be written. I've tried adding your code into
my stylesheet but I can't seem to get the failure code to show up, and
it writes one "Click here" line per failure tag (which makes sense,
thats what its supposed to do). Any ideas? Thanks again, I really
appreciate the help!

-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