Alexey Harlamov wrote:
Hello, all!
I use Batik CSS engine to visualize XML documents. It can be easily separated from other Batik packages. But there is a problem with it. The CSS engine requires that DOM stylable elements implement the CSSStylableElement interface.
Well, yah - otherwise how do you get at CSS?
In some cases it can't be realized, as DOM implementation can't be modified. In my situation I "hacked" the batik implementation to workaround the problem. But it is not a clear way. It will be very helpful to introduce a special abstraction layer that allows use the engine with any DOM implementation.
I don't understand what this would mean - create a new DOM referencing the old? What about handling modifications in the old DOM that effect CSS? Does the old DOM support DOM Events?
Why not just clone the document into the Batik DOM implementation and use that for CSS access?
Something like Eclipse's adapters technique can be used.
I'm not familar with these. Are they wrappers? Take an object and reference it for most stuff and add a few extra features. So you reference original node for getAttr, etc, but add getProperty and friends?
-----Original Message-----
From: Thomas DeWeese [mailto:[EMAIL PROTECTED] Sent: Monday, July 19, 2004 6:25 AM
To: Batik Users
Subject: Re: Separate CSS Engine?
Hi all,
Like Cameron I think that this is essentially already done. The list of constants in CSSConstants is just for convenience, Except for a small number those constants aren't used by the CSSEngine. You can easily configure your own subclass of CSSEngine to support any set of properties you want.
I don't think the small space savings afforded by separating the constants is really all that useful but if someone wants to produce a patch they could.
Since you say you have already applied the CSS engine to another XML grammar I suspect that I may be missing something important in your request.
Cameron McCormack wrote:
Jamie Browning:
However, as an XML utility, the CSS engine could stand alone. Applying CSS to an XML document is a general task, not limited to SVG. A standalone CSS engine might be useful for other developers working with XML and CSS, using other XML dialects.
To achieve this, the properties supported by the engine would need to
be decoupled, perhaps using some pluggable mechanism.
I think this is an excellent idea.
And also not very difficult, since the CSS engine really isn't very coupled to the rest of Batik. See how the SVGCSSEngine class extends the abstract CSSEngine to add the managers for all of the types that
SVG
supports.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
