Showing posts with label svg. Show all posts
Showing posts with label svg. Show all posts

Sunday, December 14, 2008

x2svg updated to use fop 0.95 final

I have updated x2svg to compile against fop 0.95 final.
There is no new binary release yet, as I wanted to look into some other issues first.

If you are running the source, you can just do a svn update to get this minor change.

Let me know if you encounter issues.

Friday, November 14, 2008

X2svg: how to create diagrams (in the XSD parser)?

For some simple stuff it is easy to create diagrams with x2svg - here is an example from the test suite:

$ sh run.sh -c :pdf test-src/resources/sample.xsd root


This creates a PDF version of sample.xsd along with a SVG one (technically speaking, it creates a SVG version and converts it to PDF afterwards), where the root of the tree is the element root. There are no limits, so the whole tree with all its children is shown.

sample.png


But how to tackle more complex things?

The XSD-Parser has some options that we will have a look at:


  • -d n: this limits the depth of the tree to n, where a depth of 0 means the root element only and 1 means one level of children:


    sample1.png


  • -st : This option tells the parser that the given root element is not an element, but a type.

  • -lt : If this element is given, then elements of an given type are not filled with the content of the type, but the type name is specified:


    $ sh run.sh -c :png test-src/resources/inheritance.xsd parent-type -lt

    inheritance-lt.png


    Note, that there is currently a little display bug.



Those options allow you to create already good quality structural content from your schema files - see e.g. Part 2 and Part 4 of my RHQ plugin development series.

Tuesday, May 13, 2008

x2svg new release x2svg-1.2

Project x2svg just released the final 1.2 version.



