You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by David Shevitz <ds...@singlestep.com> on 2004/07/21 20:24:20 UTC

Adding Blind Tables for Figures

Hello all,

I realize this must be a very popular question. However, the only 
information I can find is dated nearly 2 years ago, and those solutions 
do not seem to work.

Here is my question:

I understand that if I want to keep my captions with my figures in a 
given document, I should use a "blind table." However, all the examples 
I see were posted around 2 years ago (granted I might be looking in the 
wrong place). I tried using them, but they don't seem to work.

I'm using Docbook 1.64.2. Does anyone have a suggestion or examples that 
I could use to implement this workaround?

Thanks in advance,

Dave Shevitz

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


Re: xml schema question

Posted by Chris Bowditch <bo...@hotmail.com>.
Peter Menzel wrote:

<snip/>

> My xml schema snippet for this element:
> 
> <xsd:element name='element'>
>   <xsd:complexType>
>       <xsd:choice>
>            <xsd:element ref='dd' minOccurs='0' maxOccurs='unbounded'/>
>            <xsd:element ref='cc' minOccurs='0' maxOccurs='unbounded'/>
>            <xsd:element ref='aa' minOccurs='1' maxOccurs="1"/>
>            <xsd:element ref='bb' minOccurs='1' maxOccurs="1"/>
>        </xsd:choice>
>    </xsd:complexType>
> </xsd:element>
> 
> Unfortunately this wont work.
> xmllint says that the above xml document is not valid.

You are unlikely to receive help for this question on this list. This list is 
about XSL-FO. Perhaps your question would be better suited to a XML Parser or 
Schema specific list.

> 
> Has anybody any idea concerning this problem? Is it generally possible 
> to mix elements in a complexType  with different minOccurs/maxOccurs ?

Yes this is possible, but not under xs:choice, I believe <xs:any> is the 
compositor you are looking for.

Chris


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


xml schema question

Posted by Peter Menzel <pe...@imise.uni-leipzig.de>.
Hi all,

i am working on a xml schema and have the following problem, maybe 
somebody can help me.

i would like to have the follwoing elment with content:

<element>
    <aa/>
    <cc/>
    <bb/>
</element>

The elements aa and bb are required to be there and they may occur just 
one time. Other sub elements of element can occur many times. Especially 
the order of the elements is random, so i may not use xsd:sequence.

My xml schema snippet for this element:

<xsd:element name='element'>
   <xsd:complexType>
       <xsd:choice>
            <xsd:element ref='dd' minOccurs='0' maxOccurs='unbounded'/>
            <xsd:element ref='cc' minOccurs='0' maxOccurs='unbounded'/>
            <xsd:element ref='aa' minOccurs='1' maxOccurs="1"/>
            <xsd:element ref='bb' minOccurs='1' maxOccurs="1"/>
        </xsd:choice>
    </xsd:complexType>
</xsd:element>

Unfortunately this wont work.
xmllint says that the above xml document is not valid.

Has anybody any idea concerning this problem? Is it generally possible 
to mix elements in a complexType  with different minOccurs/maxOccurs ?

Greetings, Peter 


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


Re: Adding Blind Tables for Figures

Posted by Chris Bowditch <bo...@hotmail.com>.
David Shevitz wrote:

> Thanks. I hadn't realized there have been so few updates to FOP.
> 
> I noticed on a post that to implement a blind table within a template, I 
> should add the following to my customization layer:

customization layer? Isnt that a docbook term? I'm not familiar with docbook.

The basic concepts of a table-caption in FOP are very simple. table-caption 
isnt implemented, so to keep a piece of text, either above or below a table, 
simply create an outer table that has no borders (aka 'blind table'). The 
outer table will need a single column and 2 rows. The inner table is then 
placed either inside the top or bottom cell and the caption in the other cell 
depending on whether the caption is required above or below the original 
table. Make sense?

How to achieve this within docbook is another issue, which I suggest you ask 
on the docbook user list.

<snip/>

Chris


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


Re: Adding Blind Tables for Figures

Posted by David Shevitz <ds...@singlestep.com>.
Thanks. I hadn't realized there have been so few updates to FOP.

I noticed on a post that to implement a blind table within a template, I 
should add the following to my customization layer:

<xsl:template name="formal.object">
  <xsl:param name="placement" select="'before'"/>

  <xsl:variable name="id">
    <xsl:call-template name="object.id"/>
  </xsl:variable>

 <fo:table table-layout="fixed" width="100%">
   <fo:table-column column-number="1"/>
   <fo:table-body>

    <xsl:if test="$placement = 'before'">
      <fo:table-row keep-with-next="always">
        <xsl:call-template name="formal.object.heading"/>
	</fo:table-row>
    </xsl:if>

    <fo:table-row>
	<fo:table-cell>
	  <fo:block id="{$id}"
            xsl:use-attribute-sets="formal.object.properties">
	    <xsl:apply-templates/>
	  </fo:block>
	</fo:table-cell>
    </fo:table-row>
	
    <xsl:if test="$placement != 'before'">
	  <fo:table-row keep-with-previous="always">
	    <xsl:call-template name="formal.object.heading"/>
	  </fo:table-row>
      </xsl:if>

    </fo:table-body>
  </fo:table>
</xsl:template>

<xsl:template name="formal.object.heading">
  <xsl:param name="title"></xsl:param>
  <fo:table-cell>
    <fo:block xsl:use-attribute-sets="formal.title.properties">
      <xsl:apply-templates select="." mode="object.title.markup"/>
    </fo:block>
  </fo:table-cell>
</xsl:template>

I did so, only to find that it had no effect. By no effect, I mean I 
looked into the FO file that was generated, and did not see any tables 
around my figure and captions.

I then thought that perhaps my customization layer was in error somehow, 
so I created a separate customization layer using only the above 
template. Still, no effect.

Finally, I modified the formal.xsl stylesheet with this template, and 
still did have any results.

Clearly, I'm applying something incorrectly. But I'm at a loss as to 
where to begin. I did notice that, in the formal.xsl template, the 
formal.object template is very different from the above XSL markup. That 
is why I wondered if I was working off old material.

I'm happy to provide further information, if that would be helpful. I 
also freely admit that I'm unsure if this is an XSL issue, appropriate 
for the DocBook lists, or a FOP issue. But I figured I should start 
somewhere.

Thanks very much for any assistance,

Dave Shevitz

Chris Bowditch wrote:

> David Shevitz wrote:
>
> <snip/>
>
>> I understand that if I want to keep my captions with my figures in a 
>> given document, I should use a "blind table." However, all the 
>> examples I see were posted around 2 years ago (granted I might be 
>> looking in the wrong place). I tried using them, but they don't seem 
>> to work.
>
>
> Doesnt matter that its 2 years old, there have been very few releases 
> of FOP in that time. The "blind table" approach should work to keep a 
> figure with FOP. Perhaps you should explain why it doesnt work for 
> you, and we will try to help solve the problem.
>
> <snip/>
>
> Chris
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: fop-user-help@xml.apache.org
>
>

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


Re: Adding Blind Tables for Figures

Posted by Chris Bowditch <bo...@hotmail.com>.
David Shevitz wrote:

<snip/>

> I understand that if I want to keep my captions with my figures in a 
> given document, I should use a "blind table." However, all the examples 
> I see were posted around 2 years ago (granted I might be looking in the 
> wrong place). I tried using them, but they don't seem to work.

Doesnt matter that its 2 years old, there have been very few releases of FOP 
in that time. The "blind table" approach should work to keep a figure with 
FOP. Perhaps you should explain why it doesnt work for you, and we will try to 
help solve the problem.

<snip/>

Chris


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