Andreia Oliveira wrote:
...
An xml file, a xsd and a xslt were created.
Fortunately, schema definitions (XSD) are irrelevant for FOP.

(Example: <field1>Here is my text. It will be <strong>difficult</strong> to
get it <em>formatted</em> correctly</field1>)

<xsl:template name="XMLContent">
This matches elements with the name "XMLContent". There are no
such elements in your source file, because XMLContent is a *type*,
therefore this template never triggered. In you case this makes not
much of a difference, because you basically want the default template
behaviour anyway.
You can't match types unless you are using a XSLT2 processor.

<xsl:apply-templates select="node()" />
<xsl:value-of select="text()" />
   ^^^^^^^^^
This will duplicate the first text node of the element, because
all child nodes (including all text nodes) have already been processed
by the apply-templates above.

<xsl:template match="//em/text() | //strong/text()">
You should never start a template match with a "//".

<fo:inline>
<xsl:if test="ancestor::em">
Matching multiple elements and then dispatching again inside
a template is considered bad style.

You should have written two templates:
<xsl:template match="em">
  <fo:wrapper color="rgb(0,255,0)">
     <xsl:apply-templates/>
  </fo:inline>
</xsl:template>

<xsl:template match="strong">
  <fo:wrapper font-weight="bold">
     <xsl:apply-templates/>
  </fo:inline>
</xsl:template>

Note further that you should use fo:wrapper instead of fo:inline, unless
you really want to generate inline areas.

J.Pietschmann

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to