VideosXSLT Quick Fix Support


This video shows how you can improve the XSLT development work flow by offering fixes for errors that appear during development.


00:00:08Oxygen improves the way you edit XSLT stylesheets by offering fixes for errors that appear during
00:00:14XSLT development.
00:00:16Using the Quick Fix support you can resolve problems like missing template, misspelled
00:00:21template name, missing function
00:00:23or references to an undeclared variable or parameter.
00:00:28In our demonstration we'll use an XSLT file that contains several types
00:00:32of errors for which oXygen offers quick fixes.
00:00:35When the file is opened, oXygen automatically validates it and marks the errors in the editor.
00:00:41We'll navigate to the first error...
00:00:43When the caret is positioned on the highlighted error,
00:00:46a "red bulb" appears in the left side stripe.
00:00:49This means that the error can be resolved using the provided quick fix actions.
00:00:55The first type of error: the template does not exist
00:00:58When hovering the mouse cursor over the highlighted error,
00:01:02oXygen displays a tooltip with the error details.
00:01:04To reach the quick fix proposals list, click the "red bulb" or simultaneously press ALT
00:01:11+ 1 keys.
00:01:12In this case, the template referred in this "call-template" element does not exist.
00:01:17Also, an error description is displayed in the quick fix proposals list.
00:01:23And these are the available fixes:
00:01:25Using the first one you can create the missing template.
00:01:28The next proposals allow you to change the reference to already defined templates, all
00:01:33having similar names.
00:01:36In our case, it seems that we misspelled the template name so we choose to change its referred
00:01:42The "call-template" reference is changed and the error disappears.
00:01:52The next error is triggered by missing parameters in a call-template element.
00:01:56Click the "red bulb" to see the problem description and the proposals...
00:02:00Two parameters are not defined in the called template.
00:02:04For the first parameter, we can choose to:
00:02:061. Create a new parameter in the called template
00:02:092. Change reference to an already defined, yet-unreferenced parameter from the template
00:02:15... or
00:02:163. Remove the parameter from the call-template, in case you no longer need it.
00:02:21We'll choose to change the reference to the "prefix" parameter, already defined in the
00:02:29For the second problem, now there are available only two quick fixes.
00:02:34This is because there is no unreferenced parameter left in the called template.
00:02:38We'll choose to add a new parameter.
00:02:42Note that it has been added between the already defined parameters.
00:02:54The next error reports that the variable $nsBoxId is not declared.
00:03:00oXygen proposes a couple of solutions to fix it:
00:03:031. Create a global or local variable
00:03:062. Create a global parameter, or add a parameter in the current template
00:03:113. Refer any of the already defined variables or parameters.
00:03:17We'll choose to create a global variable.
00:03:19The variable will be added after the last variable declared in our stylesheet.
00:03:29Next, we have a function that is not defined in the stylesheet.
00:03:40From the available quick fixes we choose to create a function.
00:03:45It is created after the current template, with the number of parameters specified in
00:03:49the reference.
00:03:56Now the document is valid.
00:03:59Apart from the errors we solved, Oxygen offers quick fixes for other types of problems like
00:04:04undeclared character-map or undeclared attribute-set.
00:04:09And this concludes our demonstration.
00:04:11Thanks for watching!