Discussion:
[umbrello-devel] [umbrello] [Bug 363582] New: It would be nice for XMI file to have stable format.
Michał Walenciak via KDE Bugzilla
2016-05-27 09:20:08 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=363582

Bug ID: 363582
Summary: It would be nice for XMI file to have stable format.
Product: umbrello
Version: 2.19.1 (KDE Applications 16.04.1)
Platform: Archlinux Packages
OS: Linux
Status: UNCONFIRMED
Severity: wishlist
Priority: NOR
Component: general
Assignee: umbrello-***@kde.org
Reporter: ***@gmail.com

Now with almost every save my xmi file gets many changes, mostly due to some
reordering.
Example:

- <UML:Model isLeaf="false" name="Model UML" isRoot="false" xmi.id="m1"
isSpecification="false" isAbstract="false">
+ <UML:Model isRoot="false" isLeaf="false" xmi.id="m1" isAbstract="false"
isSpecification="false" name="Model UML">

It would be nice to have it stable (for changes review and version
controlling).


Reproducible: Sometimes


Actual Results:
Unstable xmi file format.

Expected Results:
Stable xmi file format.
--
You are receiving this mail because:
You are the assignee for the bug.
Ralf Habacker via KDE Bugzilla
2016-05-27 10:45:42 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=363582

Ralf Habacker <***@freenet.de> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@freenet.de

