Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change order of option - First removed then added elements #8

Closed
bovirus opened this issue Nov 23, 2022 · 9 comments
Closed

Change order of option - First removed then added elements #8

bovirus opened this issue Nov 23, 2022 · 9 comments

Comments

@bovirus
Copy link
Contributor

bovirus commented Nov 23, 2022

@rpeyron

Hi.

Could you please change the menu order

Display added
Dispaly removed
Display added and removed

in

Dispaly removed
Display added
Disaply removed and added

In this way show first the difference in first file then the difference in second file.
And the option are in order "show the difference in first fil"e and next option is "show differences in second file".

About to display first removed and after added could you probably change the content of the script.
Now seem viceversa

Plerase consider i a menu decription likle

Display available only in first file
Display available only in second file
Dispaly available only in first and second file

could be describe easily the functions

Thanks.

@bovirus bovirus changed the title Change of new features - First removed then added Change order of option and display - First removed then added elements Nov 23, 2022
@bovirus bovirus changed the title Change order of option and display - First removed then added elements Change order of option - First removed then added elements Nov 23, 2022
@rpeyron
Copy link
Owner

rpeyron commented Nov 24, 2022

Hello, the configuration files I provided are only examples to make easier the customization by the user to meet its specific file structure, use cases and expectations. You may edit config.xml very easily to meet your need by re-ordering and updating the concerned lines.

@rpeyron rpeyron closed this as completed Nov 24, 2022
@bovirus
Copy link
Contributor Author

bovirus commented Nov 25, 2022

@rpeyron

Before to write this I tried myself using current

filter-added-removed.xsl

xsl:variable name="filter">[@diff:status='added']|[@diff:status='removed']|[count(descendant::[@diff:status='added' or @diff:status='removed']) > 0]

in

xsl:variable name="filter">[@diff:status='removed']|[@diff:status='added']|[count(descendant::[@diff:status='removed' or @diff:status='added']) > 0]

invertinbg position of added removed but seems that didn't works.

Could you please help me to identify teh right value to use to get my scope?

Thanks.

@rpeyron
Copy link
Owner

rpeyron commented Nov 25, 2022

Hello, as mentioned in my reply above, the file you need to edit to change the menu order is config.xml.

@bovirus
Copy link
Contributor Author

bovirus commented Nov 25, 2022

@rpeyron

Please help to identify teh right value for XLS.

I change the order

xsl:variable name="filter">[@diff:status='removed']|[@diff:status='added']|[count(descendant::[@diff:status='removed' or @diff:status='added']) > 0]

replacing added and removed order but it seems that didn't works.

Thanks.

@rpeyron
Copy link
Owner

rpeyron commented Nov 25, 2022

I have missed that you wanted to change also the content of the script and not only the menu order. Please read my other comment in #9, you just have to change the order of the outputted html tables in the '/' template.

@bovirus
Copy link
Contributor Author

bovirus commented Nov 25, 2022

As I explained I change the order

original

<xsl:variable name="filter">[@diff:status='added']|[@diff:status='removed']|[count(descendant::[@diff:status='added' or @diff:status='removed']) > 0]</xsl:variable>

new version

xsl:variable name="filter">[@diff:status='removed']|[@diff:status='added']|[count(descendant::[@diff:status='removed' or @diff:status='added']) > 0]

but it seems that didn't works.

@rpeyron
Copy link
Owner

rpeyron commented Nov 26, 2022

Ok, sorry, didn't understand before reading #14 that you wanted to sort in the tree view. Not possible now. A little explanation about what you tried: In XPath syntax, | means "or", and it is used to filter the elements that match, but is won't sort them. Sorting in XSL has to be done with the tag xsl:sort, and you can use that with an external XSL file or the HTML display XSLT, but not the customizable XSLT because of the way it works: it will perform an XSLT transform on each XML node to be displayed and will expect a result of the XSLT transform as below:

<node icon="the predefined icon to be displayed" children="the XPath expression to select the children nodes">the text to be displayed on the line of the element in the tree</node>

@bovirus
Copy link
Contributor Author

bovirus commented Nov 27, 2022

@rpeyron

Please don't consider the sort option.

What's the right syntax to show as color icon befroe the elements added (red icon) and the the green icon (removed items)

Currently is viceversa.
Before the removed then added.

baecause for me is mroe logical if you compare two file (first is amster) teh second ex is translation. to see first added strings and after removed strings.

Thanks.

@rpeyron
Copy link
Owner

rpeyron commented Nov 27, 2022

I don't understand what you want, neither the difference with what you asked in #14, neiher what you ask with icons (Elements added are represented with a green icon with a "+" on it, not a red icon), nor why workarounds mentioned in #14 are not suitable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants