[ANN] XPathView + XSLT-Support 1.0.1
Available via the Plugin Manager. Note that this version requires IDEA 5.0.1 (#3461) to be
listed in the Plugin Manager.
Changes:
- IDEA 5.0.1 compatibility
- Fixed wrong error highlighting with XML documents that have a DTD attached
- Fixed confusing tooltips for history navigation buttons
- Fixed lost focus after history navigation
- Usage View is now populated asynchronously
- Added ability to re-evaluate the expression in a Usage View (only as long as its
context node is still valid)
- Rename in XSLT no longer uses Java identifier rules
- Bundled XSLT schema from
http://www.intellij.net/forums/thread.jsp?forum=27&thread=159073&tstart=30&trange=15#4910892
- Included a quick XSLT feature-reference, accessible via the plugin's configuration dialog
Sascha
Please sign in to leave a comment.
Sascha, I still get "URI is not registered" and xsl:transform is red. I have the
latest version of the plugin. Here's my file:
<xsl:transform version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
</xsl:transform>
What do you think the problem is?
Sascha Weinreuter wrote:
It turned out I already had some binding in Resources for a file that didn't
exist (in ~/Library/Preferences/something, so IDEA must have put it there
sometime). Maybe your plugin should check for this, but probably not.
Keith Lea wrote:
>> Available via the Plugin Manager. Note that this version requires IDEA
>> 5.0.1 (#3461) to be
>> listed in the Plugin Manager.
>>
>> Changes:
>> - IDEA 5.0.1 compatibility
>> - Fixed wrong error highlighting with XML documents that have a DTD
>> attached
>> - Fixed confusing tooltips for history navigation buttons
>> - Fixed lost focus after history navigation
>> - Usage View is now populated asynchronously
>> - Added ability to re-evaluate the expression in a Usage View (only
>> as long as its
>> context node is still valid)
>> - Rename in XSLT no longer uses Java identifier rules
>> - Bundled XSLT schema from
>> http://www.intellij.net/forums/thread.jsp?forum=27&thread=159073&tstart=30&trange=15#4910892
>>
>> - Included a quick XSLT feature-reference, accessible via the
>> plugin's configuration dialog
>>
>> Sascha
Keith Lea wrote:
Thanks for the note Keith. The plugin will check this during startup and print a warning
to the log file.
BTW: The currently released version of the plugin will probably not recognize your file
because its root tag is "template", but it expects it to be "stylesheet". This is 100%
compatible though and will be fixed in the next release.
Sascha
Have you thought about providing some way of using a sample file to enable more
completion in xslt files? For example, select="/[ctrl+space]" would show me
all root elements in the sample file. I think this would be very cool if done right.
Sascha Weinreuter wrote:
>>It turned out I already had some binding in Resources for a file that
>>didn't exist (in ~/Library/Preferences/something, so IDEA must have put
>>it there sometime). Maybe your plugin should check for this, but
>>probably not.
Also, have you thought of adding an action to apply some stylesheet in the
project to some xml file, and show the result in a temporary editor (or save the
result)? This would be cool too.
Sascha Weinreuter wrote:
>>It turned out I already had some binding in Resources for a file that
>>didn't exist (in ~/Library/Preferences/something, so IDEA must have put
>>it there sometime). Maybe your plugin should check for this, but
>>probably not.
I'm trying to convert IDEA's ActionManager.xml to an HTML file with an XSL
stylesheet. I don't know almost anything about XSL. I have this file:
IntelliJ IDEA Plugin API: Action ID's
The xsl:* tags anywhere inside the xsl:template are marked in red, but when I
run the stylesheet through xsltproc, it doesn't say the stylesheet is invalid
(but the output is not what I want). Is this a plugin bug or am I doing
somethign wrong?
Sascha Weinreuter wrote:
>>It turned out I already had some binding in Resources for a file that
>>didn't exist (in ~/Library/Preferences/something, so IDEA must have put
>>it there sometime). Maybe your plugin should check for this, but
>>probably not.
Keith Lea wrote:
Yes, I'm thinking of creating the ability to define run-configurations that run a certain
stylesheet with a configured or choosable XML document. But that isn't definitive yet,
I'll first have to finished some other cool stuff ;)
Sascha
Keith Lea wrote:
I haven't had a good idea yet how to associate such a sample file, but I was thinking
about using the schemas from other declared namespaces (if there are any). But I haven't
really looked at it and don't know if it's feasible. Do you have an idea how to associate
a sample file with a stylesheet? A processing instruction maybe?
<?default-input-file href="..." ?>
Or some other kind of configuration? What do you think?
Sascha
That sounds cool and important, but it would also be great to have something
simpler, where I could just click the file, click "Apply to XML file," click the
other file, and see the result immediately.
Sascha Weinreuter wrote:
>>Also, have you thought of adding an action to apply some stylesheet in
>>the project to some xml file, and show the result in a temporary editor
>>(or save the result)? This would be cool too.
Keith Lea wrote:
No, the plugin doesn't color any tags itself, this is solely done by IDEA's DTD/Schema
support. This is also what the problem is: Because of your namespace declaration, IDEA
uses the DTD to validate the file, which doesn't allow any elements from other namespaces.
Use the real XHTML namespace URI instead (http://www.w3.org/1999/xhtml) which points to
the XHTML schema and it should be OK.
I just tested it with the correction and IDEA now complains "Failed to read schema
document 'null' ...". Don't know what the reason is. I could swear I've seen that working
with earlier builds...
Sascha
I actually think maybe some simple, dumb UI thing like a context menu item on
the xsl file, and an editaable list of sample files which are just stored in
project config. What do you think of that? The processing instruction sounds
fine too, but messier.
Sascha Weinreuter wrote:
>>Have you thought about providing some way of using a sample file to
>>enable more completion in xslt files? For example,
>>select="/[ctrl+space]" would show me all root elements in the sample
>>file. I think this would be very cool if done right.
Sascha Weinreuter wrote:
>>The xsl:* tags anywhere inside the xsl:template are marked in red, but
>>when I run the stylesheet through xsltproc, it doesn't say the
>>stylesheet is invalid (but the output is not what I want). Is this a
>>plugin bug or am I doing somethign wrong?
I get the same error. I've filed http://jetbrains.net/jira/browse/IDEA-5314
about it.
Keith Lea wrote:
Yes, that's probably the easiest way since this won't change too often once it is
configured for the first time per file. I'll put it on on the todo-list.
I don't like the idea to store IDE-specific stuff in code, but since this is already
present as annotations/@noinspection tags, I might consider it if it's requested.
Sascha
Keith Lea wrote:
Hmm, depends on what "click the other file" would actually look like... Do you mean to
choose a file that is already opened in another editor and display some kind of popup menu
to select it? Or just open a file chooser? Wouldn't that be too inconvenient though? XSLT
files are usually run more than once or twice while developing them...
Maybe this could be combined with the ability to associate XML files for completion
purposes, which would make it possible to one-click run the stylesheet with the associated
input file. Doesn't sound too bad either.
Sascha
Sascha Weinreuter wrote:
>>That sounds cool and important, but it would also be great to have
>>something simpler, where I could just click the file, click "Apply to
>>XML file," click the other file, and see the result immediately.
Maybe you should make it very easy to create a run configuration (like with the
context menu like we said), and that will solve the problem.