SourceMonitor xml dump to database - code-analysis

Is there a library or a tool that could parse the xml dump of SourceMonitor and save it in database?
SourceMonitor is a great tool, but I'd like to have better visualization and statistics-over-time of our code, which you really can't get with SourceMonitor.

A useful script is Eden Ridgway's SourceMonitor Summary Xml File Generation.

Related

How to read/edit Parasoft SOATEST .tst file by code or manually?

I need to read the .txt file as raw text or by code to extract the data keyed in the test suite (resource/assertors,....). Is there any way to do that? by code or any editor.
If you have binary format of tst file then there could be a problem, there is no official API to read it.
It's very old format, I don't think that is still in use.
There could be also two, newest, formats of tst:
compressed XML
XML
In case of compressed XML you have to unzip it and then you have access to XML, where you can read it as text file.
In case of XML, it's just XML, you can read it as pure text file.
There is no official API which allows to read it in similar way as SOAtest's GUI to use in code i.e.: in Java.

BCP Utility import with XML

I was told to research BCP Utility to figure out how to import an XML file into a SQL table, but as far as I can see it's not a feature of BCP Utility and that csv files are pretty much the go to if that's necessary. All I see with XML files is how to create and use formatting files, but nothing about actually bulk loading data with XML files.
As for my question...is it possible? Can you use an XML file and push that straight to a table? And if it isn't possible with BCP Utility is there anything that has that functionality?
Thanks.

Get a valid schema of large (1 GB) xml files

I need to bulk load huge xml files to SQL Server 2005. I decided to use SQLXMLBULKLOAD in my C# app, but I need to get valid xsd-schemas of those xml files to load them. Which is best way to generate xsd file?
I tried MS VS xsd.exe, but it tries to load the file into memory, which causes OutOfMemory exception.
Thanks!
Strip the file down to create a smaller one that is representative of the whole, then generate an XSD from that. You can then tailor the result if necessary.
There are quite a few tools to generate schemas from instances, but I don't know how many of them are able to operate in pure streaming mode. One tool which will work regardless of the file size is the DTDGenerator that was originally part of Saxon; you can find it here:
http://saxon.sourceforge.net/dtdgen.html
It produces a DTD rather than a schema, but there are plenty of tools available to convert a DTD to a schema.

Difference between TouchXML and GDataXML parser

I have two options in front of me for parsing really fat XML file,
TouchXML
GDataXML
It's lot of work to do because XML file is very huge. I thought of asking people who have already worked with these parsers.
Which one is better for fat XML files?
I found a blog post which says that TouchXML does not edit/save XML files whereas GDataXML has that feature. What exactly do they mean by edit/save XML file feature?
Lets see if I can answer your questions:
Which one is better for fat XML files? The answer is neither. Both are DOM parsers, which actually load the entire document into memory to make queries faster. If you're parsing a large file, you're better off going with a SAX parser, such as the built-in NSXMLParser, or even the SAX-based version of libxml2.
What exactly do they mean by edit/save XML file feature? Well, suppose you have a XML file that has your app's settings in it. If you open up that file and make changes, you're going to want to save them, right? That's where the writing comes in. The parsers that allow writing let you save the representation of the xml file in the memory into an actual file that can be written to disk.

Generate PDF from structured data

I want to be able to generate a highly graphical (with lots of text content as well) PDF file from data that I might have in a database or xml or any other structured form.
Currently our graphic designer creates these PDF files in Photoshop manually after getting the content as a MS Word Document. But usually, there are more than 20 revisions of the content; small changes here and there, spelling corrections, etc.
The 2 disadvantages are:
1) The graphic designer's time is unnecessarily occupied. The first version is the only one he/she should have to work on.
2) The PDF file becomes the document which now has the final revised content, and the initial content is out of sync with it. So if the initial content needs to be somewhere else (like on a website), we need to recreate it from the PDF file.
Generating the PDF file will help me solve both these problems. Perhaps some way in which the graphic designer creates a "Template" and then puts in tags/holders and maps these tags/holders to the relevant data.
Thanks :-)
There are some tools out there for doing this. XSL-FO is useful. Here is a tutorial for creating a pdf from xml (or xhtml) with cocoon. Also see Apache FOP.
You could format your SQL data as XML and still use the same templates this way.
I use the ReportLab python library for this. It could perhaps solve your problem, but you will need to do some work...
In the past I have written scripts that spit out LaTeX then used texi2pdf to solve this kind of problem.
Take a look at iReport and JasperReports at http://jasperforge.org.
iReport lets you design reports, and then you can either programatically fill it with the JasperReports library (Java), or just use iReport to manually create the report.
I have only used it for tabular data, but I don't think there would be any problem for other types of documents.
You could create a form and populate the entries programmatically using a pdf library like iText (Java).
You could look at doing the workflow in PostScript which is plain text that you can easily compose from fragments. Then you can use any free tool to convert to PDF.
Take a look at Prince XML. This tool allows to generate PDF based on XML or HTML and CSS.
A possible way is to use a template engine, like FreeMarker or StringTemplate: these are often used to generate HTML, but they are flexible enough to output any format, actually.
The problem is to make a PDF template, I suppose. Perhaps you can take a sample output and edit it to replace data with placeholders to be filled by the template engine. Might not be trivial!
Sounds like a job that SQL Server Reporting Services can handle quite easily.
Reporting Services allows you to query the data, define the layout, and export to PDF without any intervention. The PDF output can be distributed via email, stored on a file share, and accessed via a page on the report server.
It can handle XML data sources too.
Another approach to generating a PDF file from data is to use prawn, which is based on ruby. I was very pleasantly surprised by how much functionality is included in prawn. It may take some investment up front but this approach will give you a lot of flexibility.
You can combine CSStoXSLFO with XEP from RenderX for high quality output. With this solution you can merge XML data into an XHTML template, which is decorated with CSS. It can also generate charts with the fantastic JFreeChart library. CSS3 page media features are supported.