Open agarny opened 9 years ago
Thanks, I'll have a look and report back here.
On 29 September 2015 at 15:16, Alan Garny notifications@github.com wrote:
I have been using ctop[ff].xsl for quite some time and I have found it to be very useful (so thanks a lot for it indeed!), but I have recently come across what I believe are some issues with the unary/binary minus operator.
I have thus found some issues with the following equations:
a=-(b+c)+d
<?xml version="1.0" encoding="UTF-8"?>
which gets converted to:
and renders as:
a=-b+c+d
A couple of other equations that don't get converted properly are:
a=-(b*c)+d ---> a=-c+d a=d-(b+c) ---> a=d-b+c
Then, we have the following equations that keep their unnecessary parentheses after conversion:
a=-(b*c) ---> a=-(bc) a=-(b/c) ---> a=-(b/c)
I am no XSL expert, but I have come up with a version of your ctop[ff].xsl file that addresses all of the above points. I wouldn't be surprised if there was a better way of doing things, so feel free to suggest a better solution.
Here https://github.com/opencor/opencor/blob/250187784368149b55bc1d8f7126184f4ed4fd90/src/plugins/miscellaneous/Core/res/web-xslt/ctopff.xsl is the version of your ctop[ff].xsl that I am currently using in my project. As you will see, besides my 'fixes', I have also made a few other modifications to your original ctop[ff].xsl file, but they don't affect the issue at hand (I tested the above equations using both your and 'my' version of your ctop[ff].xsl file).
— Reply to this email directly or view it on GitHub https://github.com/davidcarlisle/web-xslt/issues/5.
FWIW, I have come across another issue (still related to the minus operator; see https://github.com/opencor/opencor/issues/774). In any case, here is the version of ctopff.xsl
that I am now using.
I have been using
ctop[ff].xsl
for quite some time and I have found it to be very useful (so thanks a lot for it indeed!), but I have recently come across what I believe are some issues with the unary/binary minus operator.I have thus found some issues with the following equations:
which gets converted to:
and renders as:
A couple of other equations that don't get converted properly are:
Then, we have the following equations that keep their unnecessary parentheses after conversion:
I am no XSL expert, but I have come up with a version of your
ctop[ff].xsl
file that addresses all of the above points. I wouldn't be surprised if there was a better way of doing things, so feel free to suggest a better solution.Here is the version of your
ctop[ff].xsl
that I am currently using in my project. As you will see, besides my 'fixes', I have also made a few other modifications to your originalctop[ff].xsl
file, but they don't affect the issue at hand (I tested the above equations using both your and 'my' version of yourctop[ff].xsl
file).