Tuesday, March 2, 2010

Why run ArchGenXML on a UML file instead of zargo?

Short answer: there's no reason.

The original version of this post comes from an error i got from ArchGenXML when running it on a UML file, instead of the generally recommended zipped (zargo) version. Why did i want to use UML instead of zargo?

The reason was version control: As a binary (zipped) file, zargo files will be replaced whole, while UML files can be diff'ed. This results in smaller diffs, and diffs that can be scanned for useful information.

However, the difference between two UML files, as output by the diff command, is hardly human-readable: Adding one field to a content class yields a 146 line diff that is almost completely unreadable. Also, the difference in size for changes is small: the patch is about 6k, while the zargo file is 36k. (UML size is 388k.)

So my arguments for running AGX on UML are invalid, i'll use zargo from now on.

(update 2010-07-06)

Original post: ArchGenXML: xml.parsers.expat.ExpatError: unbound prefix



I was working on a workflow in ArgoUML. After i'd added a transition, I got this error:
Traceback (most recent call last):
...
File "/usr/lib/python2.6/xml/dom/minidom.py", line 1918, in parse
return expatbuilder.parse(file)
File "/usr/lib/python2.6/xml/dom/expatbuilder.py", line 924, in parse
result = builder.parseFile(fp)
File "/usr/lib/python2.6/xml/dom/expatbuilder.py", line 207, in parseFile
parser.Parse(buffer, 0)
xml.parsers.expat.ExpatError: unbound prefix: line 3843, column 6
make: *** [default] Error 1
make: Leaving directory `...'


The offending XML is this:

<argouml:pathitem figname="Fig2.1"
classname="org.argouml.uml.diagram.ui.PathItemPlacement"
figclassname="org.argouml.uml.diagram.ui.FigNameWithAbstract"
ownerhref="127-0-1-1--3a86f936:1271ed6383a:-8000:000000000000121D"
angle="270.0"
offset="10" />


As it turns out, this only happens with ArgoUML 0.28.1, with 0.26.2 all goes well.

The answer is that ArgoUML adds the "<argouml:... />" tag since 0.28, and archgenxml doesn't (yet?) know how to deal with it. However, you can export the model as an xmi profile, and let archgenxml work with that.

See also this part about generating the .xmi file automatically from the .uml.

1 comment:

Anonymous said...

hey! your argument using UML is not to bad really. But we should use http://diffxml.sourceforge.net/ instead of a normal diff to see differences.
XML is not for humans anyway so giving up on this is okay as well ;-)
Working with Argouml is not always easy ... sometimes i look into the produced XML to find empty tags which are a show stopper for archgenxml ;-(

regards,
Sascha Gresk