Author complains if processing instructions are displayed an

Having trouble installing Oxygen? Got a bug to report? Post it all here.
dcramer
Posts: 161
Joined: Sat Aug 28, 2010 1:23 am

Author complains if processing instructions are displayed an

Post by dcramer »

Hi there,
Using DocBook 5.x, if I change the css so that processing instructions are displayed:

Code: Select all

oxy|processing-instruction {
display:inline !important;
}
And I have a document in which processing instructions occur as children of <table> elements, then Oxygen complains:

Code: Select all

SystemID: /home/dcramer/workhead-gitsvn/nac/branches/7.1/en_US/naug/naug.xml
Severity: warning
Description: [Author layout]:Cannot create a table. A table element cannot contain children other than elements and comments.
It would be better to treat processing instructions like comments. In this case, I need to put a <?keep-together?> PI as a child of certain tables.

For now, I've added a second rule just for tables:

Code: Select all

table>oxy|processing-instruction {
display:none !important;
}
But I'd prefer to display those PIs too.

Thanks,
David
Radu
Posts: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: Author complains if processing instructions are displayed an

Post by Radu »

Hi David,

Author imposes a strict layout on tables in order to display them.
Indeed comments are ignored and tables can be constructed even if they have comments between rows but those comments will not be visible in the Author page.
Can you show me a small Docbook 5 sample in order to see where exactly the processing instruction occurs?

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
dcramer
Posts: 161
Joined: Sat Aug 28, 2010 1:23 am

Re: Author complains if processing instructions are displayed an

Post by dcramer »

Sure, here's an example:

Code: Select all


<table frame="all" pgwide="1" xml:id="bgbcechd">
<info>
<title>Detected problems summary</title></info>
<?bjfo keep-together?>
<tgroup cols="14">
...
I use that PI if I have a short table and I don't want ever to be split across pages.

David
dcramer
Posts: 161
Joined: Sat Aug 28, 2010 1:23 am

Re: Author complains if processing instructions are displayed an

Post by dcramer »

Btw., in the case of my example, Author displays the PI just fine, but complains about it.

David
Radu
Posts: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: Author complains if processing instructions are displayed an

Post by Radu »

Thanks for the additional details.
Indeed it seems that the warning in this case should not be issued.
We'll look into it.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Radu
Posts: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: Author complains if processing instructions are displayed an

Post by Radu »

Hi David,

As a workaround in the docbook.css you can set:

Code: Select all

table{
display:block;
}
as most Docbook cals tables are actually block elements which contain the real table tgroup inside them.

A fix for this warning will probably be available in Oxygen 12.2.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
dcramer
Posts: 161
Joined: Sat Aug 28, 2010 1:23 am

Re: Author complains if processing instructions are displayed an

Post by dcramer »

That workaround does the trick.

Thanks,
David
dcramer
Posts: 161
Joined: Sat Aug 28, 2010 1:23 am

Re: Author complains if processing instructions are displayed an

Post by dcramer »

Hi there,
This workaround no longer works for 12.2 beta. When I display PIs in tables, the tables are no longer formatted correctly (both CALS and HTML tables).

Below are a couple of sample tables with PIs:

Code: Select all

      <table
frame="all">
<title>Sample table cals</title>

<tgroup cols="2">
<?rax-fo keep-together?>
<colspec colname="c1" colnum="1" colwidth="1.0*"/>
<colspec colname="c2" colnum="2" colwidth="1.0*"/>
<thead>
<row>
<entry>adfdsf<?dbfo orientation="-90"?>
<?dbfo rotated-width=".95in"?></entry>
<entry/>
</row>
</thead>
<tbody>
<row>
<entry/>
<entry/>
</row>
<row>
<entry/>
<entry/>
</row>
<row>
<entry/>
<entry/>
</row>
</tbody>
</tgroup>
</table>

<table frame="box">
<?rax-fo keep-together?>
<caption>Sample table</caption>
<col width="1.0*"/>
<col width="24.01*"/>
<thead>
<tr>
<?dbfo orientation="-90"?>
<?dbfo rotated-width=".95in"?>
<th>
<para>A very long label</para>
</th>
<th>Another row</th>
</tr>
</thead>
<tbody>
<tr>
<td>Yes<?dbfo orientation="-90"?>
<?dbfo rotated-width=".95in"?></td>
<td>Foo</td>
</tr>
<tr>
<td>No</td>
<td>Bar</td>
</tr>
<tr>
<td>Yes</td>
<td>Wooga</td>
</tr>
</tbody>
</table>

Thanks,
David
Radu
Posts: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: Author complains if processing instructions are displayed an

Post by Radu »

Hi David,

Things should work in the final Oxygen 12.2 even without making the CSS change (I tested my current development snapshot with your sample). The 12.2 beta kit you have which is quite old probably does not contain the changes.

But if you have made the CSS modifications to the docbook.css from the Oxygen 12.2 beta frameworks things should have worked out nonetheless. So strange.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
dcramer
Posts: 161
Joined: Sat Aug 28, 2010 1:23 am

Re: Author complains if processing instructions are displayed an

Post by dcramer »

Indeed, I had not yet merged in the changed from the new framework.

To do a better test, I've disabled my framework and am using the stock DocBook framework. The About box says "<oXygen/> XML Author 12.2, build 2011032312" (Running on Ubuntu 11.04).

With CALS tables, everything is fine. However, with HTML tables, the behavior is as before: Adding a PI as a child of table or in a cell causes Author to complain and not format the table as a table.

If I add a PI as a child of table, it says:

SystemID: /home/dcramer/Documents/rax/rackspace-cloud-template/src/docbkx/example.xml
Severity: warning
Description: [Author layout]:Cannot create a table. A table element cannot contain children other than elements and comments.

If I add a PI in a th, it says:

SystemID: /home/dcramer/Documents/rax/rackspace-cloud-template/src/docbkx/example.xml
Severity: warning
Description: [Author layout]:Cannot create a table. A table row group cannot be created from element 'thead'.

Thanks,
David
Radu
Posts: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: Author complains if processing instructions are displayed an

Post by Radu »

Hi David,

I re-read the entire post again.
I have forgotten in my previous post that you have processing instructions showing in the Author page.

So the fix indeed was just for the case in which a PI appears in a CALS table (which is not actually the table as it has a <tgroup> as the real table).

I see two more cases in your sample:

1) In an HTML table a PI appears before the actual table content (somewhere near the colspans). I think we can also fix this case, I added an improvement request for it.

2) In a table row you have PIs like:

Code: Select all


<tr>
<?dbfo orientation="-90"?>
<?dbfo rotated-width=".95in"?>
<th>
.......
I don't think we can fix this one without ignoring the processing instructions completely when building the table because the PIs appear directly inside a table row and you also want to view them for editing, but showing them would mean breaking the table structure.

So I think we can fix number (1), but probably in Oxygen 13 as we are getting ready to release 12.2.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
dcramer
Posts: 161
Joined: Sat Aug 28, 2010 1:23 am

Re: Author complains if processing instructions are displayed an

Post by dcramer »

Oops. For #2, my example was bad. I meant to put those PIs inside the th (or in a td), so you don't have to worry about PIs in a tr.

Thanks,
David
Radu
Posts: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: Author complains if processing instructions are displayed an

Post by Radu »

Great :).
Visible processing-instructions/comments or other elements between cells or rows break the layout and thus will not be supported in future versions.
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Radu
Posts: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: Author complains if processing instructions are displayed an

Post by Radu »

Hi,

The first case of table + PIs will no longer break the table layout in Oxygen 13 (which will be available in a couple of weeks).

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply