
Dear oxygenxml.com, Thank you, Gerrit and Octavian, for the quick and helpful responses. Thanks to your advice, which helped me understand when and how <oXygen/> updates the dependencies when using master files, I realized both why the problem was happening and—alas!—that in an effort to simplify the description when I wrote for advice, I had unwittingly omitted a decisive detail. Octavian writes: The master files graph is updated automatically when you save a file from the editing area. Therefore, when you add the "xsl:import" instruction in the master file, the module should be added in the graph and validated correctly. If a module is not detected correctly, you can also try to refresh the Master Files folder from the Project view. For this you can use the "Refresh" action from the Project view contextual menu. I described my workflow as having a master file (a.xsl) that imports a library of functions (lib.xsl) and some subsidiary files that contain only templates (b.xsl, c.xsl, etc.). The issue was that the template files use functions declared in lib.xsl, but the template files do not import lib.xsl directly. Since the template files are intended to be used only as imports into a.xsl, and a.xsl imports lib.xsl, this means that the library functions are available when I run a real transformation. The problem I reported was that when I created a new template file to be imported, <oXygen/> was raising errors about unknown functions in it, although older template files that used the same functions did not raise those errors. This led me to understand that <oXygen/> was able to learn about the dependency hierarchy, but that that didn't happen automatically and completely whenever I created a new template file to be imported. What I left out, because I did not recognize its importance at the time, is that the import is mediated; a.xsl imports only lib.xsl and an auxiliary file (let's call it aux.xsl), which consists entirely of <xsl:import> instructions to import b.xsl, c.xsl, etc. The intermediary step is based on https://www.oxygenxml.com/archives/xsl-list/201510/msg00002.html; I want to import everything in the modules directory without having to mention them all explicitly, so I run a preprocessing XSLT script that creates aux.xsl, and a.xsl then imports that. This means, I now realize (funny how obvious things can be in retrospect!), that of course 1) I have to rerun the preprocessing script to update aux.xsl every time I create a new template file to be imported, and 2) <oXygen/> will not know that this file has been imported if it is not watching it. Keeping it open in <oXygen/> and ensuring that it reloads/refreshes each time I rerun the preprocessing script fixes the problem. This all makes perfect sense ... er ... in retrospect. Best, David djbpitt@gmail.com
participants (1)
-
David Birnbaum