After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 155255 - Some additions and fixes to xsl stylesheets
Some additions and fixes to xsl stylesheets
Status: RESOLVED FIXED
Product: dia
Classification: Other
Component: exports
0.94
Other All
: Normal normal
: 0.95
Assigned To: Dia maintainers
Dia maintainers
Depends on:
Blocks:
 
 
Reported: 2004-10-13 02:36 UTC by dave Klotzbach
Modified: 2005-10-08 19:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
corrected version of dia-uml2docbook.xsl (6.40 KB, text/xsl-stylesheet)
2004-10-13 02:41 UTC, dave Klotzbach
  Details
Enhanced stylesheet (16.04 KB, text/xsl-stylesheet)
2004-10-13 02:43 UTC, dave Klotzbach
  Details
dia-uml to cpp headers and source files (19.32 KB, text/xsl-stylesheet)
2004-10-13 02:48 UTC, dave Klotzbach
  Details
xlated dia diagram dump style sheet (1.65 KB, text/xsl-stylesheet)
2004-10-13 02:50 UTC, dave Klotzbach
  Details
The stylesheet xml file that ties it all together (737 bytes, text/sml)
2004-10-13 02:51 UTC, dave Klotzbach
  Details
Correction to the earlier submitted version of uml to cpp (19.25 KB, text/xsl)
2004-10-18 01:52 UTC, dave Klotzbach
  Details
diff -u of the style sheet changes for Hans (902 bytes, text/plain)
2004-11-07 00:25 UTC, dave Klotzbach
  Details
diff -u output for dia-uml.xsl (24.94 KB, text/plain)
2004-11-07 00:28 UTC, dave Klotzbach
  Details
Patch file for the two xls file that changed (26.29 KB, patch)
2004-11-07 00:33 UTC, dave Klotzbach
none Details | Review
Removed whitespace changes from dia2UML.xsl (7.84 KB, patch)
2004-12-27 14:21 UTC, dave Klotzbach
committed Details | Review

