From: Dave P. <dav...@gm...> - 2005-12-12 15:03:42
|
I'm stuck trying to determine whether to start in 1.0 or 2.0. My only solution is to use a different mode (minor mode perhaps?) for each. I.e. No point in searching within the initial file, since it has been determined at that time? I don't really want to use xyz.xsl1 and xyz.xsl2 i.e. depend on the filenam= e. Is M-x xslt1-mode and M-x xslt2-mode a reasonable approach? TIA -- Dave Pawson XSLT XSL-FO FAQ. http://www.dpawson.co.uk |
From: xslide S. <xsl...@me...> - 2005-12-12 23:45:45
|
Dave Pawson <dav...@gm...> writes: > I'm stuck trying to determine whether to start in 1.0 or 2.0. > My only solution is to use a different mode (minor mode perhaps?) > for each. It seems to me that there are two separate problems that need solving: - Whether to use XSLT 1.0 or XSLT 2.0 font-lock, abbrevs, etc. for a particular .xsl file. - What content to insert in a new .xsl file. The first can be solved by a regexp or function that identifies the "version" attribute (or its absence). The second can be solved by setting `xsl-initial-stylesheet-file' to point to the appropriate file. Which would be fine for a person making a clean change from creating new XSLT 1.0 files to new XSLT 2.0 files, but still not so good if you still need to create both. Would it be better to support a list of template files, similar to the list of XSLT processors available to `xsl-process'? The user would then have the option of choosing the best initial file for the job, e.g., XSLT 1.0 producing HTML, XSLT 2.0 producing XML, etc. > I.e. No point in searching within the initial file, since it has been > determined at > that time? > > I don't really want to use xyz.xsl1 and xyz.xsl2 i.e. depend on the filename. > > Is M-x xslt1-mode and M-x xslt2-mode > a reasonable approach? No, because it gets in the way of using the extension to recognise the file mode. Regards, Tony. p.s. I am on vacation from 15th December to 10th January, inclusive, and won't be responding to email. |
From: Dave P. <dav...@gm...> - 2005-12-13 10:04:09
|
On 13/12/05, xslide Support <xsl...@me...> wrote: > It seems to me that there are two separate problems that need solving: > > - Whether to use XSLT 1.0 or XSLT 2.0 font-lock, abbrevs, etc. for a > particular .xsl file. > > - What content to insert in a new .xsl file. > > The first can be solved by a regexp or function that identifies the > "version" attribute (or its absence). +1 Though there is a 90% overlap. > > The second can be solved by setting `xsl-initial-stylesheet-file' to > point to the appropriate file. Which would be fine for a person > making a clean change from creating new XSLT 1.0 files to new XSLT 2.0 > files, but still not so good if you still need to create both. This is the problem I was addressing. I open emacs and want to create a new file. I need to be able to choose 1 or 2. Current xslide does it by file name extension. I use .xsl for both 1.0 and 2.0 > > Would it be better to support a list of template files, similar to the > list of XSLT processors available to `xsl-process'? The user would > then have the option of choosing the best initial file for the job, > e.g., XSLT 1.0 producing HTML, XSLT 2.0 producing XML, etc. My *personal* choice is for output method=3D'xml' yet with full html element, head content and body content, also with a default template. It's easier to delete content than to add it? The real differentiator is a) the xslt 2.0 namespaces b) the version. For myself, I'd be happy to have the remainder remain the same. Thinks. How about a command line that makes the modifications to the header of the file, rather than loading a choice in at load time? It's brittle, in that if I change the header, it could break. I.e. Always load xslt 1.0 template. M-x ??? something updates the file to reflect the 2.0 template (or perhaps even loads a new template instead of the 1.0 one) The latter sounds more user friendly. Thoughts? > > Is M-x xslt1-mode and M-x xslt2-mode > > a reasonable approach? > > No, because it gets in the way of using the extension to recognise the > file mode. > p.s. I am on vacation from 15th December to 10th January, inclusive, > and won't be responding to email. Noted. Hope you have a nice break Tony. regards -- Dave Pawson XSLT XSL-FO FAQ. http://www.dpawson.co.uk |
From: Dave P. <dav...@gm...> - 2005-12-13 11:45:42
|
A starter for ten. (if (/=3D (point-min) (point-max)) (if (y-or-n-p "Warning: loading file into non-empty buffer. yes to continue") =09(progn =09 (erase-buffer) =09 (insert-file-contents xsl-initial-stylesheet-file) =09 ) ) ) It should be relatively easy to mod the xsl-initial-stylesheet-file from 1.0 to 2.0. format. Just leaves selecting one from 'tother. regards -- Dave Pawson XSLT XSL-FO FAQ. http://www.dpawson.co.uk |