XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
David CorleySubject: Formatting of java stacktrace using xslt (but no regex preferably)
Author: David Corley
Date: 17 Jan 2007 11:01 AM
Hey all,
I have a string that I need to format using xslt 2.0.
The string is a java stacktrace error, that looks like this:
java.lang.RuntimeException: Couldn't find xml/UselessStringValueOf.xml at test.net.sourceforge.pmd.testframework.RuleTst.extractTestsFromXml(RuleTst.java:149) at test.net.sourceforge.pmd.testframework.RuleTst.extractTestsFromXml(RuleTst.java:137) at test.net.sourceforge.pmd.testframework.SimpleAggregatorTst.runTests(SimpleAggregatorTst.java:18) at test.net.sourceforge.pmd.rules.strings.UselessStringValueOfTest.testAll(UselessStringValueOfTest.java:16)

At the moment, it's one long line. I'd like to insert a carraige return after every " at " in the string, so it's nicely formatted. The stack-traces will be of varying lengths.
Can anyone suggest a method for doing this?

Postnext
Tony LavinioSubject: Formatting of java stacktrace using xslt (but no regex preferably)
Author: Tony Lavinio
Date: 17 Jan 2007 05:18 PM
Maybe replace(xxx, ' at ', '
at ') would work for you?

Postnext
David CorleySubject: Formatting of java stacktrace using xslt (but no regex preferably)
Author: David Corley
Date: 18 Jan 2007 02:58 AM
I'm afraid not. replace() outputs the result as strings, as opposed to markup, so the html code has perfectly formatted the text, but the rendered text is exactly the same. The xpath programmers reference says to use the analyse-string xslt command to allow output of escaping characters.

So I need to use regex.....
Any ideas?

Posttop
Tony LavinioSubject: Formatting of java stacktrace using xslt (but no regex preferably)
Author: Tony Lavinio
Date: 18 Jan 2007 11:08 AM
Please don't start new threads; it makes it hard for others to follow
the discussion.
Since you did though, followups will be on this thread:
http://www.stylusstudio.com/SSDN/default.asp?action=9&read=6051&fid=48

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.