Maven 1.x PDF Plugin
  1. Maven 1.x PDF Plugin
  2. MPPDF-2

Maven-pdf plugin fails with href link inside an xdoc file

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      MAVEN 1.0-RC1 with maven-pdf-plugin 1.2
    • Number of attachments :
      1

      Description

      The FOP convertion crashes when using href link in an xdoc file.

      --the xdoc file:
      ...
      <subsection name="The Configuration schema">
      <a href="schema/conf.html">The schema description</a>
      </subsection>
      ...

      --the fo result:
      ...
      <fo:block font-family="sans-serif" color="#000036" space-before.optimum="1.5em" space-before.minimum="1.2em" space-before.maximum="2.0em" font-size="12pt">The Configuration schema</fo:block>
      <fo:basic-link external-destination="schema/conf.html"><fo:inline color="blue">The schema description</fo:inline></fo:basic-link>
      ...

      --the error:
      ...
      [java] [ERROR] file:/C:/projets/LSM/target/docs/project.fo:50:61 inline form
      atting objects cannot be directly under flow
      [java] org.apache.fop.apps.FOPException: file:/C:/projets/LSM/target/docs/pr
      oject.fo:50:61 inline formatting objects cannot be directly under flow
      [java] at org.apache.fop.fo.flow.Inline.<init>(Inline.java:77)
      [java] at org.apache.fop.fo.flow.BasicLink.<init>(BasicLink.java:75)
      [java] at org.apache.fop.fo.flow.BasicLink$Maker.make(BasicLink.java:65
      )
      [java] at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.ja
      va:352)
      [java] at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unkn
      own Source)
      [java] at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElem
      ent(Unknown Source)
      [java] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$Fragmen
      tContentDispatcher.dispatch(Unknown Source)
      [java] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDoc
      ument(Unknown Source)
      [java] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown So
      urce)
      [java] at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Sour
      ce)
      [java] at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      [java] at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Sou
      rce)
      [java] at org.apache.fop.apps.Driver.render(Driver.java:498)
      [java] at org.apache.fop.apps.CommandLineStarter.run(CommandLineStarter
      .java:106)
      [java] at org.apache.fop.apps.Fop.main(Fop.java:62)
      ...

      => It works by modifying the xslt.
      I add a fo:block element surrounding the fo:basic-link element (patch attached)

      ...
      <xsl:template match="a[@href]">
      <fo:block>
      <fo:basic-link external-destination="

      {@href}

      ">
      <fo:inline color="blue">
      <xsl:apply-templates />
      </fo:inline>
      </fo:basic-link>
      </fo:block>
      </xsl:template>
      ...

        Activity

        Hide
        Xavier RODRIGUEZ added a comment -

        patch for this issue.

        Show
        Xavier RODRIGUEZ added a comment - patch for this issue.
        Hide
        Arnaud HERITIER added a comment -

        Corrected on the plugin's HEAD Branch (release 2.0-SNAPSHOT)

        Show
        Arnaud HERITIER added a comment - Corrected on the plugin's HEAD Branch (release 2.0-SNAPSHOT)

          People

          • Assignee:
            Unassigned
            Reporter:
            Xavier RODRIGUEZ
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: