Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: 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/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.
> > <true> expected but was
> > <"Actions Test Asset not found in search">.
> > (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
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