--- Comment #1 from Ralf Habacker <***@freenet.de> ---
(In reply to Michał Walenciak from comment #0)
Now with almost every save my xmi file gets many changes, mostly due to some reordering.
Is that version running with KDE4 or KF5/Qt5 ?

Qt5 has an issue with ordering, see
http://stackoverflow.com/questions/27378143/qt-5-produce-random-attribute-order-in-xml
--
You are receiving this mail because:
You are the assignee for the bug.
Ralf Habacker via KDE Bugzilla
2016-05-31 08:03:57 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=363582

Ralf Habacker <***@freenet.de> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |CONFIRMED
Ever confirmed|0 |1

--- Comment #2 from Ralf Habacker <***@freenet.de> ---
From
https://www.archlinux.de/?page=PackageDetails;repo=extra;arch=x86_64;pkgname=umbrello
it looks that this bug has been reported for a Qt5 build.

The question is if the fix mentioned in comment 1 uses the same ordering as
Qt4.
--
You are receiving this mail because:
You are the assignee for the bug.
Ralf Habacker via KDE Bugzilla
2016-06-02 08:04:46 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=363582

--- Comment #3 from Ralf Habacker <***@freenet.de> ---
(In reply to Ralf Habacker from comment #2)
Post by Ralf Habacker via KDE Bugzilla
From
https://www.archlinux.de/?page=PackageDetails;repo=extra;arch=x86_64;
pkgname=umbrello it looks that this bug has been reported for a Qt5 build.
The question is if the fix mentioned in comment 1 uses the same ordering as
Qt4.
Some research returns:
1. Qt4 has a stable order between multiple saves
2. Qt5 with seed fix has a stable attribute order between multiple saves but
differs from Qt4 builds
--
You are receiving this mail because:
You are the assignee for the bug.
Ralf Habacker via KDE Bugzilla
2016-06-02 09:38:58 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=363582

--- Comment #4 from Ralf Habacker <***@freenet.de> ---
Created attachment 99323
--> https://bugs.kde.org/attachment.cgi?id=99323&action=edit
xslt file for reordering xmi file

The simplest solutions is to post process the generated xmi file with an xslt
processer for example xsltproc.
https://social.msdn.microsoft.com/Forums/en-US/a75f9afc-f4f2-44e2-afa4-dffe6ca33b0f/xslt-how-can-i-sort-attributes-in-all-tags-by-name?forum=xmlandnetfx
mentions the appended xslt file for this purpose.

If someone provides a patch this feature could be integrated in umbrello. If
xsltproc is available in the settings there could be a checkbox to enable this
support. On save first a temporay file will be created, then post processed and
saved on the requested location.
--
You are receiving this mail because:
You are the assignee for the bug.
Ralf Habacker via KDE Bugzilla
2016-06-03 08:12:38 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=363582

--- Comment #5 from Ralf Habacker <***@freenet.de> ---
Here are some details from the Qt bug tracker
https://bugreports.qt.io/browse/QTBUG-28892
--
You are receiving this mail because:
You are the assignee for the bug.
Christian David via KDE Bugzilla
2016-06-17 09:40:52 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=363582

Christian David <christian-***@web.de> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|CONFIRMED |RESOLVED
Resolution|--- |UPSTREAM
CC| |christian-***@web.de

--- Comment #6 from Christian David <christian-***@web.de> ---
As this should be solved in Qt and patches are in review I close this bug.
Thank you for reporting and finding the Qt bug report!
--
You are receiving this mail because:
You are the assignee for the bug.
Christian David via KDE Bugzilla
2016-06-17 11:51:05 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=363582

--- Comment #7 from Christian David <christian-***@web.de> ---
(In reply to Christian David from comment #6)
Post by Christian David via KDE Bugzilla
As this should be solved in Qt and patches are in review I close this bug.
Thank you for reporting and finding the Qt bug report!
Sorry for closing. I just noticed this bug was not filed for KMyMoney (only a
copy was forwarded to our mailing list). Please open it again if you want to.
Sorry, again.
--
You are receiving this mail because:
You are the assignee for the bug.
Ralf Habacker via KDE Bugzilla
2016-06-17 21:01:39 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=363582

Ralf Habacker <***@freenet.de> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|UPSTREAM |---
--
You are receiving this mail because:
You are the assignee for the bug.
Jack
2018-05-18 20:53:17 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=363582

Jack <***@users.sourceforge.net> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@users.sourceforge
| |.net

--- Comment #8 from Jack <***@users.sourceforge.net> ---
Is there any resolution to this? I still have the problem with KMyMoney git
master. I don't use umbrello, so I don't know if the problem remains there or
not. The QT bug looks like it was closed as "out of scope" which sounds to me
like it was NOT fixed. As my concern is with KMyMoney, do I need to open a
separate bug, or is there some way to treat this more generally?
--
You are receiving this mail because:
You are the assignee for the bug.
Ralf Habacker
2018-05-22 23:50:40 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=363582

--- Comment #9 from Ralf Habacker <***@freenet.de> ---
Currently not. In general I see several options to fix this:
1. Use the code fragment from
https://stackoverflow.com/questions/27378143/qt-5-produce-random-attribute-order-in-xml
to save an ordered way.
2. use a different xml writer
3. There is always the way to patch Qt to address this issue
4. Embed a copy of QtXml source from Qt4 and use QDomDocument from the embedded
copy
--
You are receiving this mail because:
You are the assignee for the bug.
Ralf Habacker
2018-05-28 08:58:04 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=363582
do I need to open a separate bug, or is there some way to treat this more generally?
Is suggest to open a dedicated bug in the kmymoney bug tracker because the
mentioned issue could not be solved by the umbrello project.
--
You are receiving this mail because:
You are the assignee for the bug.
Ralf Habacker
2018-07-16 23:12:20 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=363582

--- Comment #11 from Ralf Habacker <***@freenet.de> ---
363582(In reply to Ralf Habacker from comment #9)
Post by Ralf Habacker
3. There is always the way to patch Qt to address this issue
http://code.qt.io/cgit/qt/qtbase.git/tree/src/xml/dom/qdom.cpp#n4589 is the
related code fragment writing attributes. There may be a property setting
method in some of the QDom related classes to write out an alphabetic ordered
attribute list.
--
You are receiving this mail because:
You are the assignee for the bug.
Ralf Habacker
2018-07-16 23:12:35 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=363582

Ralf Habacker <***@freenet.de> changed:

What |Removed |Added
----------------------------------------------------------------------------
Blocks| |373932


Referenced Bugs:

https://bugs.kde.org/show_bug.cgi?id=373932
[Bug 373932] Fix KF5 issues
--
You are receiving this mail because:
You are the assignee for the bug.
Ralf Habacker
2018-07-16 23:18:03 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=363582

--- Comment #12 from Ralf Habacker <***@freenet.de> ---
(In reply to Ralf Habacker from comment #9)
Post by Ralf Habacker
2. use a different xml writer
The very rudimentary xml writer as shown below may be used as starting point

class KDomElement {
public:
KDomElement(const QString &name = QString()) : m_tag(name) {}

void setAttribute(const QString &name, const QString &value)
{
m_attributes.append(QString("%1=\"%2\"").arg(name, value));
}
// add more methods

void appendChild(KDomElement &element)
{
m_childs.append(element);
}

QString toString() const
{
if (m_childs.size() > 0) {
QString s = !m_tag.isEmpty() ? QString("<%1 %2>\n").arg(m_tag,
m_attributes.join(" ")) : "";
foreach(const KDomElement &child, m_childs) {
s += child.toString();
}
s += !m_tag.isEmpty() ? QString("</%1>\n").arg(m_tag) : "";
return s;
} else
return !m_tag.isEmpty() ? QString("<%1 %2 />\n").arg(m_tag,
m_attributes.join(" ")) : "";
}

protected:
QString m_tag;
QStringList m_attributes;
QList<KDomElement> m_childs;
};

class KDomDocument : public KDomElement {
public:
KDomDocument(const QString &name=QString())
: KDomElement(name)
{
}

KDomElement createElement(const QString &name)
{
return KDomElement(name);
}
};
--
You are receiving this mail because:
You are the assignee for the bug.
Loading...