Are there any static or dynamic code analysis tools that analyze XSLT/XSL code?
The resources I have been able to find so far are:
1. Oxygen xml editor
2. http://gandhimukul.tripod.com/xslt/xslquality.html which looks faily basic in its capabilities
There are quite a few testing tools and verifiers at Tony Graham's XSLT Testing Tools page. If you haven't looked there, it's a fairly comprehensive list.
Using Saxon in schema-aware mode will catch many common errors.
You've already discovered Mukul Gandhi's XSL Quality tools, which support user-added extensions. On the xsl-list run by Mulberry Technologies a while back, several other people contributed ideas for new rules also. You might also get help asking there.
Stylus Studio, Oxygen and xmlspy have profilers for run-time performance.
XML Spy includes an XSLT profiler. That should fulfil your dynamic analysis needs if you can afford it.
There is also StylusStudio, a plugin for VisualStudio and CatchXSL (which is free).
Related
I think there should be a tool to do so ? is anyone here aware of any ?
I saw other posts related to this but found none for C++, I am aware that I can do that with JAVA and C#.
If you use XML Spy or oXygen, you can generate sample XML files based on a schema. Both tools accept commandline options and can be run in batch mode so that'll probably fit in your unit tests, if that's what you're after. Wrap your own C++ code around it and you're in business.
If you need quality XML, with tons of tweakable options, you might want to check out http://www.code-generator.com/XML-Sample-Generator.aspx. No C++ here, just a tool that works, and rises beyond the default "lorem ipsum..." output.
HTH,
~Rob
I'm in the market for an XSLT profiler.
I'm using the Xalan-j XSLT processor from Apache.
I'd like to be able to run the profiler under Windows or Linux as we have different teams using the same XML and XSLT on different platforms.
The tool needs to be able to work with exslt extensions.
The tool needs to be able to work with large (MB) input XML documents.
I'm not entirely adverse to paying for the right tool, but free (as in beer) would be nice.
I'm interested in hearing from people who have successfully used the tool that they recommend.
EDIT: updated, yes, xalan-j
I'm assuming you're talking about Xalan/J; I'm not aware of the options for Xalan/C++.
Stylus Studio had one in older versions, but it was dropped for Xalan in the current release.
The only other commercial one for Xalan that I am aware of that is any good is from Oxygen.
Note that sometimes switching on the profiler switches the XSLT engine into a debugging mode so that certain optimizations are not performed, so the profiler results should be taken with some common sense.
On-line XSLT processor based on xalan-2.7.1 with profiler information: http://xslt-profiler.appspot.com/
I'm looking for an XSL lint tool which is actively maintained. The only one I can find is this one, but the last update was in 2000 (9 years old!). Any help would be great!
Phillip,
Creating a good lint for xlst is quite hard, because validity of xslt templates depends on the parser that is used. Each parser has it own extensions.
For example java's xalan can be easily extended with custom xpath functions, which are obviously coded in java. Because of that any .net validator will fail to validate advance xalan's xslts.
So first of all you need to know what processor you are going to use. If you use java based processors I recommend to use Eclipse which can validate the templates on the fly.
I've tired two eclipse plugins, It is worth mentioning that both support debugging and xslt/xpath code completion:
Oxygen XML editor - a commercial (~$300) XML/XSLT editor/eclipse plugin.
It can use the following engines: Xalan, Saxon, Xsltproc,
It is able to check:
correctness of xsl:template
correctness of name attribute of xsl:call-template
duplicated definition of xslt variables
validity of dtd's
validity of xslt header
validity of xml namespaces
validity of XPath
validity of xsl:value-of if an xml is associated to xslt
correctness of xsl:import for local and remote files (it support xml catalogs)
I must say that the plugin is really good but on the other hand it isn't open source.
XSLT Project - an open source plugin (it is part of Eclipse Web Tools Platform).
It is quite young (started in September 2008), however it has very active community. Currently it supports only Xalan and JAXP.
It detects the following errors and warnings:
invalid xslt header
incorrect dtd
incorrect imports (it handle only relative imports, xml catalogs are planed for version
1.1)
The above list is definitely incomplete because lack of support for xml catalogs made this project unusable for me.
Yes, look at this one, published Dec. 2008:
http://lists.xml.org/archives/xml-dev/200812/msg00178.html
You should look for "XSL profiler" or "XSL debugger". There are dozens of these.
I have decided that I really need to get some flowcharts for reverse engineering some code I have inherited. I do not have the Team edition of VS so I cannot use Team's built-in capabilities with Visio. So I thought I would parse the .ncb (Parser Information) files and make charts with dot (from graphviz.org). How hard could that be? But I cannot find any documentation for the innards of that file.
I really don't want to use a commercial application to do the flowcharts. And the free addins I've seen all assume that I am using C# or VB. However, I am using C and C++.
I did try the Microsoft "Visual Studio Learning Pack" which has the "Visual Programming Flow Chart" tool. But it doesn't appear to work with C++. So close!
So, does anybody have pointers to the file format or other suggestions (keep it polite!)?
I don't think you have much chance to be able to parse the NCB files. They are in a proprietary binary format that changes and is likely to change between every single version of visual studio. From what I read somewhere, it's possible that in VS2010 the NCB is going to be discarded and the intellisense information is going to be kept in normal database using SQL Server Express.
Another option you might consider is using some other tool that analyzes your code and builds diagrams and UML charts. Doxygen does this to some extent and there is a plethora of commercial tools that do as well. I have some personal experience with Rational Rose (which might be defunct by now..) and a tool called Together. This list might be of some help
For a structural analysis in the sense of "who calls what", "who inherits/overloads where" and "who reads/writes globals" I once used DeHydra (a mozilla project) for analysis and yed (www.yworks.com) for graph display. Both are free.
Dehydra runs under linux and requires your code to pass gcc compilation. This is not a too serious obstacle, as VC can generate makefiles, which can be hand-modified for gnu make.
In my case, some patching of include files was required, but i could finally get the desired information out.
It took me 3 days to get DeHydra working, another 2 days to tweak makefile and includes and
3 more days to adapt javascript code, which inside DeHydra extracts the required information.
DeHydra + Javascript now delivers in one compiler run a graphml file containing the code structure, which can directly displayed and interactively manipulated in yed.
I am trying to be a "good" programmer and have unit tests for my ColdFusion application but haven't been able to find a code coverage tool that can tie into the test that I'm using. For those of you who do unit tests on your ColdFusion code, how have you approached this problem?
With ColdFusion Builder you can use Rancho for code coverage.
http://forta.com/blog/index.cfm/2012/5/25/ColdFusion-Code-Coverage-With-Rancho
Many have asked, but to date there remains no ColdFusion code coverage tool.
The latest ColdFusion features .NET integration in addition to J2EE integration, so if you require code coverage metrics (ie, customer requirements) then (aside from choosing something other than ColdFusion) you might define what parts need such coverage and break them out into .NET or J2EE objects which you can profile with readily available tools.
Alternately, you can do some analysis yourself - use a parser to insert cftrace tags after every control statement and then parse the results.
Lastly, ColdFusion does have some basic stack trace ability - I don't know if it goes deeper than that, but it's worth exploring to see what you can parse from that.
I hope this helps!
-Adam Davis