You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by "Beton, Richard" <ri...@roke.co.uk> on 2004/07/15 20:30:30 UTC

Separate CSS Engine?

Hi all,

I have a question for Batik developers.  I have been using a subset of 
Batik for a simple diagram drawing application, based on a limited 
subset of SVG.  In my project, the CSS engine has proved very useful.  I 
have a suggestion regarding it.

The CSS engine appears to be tightly coupled within Batik, in the sense 
that it has deep understanding of CSS properties of SVG documents.  
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.  One main dependency 
in the Batik CSSEngine class appears to be the CSSConstants class, which 
lists the SVG CSS properties. 

Is this a good idea?
Is there a roadmap for future Batik development that might have this added?

For my application, the CSS engine is very useful as it is.  It limits 
me to using [a subset of] SVG because of the SVG coupling, but that's 
not been a problem.

Regards,
Rick :-)


-- 

Visit our website at www.roke.co.uk

Roke Manor Research Ltd, Roke Manor, Romsey, Hampshire SO51 0ZN, UK.

The information contained in this e-mail and any attachments is confidential to
Roke Manor Research Ltd and must not be passed to any third party without
permission. This communication is for information only and shall not create or
change any contractual relationship.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: Separate CSS Engine?

Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi Beton,

Beton, Richard wrote:

>>   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.
> 
> Sorry if I didn't make my point clear: I actually used SVG (albeit only 
> a subset) because using another XML grammar would have been difficult.  
> Hence the request.

    What would have been difficult?

    Have you taken a look at how the SVGCSSEngine configures the
CSS support for SVG?  You should be able to do the same thing for
any set of properties fairly simply.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: Separate CSS Engine?

Posted by "Beton, Richard" <ri...@roke.co.uk>.
>   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.


Sorry if I didn't make my point clear: I actually used SVG (albeit only 
a subset) because using another XML grammar would have been difficult.  
Hence the request.

Cheers,
Rick :-)

-- 

Visit our website at www.roke.co.uk

Roke Manor Research Ltd, Roke Manor, Romsey, Hampshire SO51 0ZN, UK.

The information contained in this e-mail and any attachments is confidential to
Roke Manor Research Ltd and must not be passed to any third party without
permission. This communication is for information only and shall not create or
change any contractual relationship.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: Separate CSS Engine?

Posted by Thomas DeWeese <Th...@Kodak.com>.
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: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: Separate CSS Engine?

Posted by Cameron McCormack <ca...@aka.mcc.id.au>.
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.

-- 
Cameron McCormack
|  Web: http://mcc.id.au/
|  ICQ: 26955922

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: Separate CSS Engine?

Posted by Jamie Browning <ja...@exponent.co.uk>.
>  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.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org