GNOME Bugzilla – Bug 743202
XSLT language description misses elements from XSLT v2.0
Last modified: 2015-03-06 10:43:19 UTC
Created attachment 294920 [details] git patch for missing xslt2 elements xslt.lang file contains list of XSLT v1.0 elements, but XSLT v2.0 are missing. Attached patch resolves this issue. I have commit rights to gnome git, but I would like to get approval, before pushing such changes.
Can you attach a git format-patch? It is easier to review the changes
Created attachment 294925 [details] [review] git patch for missing xslt2 elements The ACTUAL patch, not the full file.
Review of attachment 294925 [details] [review]: I suggest to make a separate context with the same style-ref <context id="xslt2-elements" once-only="true" style-ref="element"> this way it would be easier to disable for people who need to stick to xslt1
Created attachment 296344 [details] [review] XSLT2 support with seperate context Not sure if done right, but works on my machine.
Review of attachment 296344 [details] [review]: Looks good, thanks
Review of attachment 296344 [details] [review]: I pushed the patch
This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version. After your distribution has provided you with the updated package - and if you have some time - please feel encouraged to verify the fix by changing the status of this bug report to VERIFIED. If the updated package does not fix the reported issue, please reopen this bug report.
Latest patch doesn't work with tags <import-schema> and <for-each-group>. It seems the reason is, that XSLT 1.0 version has tags <import> and <for-each>, which are parsed first. If XSLT 2.0 is parsed first, which would solve the issue for the first two tags, but would fail on <namespace-alias> tag in XSLT 1.0, because XSLT 2.0 has a tag <namespace>. I don't see an elegant way to solve this issue AND satisfy the requirement to separate XSLT v1.0 and v2.0. Attachment 294925 [details] doesn't have this bug.
Why not grouping the XSLT 2.0 keywords at the bottom of the 'elements' context? I think the keywords don't need to be sorted alphabetically.
See comment #8. If we just add XSLT 2.0 at the end, <for-each-group> and <import-schema> won't highlight properly.
Ok, so the order of the keywords are important inside a container. Then I guess the only solution is to apply the first version of the patch. Can you create a commit for that that applies on top of master (that is, when the second patch is already applied)?
I believe it is better to revert last patch and then apply the right one. I believe it makes cleaner git history, possible cherry-picking and any other reverts.
Commit reverted: https://git.gnome.org/browse/gtksourceview/commit/?id=7c67bfbb7ba4d13a95b299a16c4719ca1794a9e4 And first patch pushed: https://git.gnome.org/browse/gtksourceview/commit/?id=edfb5c7974301804a35d055b652f0fa83c306d06 So only the latest commit needs to be reverted to come back to XSLT 1.0.