Changes in release 1.2 since the last beta are:

  • Pass debug flag to the parsers.

  • Add the possibility in the GUI to pass parser specific options to
    the parser (SF fr#1956587).

  • Allow parsing of attributes and element comments. It depends on the
    individual parser if this is supported (SF FR#1940442). As this is still
    somewhat experimental, it is turned off by default.

  • Pull ant.lib into lib/, so the IDE can use this one.

  • Allow parsing of types in the XSD parser (SF FR#1947079).

  • Lot of cleanup and smaller fixes.



Browse the full changelog to see all changes in earlier versions.

You can download it from Sourceforge

Please provide feeback:


Help is always welcome.





Sunday, April 27, 2008

x2svg new release 1.2beta3

Project x2svg just released a new version.



Changes in release 1.2beta3 are:

  • Updated the libraries on the scripts to match the libraries introduced in 1.2-beta2 (SF bug#1944294).

  • Added the possibility to the XSD parser to just show references to substitutonGroups, but not the whole
    substituted group (SF fr#1769065).

  • Added the possibility to limit the depth of the parsed tree of the XSD Parser

  • It is now possible to get the parser specific help on the command line and to list modes and suffixes (SG
    bug#1950350)

  • Fix errors with options without argument and NPE without input file (SF bug#1951088).



You can download it from Sourceforge

Please provide feeback:

Sunday, April 13, 2008

x2svg new release 1.2beta2

Project x2svg just released a new version.

Changes in release 1.2beta2 are:


  • Fixes around the printing of the comment.

  • Some code cleanup

  • Added an ant target to automatically pull in the dependencies.

  • Upgraded testng to 5.7 and fop to 0.95beta / batik 1.7

  • Allow the gui to directly show the generated SVG. This needs your help - see
    http://pilhuhn.blogspot.com/2008/04/x2svg-plea-for-awt-help.html.



You can download it from Sourceforge

Saturday, April 12, 2008

x2svg: Plea for (AWT-) help

For x2svg I implemented a simple GUI to drive the conversion for people that don't like the command line (see below for a screenshot).
This GUI also has a SVG viewer based on the batik / squiggle code built in.
But unfortunately, scaling / translating, the handling of the scroll bars and also the reaction on window resize don't really work well (or at all).

If you have a few spare cycles and some understanding on this part of AWT (and perhaps even the batik code additions on top of this), please help me fixing that part of the GUI.



Source code is visible on the sourceforge page and the class in question is SVGDisplayFrame.java.

Monday, August 13, 2007

x2svg new release 1.2beta1

Project x2svg just released a new version, 1.2-beta1

Changes are
* Documentation updates
* Changed handling of the property file. See properties.html.
* Fixed a bug where the directory path of the input was appended to the output if only a directory was given for output conversion (x2svg-Bugs-1770327)
* The gui no longer silently swallows errors (x2svg-Bugs-1771512)
* Comments can be added to a diagram e.g. stating the input file or user (x2svg-FR-1770604)
* Improved XSD handling. Recursions are handled and a big Schema from @work can now be parsed. Inheritance is honored.
* Fix for: "The DTDParser was going into an endless loop" (x2svg-Bugs-1766097).
* Added a test suite.


It can be downloaded from the sourceforge download pages at:
http://sourceforge.net/project/showfiles.php?group_id=199130&package_id=236217&release_id=531824

Monday, July 30, 2007

Gui for x2svg

Hi,
project x2svg just released a new version that now contains a simple graphical user interface.

You can download it from Sourceforge.

Friday, July 20, 2007

x2svg 1.1 released

Today version 1.1 of x2svg has been released. Notable changes are:
* x2svg can now be run as ant tasks
* more output file types (eps, jpg, png, tiff, pdf) supported
* It is now easier to do mass convertions of svg files or input formats (The svg to xxx converter can be used standalone)
* added an alpha quality XML Schema parser

Check it out and: please give feedback!

Tuesday, June 12, 2007

Safari 3 (beta) rocks

Apple presented the new Safari version at WWDC yesterday. It is still a beta, but at least on the Mac it makes a great impression. It is blasting fast - if the server on the other side can deliver at that speed :)

There is now also a Windows version available, so PC users can now also use that great browser.

Ah and btw.: It now also has SVG support

Thursday, June 07, 2007

x2svg , first contributor

Today I got an email with patch for x2svg from a user. I am really pleased that finally someone is providing feedback - and then even in such a form.

Monday, May 28, 2007

x2svg 1.0 released

I am happy to anounce the first stable version of x2svg, a tool to
render tree like structures in scalable vector graphics (SVG).
Currently the following three input formats are supported:
- Document Type Definition (DTD)
- Java properties files
- ant build-files

Please check out the release information at Freshmeat.

And as always: please provide me with feedback, bug reports etc.

Thursday, May 10, 2007

x2svg first beta release available

A few days I wrote that I will release my dtd2svg tool as open source.
Meanwhile I refactored the code, fixed some bugs and also wrote a properties parser to visualize properties files.
As there are now not only DTDs accepted, I also renamed the project to x2svg, as I plan to add more parsers in the future.

You can grab the source distribution from here.
To build you also need fop and dtdparser, which need to be present in the lib folder.
Those can be obtained from

Have a look at the readme.html file in the doc/ directory of the distribution about details on how to install and run the tool.

x2svg is released under the LGPL.

Monday, May 07, 2007

SVG on Mac OS X

In a recent post I wrote that Safari on the Mac does not know about svg natively.
Inspired by a blog entry by Jeff Schiller, I just downloaded a nightly snapshot of Webkit, the browser engine behind Safari.
This snapshot is already quite well able to render svg on screen, even if it is not yet complete, as you can see on this chart.

Saturday, May 05, 2007

SVG resources

Holger and Juliane have a cool repository of SVG related resources, nice drawings in svg and (gui) components done in XML, XSLT and SVG. Among those are e.g. Login-Boxes rendered in SVG or various versions of bar charts processed in SVG.
All this is available at www.treebuilder.de.
Note that for visiting the site, you need a browser that is svg capable like Firefox or a SVG plugin for the browser (as for Apple Safari).

Thursday, May 03, 2007

DTD2SVG reloaded

In a past article I wrote about drawing DTDs in SVG in order to convert them to PDF later.
Recently I found some time to work on this matter again (actually I got inspried to do so as I saw that Batik and FOP are making some progress as well). The code is still somewhat *ehm* ugly, but I think the result is already not bad:


I plan on releasing the code in the open source in the next few weeks, so one can use and adopt it to its own needs. Also one of the more interesting features would be to allow for parsing of XML Schema as well.

Saturday, July 16, 2005

[svg] Inkscape

Inkscape is another svg drawing program. First impressions are quite good. Actually it is a spin-off from Sodipodi, which tries to be more SVG-centric.
Unfortunately it seems to have the same text placement code as Sodipodi, which results in the same svg as described in an earlier blog entry.

Sunday, November 07, 2004

Are FOP and Batik dead?

When looking at the download directory for fop and batik
(Index of /dist/xml/), it looks like the two projects are pretty dead. There was a batik release this year in february, but only because there was a security issue with the squiggle browser (nice tool btw!). For fop, which is at version 0.20.5 the situation is even worse: last release was in july 2003!.

Update:
After reading this blog article, things seem clearer. There is no entry on this on the ASF pages though.

SVG: drawing DTDs

In the past, I wrote a little note about XML.com's article on svg tree drawing.

Currently, the way most people seem to go if they want to add a structural drawing of their DTDs is to use XmlSpy, open the DTD, convert to XML Schema and let XmlSpy draw the diagram. XmlSpy can then export the drawing as png, or one can do a screenshot and save it in another pixelized format. The result is really good looking:

It seems that there are also other tools on the market like Tibco TurboXML that can produce drawings of DTDs (and the Tibco one seems to be able to export them even as SVG, as JBoss had some html-versions of their DTD in SVG done with some Tibco tool).

While this is good for graphics on the web or just visualisation of complex structures, this is of no real use when you have to scale the graphics to include it in some printed work. So I started to write my own converter. With the help of the batik toolkit, this is working quite well. The current state looks like this:


(The respective svg looks like this).
Obviously not yet as good as the XmlSpy version, but I can just run the conversion on command line and do not need a XmlSpy-license :-)
I will update this page when there is more available.

Tuesday, September 21, 2004

SVG: Tree drawing

This article at xml.com describes how trees of data can be drawn in SVG with the help of an xslt stylesheet.
With some additional work, this could surely be converted into a nice DTD printer. A good article nevertheless.