Ok, that makes sense.

I can't find the .java samples referred to anywhere in my current 5.9 package 
or in the .zip file I downloaded from 
http://www.xmlmind.com/xmleditor/developer.shtml. Is there somewhere else I 
should look?

Thanks,
Jeff.

-----Original Message-----
From: Hussein Shafie [mailto:[email protected]] 
Sent: Friday, April 11, 2014 1:12 AM
To: Jeff Hooker
Cc: '[email protected]'
Subject: Re: [XXE] Using the colspec element to set table column color in the 
CSS

On 04/10/2014 10:30 PM, Jeff Hooker wrote:
>
> I've modified my DITA PDF and xhtml publishing scripts to read an 
> attribute (bg_color) from colspec, row, and entry elements and reflect 
> the defined color in the output. Now I am working on the GUI for this.
>
> In the CSS presentation layer for XMLmind, it was quite easy to write 
> commands to set the colors on the elements, and easy to make the 
> interface reflect the color chosen when the attribute is set at the 
> entry or row level. Making a whole column in a table reflect a color 
> selection made on its colspec element, however, is proving difficult. 
> I would prefer to do this in CSS somehow rather than writing a command 
> to actually add the bg_color attribute to every  individual entry in 
> the column, partly because this would involve having to re-apply it 
> every time I added a new row.
>
> Are there any widgets in XMLmind that connect entry elements with 
> their colspec elements? The xpath statement for intelligently reaching 
> backwards from each entry element and finding the right colspec 
> element is proving to be problematical.

--> It's not a widget. It's a CSS stylesheet extension (which must be
coded in Java) called "StyleSpecs".

The StyleSpecs you need computes the background color of an entry based 
on the bg_color attribute of the entry itself, its parent row, its 
colspec element (you'll define the lookup order you prefer).

References:

* http://www.xmlmind.com/xmleditor/_distrib/doc/dev/styleext.html#solution2

* 
http://www.xmlmind.com/xmleditor/_distrib/doc/api/com/xmlmind/xmledit/stylesheet/StyleSpecs.html



--> The XHTML configuration has an implementation of StyleSpecs which 
does this for style="background-color: XXX; background-image: YYY;" of 
the cols and colgroups corresponding to a td or th.

The relevant .java files are:

* src/com/xmlmind/xmleditext/xhtml/table/StyleSpecsImpl.java

* src/com/xmlmind/xmleditext/xhtml/table/TableSupport.java (registers 
StyleSpecsImpl with the CSS engine)

The implementation for XHTML is a bit complicated because it needs to 
access the CSS style of an element. What you want, based on the value of 
attribute bg_color, should be much easier to implement.






--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support

Reply via email to