OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] Text style and color


Hi Xavier,

I think you're going to be stuck with writing a customization layer to do any of this.  I'm not quite sure what you mean by "customizing text color ... without developing it in my customization layer."  You simply can't customize such properties without putting them in a customization layer.

If you need to have new elements such as <xxx> and <txt> in your DocBook document, then you will have to first customize DocBook to add them.  See the relevant chapter of the Definitive Guide: http://docbook.org/tdg/en/html/ch05.html.

Then, you will have to write a stylesheet customization layer to treat these elements accordingly:

<xsl:template match="xxx">
  <fo:block>
    <xsl:apply-templates/>
  </fo:block>
</xsl:template>

<xsl:template match="txt">
  <fo:inline>
    <xsl:attribute name="color">
      <xsl:apply-templates select="color"/>
    </xsl:attribute>
    <xsl:attribute name="font-style">
      <xsl:apply-templates select="style"/>
    </xsl:attribute>
    <xsl:text>
      <xsl:apply-templates select="wording"/>
    </xsl:text>
  </fo:inline>
</xsl:template>

Note: this is assuming you're using XSL-FO, and this may not be exactly how you want to do it, but it's an example.

Hope this helps... let me know if I've misinterpreted your question.

Colin

On 3/26/07, xav.dev@free.fr <xav.dev@free.fr> wrote:
Hi all,

I have to produce documents with a complex presentation for some part of the
text.

My toolchain consists in :
XML (with owner format) --|XSLT|--> DocBook --|docbook-xsl|--> PDF

In my source XML document, there is some data where format description is part
of the data.
eg.
<xxx>
        <txt>
                <color>blue</color>
                <style>underline</style>
                <wording>A part of</wording>
        </txt>
        <txt>
                <color>black</color>
                <style>normal</style>
                <wording> a text for xxx</wording>
        </txt>
</xxx>

In my final PDF document, I want to display xxx elements with a pretty format
representing a concatenation of txt (taking into account color and style
sub-elements).

For this purpose, I think I have two choices, but I'm not sure the first is
possible :

1/ Generating a docbook document with color and style inside. I don't find any
documentation about customizing text color in docbook ( i.e. without developping
it in my customization layer). Is it possible to do this ?

2/ Generating a docbook document with "xxx" elements inside and treating them in
the presentation layer. This means that my docbook format is extented with the
"xxx" element. Regarding the reference schema of DocBook publishing
model(http://nwalsh.com/docbook/procdiagram/) I guess it is possible. Is there a
documentation guide for extending DocBook format with owner elements ?

Thanks in advance.

Xavier


---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org




[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]