CALS Table CSS Question
Oxygen general issues.
-
- Posts: 3
- Joined: Wed May 07, 2014 7:17 pm
CALS Table CSS Question
Need assistance with a issue in Author display for CALS table. In the sample code below there are two ROWs. The second row has an <EFFECT> prior to the first <ENTRY>. In Author when ROW > EFFECT encountered I need a blank row between the two rows where a text string can be displayed. The table formatting should be removed for that row and then resumed when ROW > ENTRY started. Can this be done with just Author CSS.
Display should look something like this in Author mode:
Code: Select all
<ROW>
<ENTRY><PARA>Cell 1</PARA> </ENTRY>
<ENTRY><PARA>Cell 2</PARA> </ENTRY>
<ENTRY><PARA>Cell 3</PARA> </ENTRY>
</ROW>
<ROW>
<EFFECT EFFRG="001999"/>
<ENTRY><PARA>Cell 1a</PARA> </ENTRY>
<ENTRY><PARA>Cell 2a</PARA> </ENTRY>
<ENTRY><PARA>Cell 3a</PARA> </ENTRY>
</ROW>
Code: Select all
|Cell 1|Cell 2|Cell 3|
EFFECT: 001999
|Cell 1a|Cell 2a|Cell 3a|
-
- Posts: 1017
- Joined: Wed Nov 16, 2005 11:11 am
Re: CALS Table CSS Question
Post by alex_jitianu »
Hello,
It can't be done by CSS alone. There are some workarounds but they all require more or less working with our Java based API:
1. The base idea of this approach is to transform the initial table structure into a different one when opening the document. Either breaking it into two tables or inserting another row with the EFFECT element that spans over all columns. The user works on this structure and when the document is saved, you transform the table back to its original structure.
To do that you can use a custom protocol to open the document you can change the content loaded by the author page and on save, you can change it back. The most complex part here is that you have to read the XML file yourself in this protocol implementation and transform the table into something else (our API wont help you with that). For example you could parse it using DOM, change the DOM and serialize it into a temporary file.Then return a stream from that temporary file to be loaded into Oxygen. On save, you'll have to do the round trip. A sample custom protocol implementation that can be a good starting point can be download from here.
2. In Oxygen you can use form controls to edit attributes or the text content of an element (the element you are adding the form control on). Your situation is little different though as you don't want the EFFECT element to be present in the table layout (at least not as a cell). So the first step is to hide it using CSS:
,implement a custom form control and add it on the first ENTRY. This custom form control will edit this hidden EFFECT. You can start from the source code of one of our built-in form controls (I can send you the source code) and you just have to change from where the value is taken and where it's committed. Then you'll add the form control from the CSS something like this:
It can't be done by CSS alone. There are some workarounds but they all require more or less working with our Java based API:
1. The base idea of this approach is to transform the initial table structure into a different one when opening the document. Either breaking it into two tables or inserting another row with the EFFECT element that spans over all columns. The user works on this structure and when the document is saved, you transform the table back to its original structure.
To do that you can use a custom protocol to open the document you can change the content loaded by the author page and on save, you can change it back. The most complex part here is that you have to read the XML file yourself in this protocol implementation and transform the table into something else (our API wont help you with that). For example you could parse it using DOM, change the DOM and serialize it into a temporary file.Then return a stream from that temporary file to be loaded into Oxygen. On save, you'll have to do the round trip. A sample custom protocol implementation that can be a good starting point can be download from here.
2. In Oxygen you can use form controls to edit attributes or the text content of an element (the element you are adding the form control on). Your situation is little different though as you don't want the EFFECT element to be present in the table layout (at least not as a cell). So the first step is to hide it using CSS:
Code: Select all
EFFECT {
display:none;
}
Code: Select all
EFFECT + ENTRY:before{
content: oxy_editor(
rendererClassName, "com.custom.editors.CustomRenderer",
swingEditorClassName, "com.custom.editors.SwingCustomEditor"
)
}
This second solution will not look exactly like you want but it's a possibility worth mentioning.
Best regards,
Alex
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service