Description dave Klotzbach 2004-10-13 02:36:29 UTC
I have over the last couple of months created some new style sheets and 
corrected one of the existing ones. Specifically, I have removed the parse 
error from dia-uml2docbook.xsl, though I am not sure who would use it.
In addition, I have written two new xsl style sheets.
First is one I called dia-uml2uml.xsl. This simply dumps the output of dia-
uml.xsl to the .code file so it could be inspected (maybe there was a better 
way but this is what I came up with.
Second, a file called dia-uml2cpp.xsl. I created a new file because I intended 
to radically change the way c++ code was being generated. There were some 
things being done in dia-uml2c++.xsl that I was not sure were correct usage of 
UML and I knew were not correctly being generated, but I did not want to break 
anything for those who may have been using it. My xsl properly handles 
generalization, association and dependencies as well as templates. Ok, I may 
have a few bugs in my version as well but I have not yet found them.
Finally, I had to enhance dia-uml.xsl to output the associations, 
generalizations and dependencies. I also added the dia ID as an attribute to 
all the elements. I have tested these changes with the other xsl sheets and 
did not find any incompatibilities and of course to support the two new style 
sheets, I have modified the stylesheets.xml file to add the selections 
for "cpp" and "UML".
I can provide these files to the development community if some one will 
contact me, I don't want to clutter Bugzilla with all the contents.
Comment 1 dave Klotzbach 2004-10-13 02:41:24 UTC
Created attachment 32540 [details]
corrected version of dia-uml2docbook.xsl

Fixed the parse error
Comment 2 dave Klotzbach 2004-10-13 02:43:42 UTC
Created attachment 32541 [details]
Enhanced stylesheet

This style sheet adds the id attribute to all element nodes and adds the nodes
for generalization, association and dependancy. Associations include the bind
stereotype where appropriate.
Comment 3 dave Klotzbach 2004-10-13 02:48:27 UTC
Created attachment 32542 [details]
dia-uml to cpp headers and source files

This version is radically different from the c++ translation provided by
dia-uml2c++.xsl. So different that I did not want to replace the old one so I
wrote a new one based on the original. This one handles associataions,
generalization, dependancies, parameterized classes and instantiations of
paramameterized classes as well as generating header(.h) and source(.cpp)files.

Class diagrams with spaces in the names are translated into somewhat legal c++
names and more.
Comment 4 dave Klotzbach 2004-10-13 02:50:12 UTC
Created attachment 32543 [details]
xlated dia diagram dump style sheet

simply sends the output from dia-uml.xsl to the .code file.
Comment 5 dave Klotzbach 2004-10-13 02:51:21 UTC
Created attachment 32544 [details]
The stylesheet xml file that ties it all together

an update of the xml file that ties it all together.
Comment 6 dave Klotzbach 2004-10-18 01:52:54 UTC
Created attachment 32709 [details]
Correction to the earlier submitted version of uml to cpp

I found I had sent the wrong version of this file earlier. That version
incorrectly applied the static keyword to function definitions and had an extra
white space in front of functions with no return type.
Comment 7 Hans Breuer 2004-11-06 22:22:39 UTC
If there would be a diff (produced by diff -u) I'll probably review and commit.
Please attach (and mark!) the file as text to make the review process less tedious.

Thanks,
    Hans
Comment 8 dave Klotzbach 2004-11-07 00:25:54 UTC
Created attachment 33508 [details]
diff -u of the style sheet changes for Hans

Here is the diff -u output so Hans can see the differences from the CVS.
Comment 9 dave Klotzbach 2004-11-07 00:28:00 UTC
Created attachment 33509 [details]
diff -u output for dia-uml.xsl

The diff -u output for the file dia-uml.xsl for hans
Comment 10 dave Klotzbach 2004-11-07 00:33:22 UTC
Created attachment 33510 [details] [review]
Patch file for the two xls file that changed

I now know how to make a patch file, so here is a patch file for the xlst
directory based on my xls changes. The patch tool I use does not seem to be
able to create new files so don't forget to add dia-uml2uml.xls and
dia-uml2cpp.xls after the patch.
Comment 11 dave Klotzbach 2004-11-07 00:35:10 UTC
I noticed that dia-uml2docbook.xls was obsolete. That is it is no longer in 
the CVS so I withdrew it.
Comment 12 Hans Breuer 2004-11-26 15:58:15 UTC
There is a lot of white space changes in the file. Could you either
do your changes without reformating the whole file or at least 
try diff with the --ignore-space-change option ?
Otherwise it is very difficult to see what exactly was changed.
I also noticed your xml tool removed the original comment from
the end of the file. Was this on purpose ?
Comment 13 dave Klotzbach 2004-11-28 00:37:13 UTC
If there are any other options you need to be able to be able to approve the 
changes could you please let me know before I make the diffs? The reason that 
there are so many changes to the file is also due to the number of changes I 
have made and added to original the dia-uml.xsl. I have also compared the 
output for each of the original transforms using as many examples as I could 
find to ensure that the output does not "break" any existing tranformations.

Contrary to the text in the trailing comment, the trailing comment is not 
processed by any of the xml or xsl transforms and therefore not used by any of 
them so are useless and I don't bother to keep them.
Comment 14 dave Klotzbach 2004-12-27 14:21:59 UTC
Created attachment 35224 [details] [review]
Removed whitespace changes from dia2UML.xsl

Since the original version of the changes to the file dia-uml.xsl contain many
unneeded whitespace changes, it was difficult at best to determine the relevant
code changes. This patch was created after painstakingly removing all
whitespace only changes. It should now be easier to validate against the
original dia-uml.xsl tranform.
Comment 15 Hans Breuer 2005-01-28 20:02:08 UTC
Sorry for not getting back earlier. [I was quite drained from other projects.]
The patch is now applied to cvs:

2004-01-28  Hans Breuer  <hans@breuer.org>

	[Extented version for UML to C++ conversion by Dave Klotzbach, bug #155255]
	* plug-ins/xslt/dia-uml2cpp.xsl : (new file) ... handles associataions,
	generalization, dependancies, parameterized classes ...
	* plug-ins/xslt/styleshetts.xml : refernce it
	* plug-ins/xslt/dia-uml.xsl : handle more UML types uesd above

Comment 16 Hans Breuer 2005-10-08 19:42:00 UTC
Adjusting target to help finding 0.94 dups already fixed