XSLT "effects" extensions don't work (not implemented?)

Bug #177387 reported by Vaughn Iverson
6
Affects Status Importance Assigned to Milestone
Inkscape
Triaged
Wishlist
Unassigned

Bug Description

Version 0.46 is reported to have working XSLT input, output and effects extensions (yay!)
For example, here: http://wiki.inkscape.org/wiki/index.php/ReleaseNotes046#XSLT_effects

But I tried to write a simple "effect" extension tonight, using the aisvg.xslt input filter as a template, but I could not get the most recent dev build of 0.46 to recognize it at all.
The symptom is no menu item "Test" shows up under Effects:Text where it should. Inkscape logs no messages about this in extension-errors.log where I would expect it to.
The build I used is: "Inkscape 0.46dev+devel, built Dec 18 2007" on Windows XP.

Upon further inspection, it appears that only the Inkscape::Extension::Implementation::XSLT::open() and Inkscape::Extension::Implementation::XSLT::save() methods are thus far implemented (supporting the ai input and xaml I/O using XSLT). If my reading of the code is correct, among other things, an implementation of Inkscape::Extension::Implementation::XSLT::effect(), analogous to Inkscape::Extension::Implementation::Script::effect(), will be necessary for this functionality to actually work as advertised. I hope this is done in time for 0.46, as XSLT extensions will be really great for 'quick and dirty' extending. Cheers, -Vaughn

Details of my attempted test extension below:

Here's my test.inx file (located in my share\extensions dir):

<inkscape-extension>
    <_name>Test</_name>
    <id>org.inkscape.text.test</id>
    <effect>
 <object-type>all</object-type>
        <effects-menu>
            <submenu _name="Text"/>
        </effects-menu>
    </effect>
    <xslt>
        <file reldir="extensions">test.xsl</file>
    </xslt>
</inkscape-extension>

And here's my XSLT script also located in share\extensions (This _should_ change the text of all svg:text elements to "Wow!" replacing whatever they were before).

<?xml version="1.0"?>
<xsl:stylesheet xml:space="default" version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
<xsl:output method="xml" indent="yes"/>
 <xsl:template match="/">
   <xsl:apply-templates />
 </xsl:template>
 <xsl:template match="*">
  <xsl:copy>
   <xsl:apply-templates select="@*|node()"/>
  </xsl:copy>
 </xsl:template>
 <xsl:template match="@*">
  <xsl:copy/>
 </xsl:template>
 <xsl:template match="svg:text">
  <svg:text>
   <xsl:apply-templates select="@*|node()"/>
   Wow!
  </svg:text>
 </xsl:template>
</xsl:stylesheet>

Revision history for this message
vonHalenbach (lustik) wrote :

Hello Vaughn,
thank you for your test of this prereleased version of inkscape. Your test script could be useful for the developer, who implements the XSLT extentions. Since 0.46 is not yet released we have some time to put your requested features in.

I have put this on the wishlist for a dveloper to pick it up.

Please test newer versions and put your feedback in here.

Changed in inkscape:
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Ted Gould (ted) wrote :

Wow, I didn't realize anyone was really interested in this. I'll make sure it gets in for 0.46.

Changed in inkscape:
assignee: nobody → ted-gould
milestone: none → 0.46
Revision history for this message
Vaughn Iverson (vsi) wrote :

Sweet! Thanks for the quick response. I'll definitely help test the feature once implemented, as I use both Inkscape and XSLT quite a bit. Thanks! -V

Revision history for this message
Vaughn Iverson (vsi) wrote :

Note, the XSLT code above doesn't work as advertised. I tested the following code using Xalan-J, and it works, so use it instead as a first test case if desired.
All text() elements will be replaced with "Wow!". -V

<?xml version="1.0"?>
<xsl:stylesheet xml:space="default" version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<xsl:output method="xml" indent="yes"/>
 <xsl:template match="/">
   <xsl:apply-templates />
 </xsl:template>
 <xsl:template match="*">
  <xsl:copy>
   <xsl:apply-templates select="@*|node()"/>
  </xsl:copy>
 </xsl:template>
 <xsl:template match="@*">
  <xsl:copy/>
 </xsl:template>
 <xsl:template match="text()">
  <xsl:text>"Wow!"</xsl:text>
 </xsl:template>
</xsl:stylesheet>

Revision history for this message
Bryce Harrington (bryce) wrote :

Ted, how is the progress on this one coming along? If it cannot be done in time for the upcoming 0.46 release, let's drop the milestone.

Revision history for this message
Bryce Harrington (bryce) wrote :

No response, so dropping milestone.

Changed in inkscape:
milestone: 0.46 → none
Revision history for this message
Ted Gould (ted) wrote : Re: [Bug 177387] Re: XSLT "effects" extensions don't work (not implemented?)

On Sat, 2008-02-09 at 18:12 +0000, Bryce Harrington wrote:
> No response, so dropping milestone.

Sorry, I blame Evolution filters in Hardy ;)

This one shouldn't be hard. But, is not high enough priority to
milestone for the release. Hopefully it should hit shortly after.

jazzynico (jazzynico)
tags: added: extensions-plugins
Revision history for this message
jazzynico (jazzynico) wrote :

@Ted Gould - Are you still working on this wishlist? If not, could you give a clue on what needs to be done to finish it?
Thanks!

Changed in inkscape:
status: Confirmed → Triaged
Ted Gould (ted)
Changed in inkscape:
assignee: Ted Gould (ted) → nobody
Revision history for this message
AndreR (andre-r) wrote :

I have another problem with exporting XAML files. I just tried to convert "dialog-ok-apply-5.svg" from the Open Icon Library to XAML. The plugin seems to add an effect reference, but the effect description is missing.

Here is the corresponding line:

<Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Name="path3509" StrokeThickness="8" Stroke="{StaticResource radialGradient3511}" StrokeMiterLimit="4" StrokeLineJoin="Round" StrokeStartLineCap="Round" StrokeEndLineCap="Round" Effect="{StaticResource filter3521}" Opacity="0.28571428999999998">

There is no static resource "filter3521" in the entire file, though, which lets my program crash:

Zeilennummer "238" und Zeilenposition "247" von "Die Angabe eines Werts für "System.Windows.StaticResourceExtension" führte zu einer Ausnahme.".

Line "238" and line position "247" of "Declaring a valuation for "System.Windows.StaticResourceExtension" led to a exception.".

And here is the inner exception:

Cannot find resource named 'filter3521'. Resource names are case sensitive.

I attatched you the original SVG as well as the exported XAML file, created with a last week's nightly build.

Revision history for this message
AndreR (andre-r) wrote :

Sorry, only one attachment per post. See above.

Revision history for this message
jazzynico (jazzynico) wrote :

@AndreR - Note that filters are not fully supported (only blurs, see http://wiki.inkscape.org/wiki/index.php/SpecXAMLExport). But the XAML exporter should remove the Effect attribute. I'll see if it can be fixed for the next Inkscape version.

Revision history for this message
jazzynico (jazzynico) wrote :

Also note that your bug has nothing to do with the original report, and should have been reported separately. I've created a new follow-up report here: Bug #1243394 "XAML exporter doesn't remove unnecessary filters attributes" <https://bugs.launchpad.net/inkscape/+bug/1243394>

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.