> Should this be considered a bug? Shouldn't the CSS property be
> overwritten by setting the presentation attribute?
> I wasn't able to find anything about style method priority in the SVG
> specs but it would seem logical to me that the last set method should
> be the one that's used.

No, Batik's behavior seems to be the expected according to the specification:
  «In general, this means that the presentation attributes have lower
priority than other CSS style rules specified in author style sheets
or style attributes.» [1]


> Unfortunately I don't have any control over the property style being
> used in the SVG file I get.

That's going to be a problem... Jwatt suggested while ago that CSS
attributes were avoided whenever possible [2], possibly also for this
reason - I've fight with this in the past myself... :-|


>  Since more properties could be included in
> the style attribute, is it possible to change just the one CSS
> property without having to do string (followed by attribute)
> replacements on the style attribute?

Not that I'm aware of. Batik does provide a set of CSS manipulation
utility classes, although I'm not sufficiently familiar with them to
redirect you towards the proper location: crawling for
"org.apache.batik.css" in the javadoc [3] may help; also, search for
"useCSS" in the SVG Generator how-to [4] for a few samples and
possible ideas.


> Basically kind of like it's
> possible in JavaScript (element.style.property = ...). I was of the
> opinion that this was possible in Batik but I can't seem to find out
> how.

This seems to be specific to JavaScript-in-HTML or to a browser
(Firefox?), although I haven't investigated further to clarify. In
SVG, you typically manipulate the DOM, either within the SVG scope
using ECMAScript [5] or outside the SVG scope using the framework's
dialect (for Batik, this corresponds to Java [6]). I'm not sure if SVG
by itself has such DOM access to CSS attributes...


> Yours,
> Age Bosma

Hope this helps,
 Helder Magalhães


[1] http://www.w3.org/TR/SVG/styling.html#UsingPresentationAttributes
[2] http://jwatt.org/svg/authoring/#the-style-attribute
[3] http://xmlgraphics.apache.org/batik/javadoc/
[4] http://xmlgraphics.apache.org/batik/using/svg-generator.html#howToUse
[5] http://xmlgraphics.apache.org/batik/using/scripting/ecmascript.html
[6] http://xmlgraphics.apache.org/batik/using/scripting/java.html

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to