Has not been that easy, qwerty:
- The long line can grow very long: currently I am at 150k and the model is less than 20% through.
- [The long lines in the XMI file are values of just two Tagged values $ea_attclassified and $ea_oprsclassified, that is: breaking the lines has to be done on String level, not XML.
They look like
UML:TaggedValue tag="$ea_attsclassified" value="{B4A1C8DF-1D75-4226-A88B-258C986E2C37},{6E172079-E70F-408F-9630-915719CD029D},{B9C03329-21FF-4120-A27D-F27A7A6A0399}, ... (>150k characters, maybe grows to 1M)
I could have used tokenize function of xslt and substitue every },{ by },\n{.
However, it seems to me likely that I would see heap overflow, if the xslt processing copies attribute values for some reason.
And also it sounds sane to me to put the changes to the EA-XMI file to a minimum, leaving the lines just below 16k.
My solution was a transformation utility (~200 lines POJO Java) that does just that, while paying heed to buffer sizes. I was lucky that the inserted newlines did not harm the EA-import of the XMI file or violate some checksum or the like.
My procedure is as follows:
- try to check-in the package
- accept the failure
- insert as few as possible newlines
- check in using PTC
- synchronize version control state in EA
Do you think, I could find a better solution? This one would be hard to sell to my users.
Kind Regards
Rolf
p.s. BTW, I was told by the PTC maintenance that there is an unwritten rule, that a printable String in Java should not contain more than 16k consecutive characters without a newline. I did not know that one. However, if there is some truth in it, it might be an argument for Sparx not to have such long attribute values in their XMI. Even though the better solution would be, that I can define to PTC how to distinguish a character from a binary file.