Announcement

Collapse
No announcement yet.

FORG0001: Cannot convert string "common" to a double

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • FORG0001: Cannot convert string "common" to a double

    Hallo!

    Ich möchte aus einem XML-Dokument ein FO-Dokument erzeugen. Ich habe eine XSL-Datei geschrieben. Wenn ich nun die Transformation starte, erhalte ich den im Betreff genannten Cast-Fehler und der Transformator bricht mittendrin ab. Ich wüsste aber nicht, dass ich an irgendeiner Stelle einen String "common" in double konvertieren möchte. Es kommt ja nicht mal das Wort "common" vor. Das Fo-Dokument bricht mitten bei der Erzeugung einer neuen Tabellenzeile ab:
    Code:
    </fo:table-cell></fo:table-row><
    Dann ist das Dokument zu Ende. Das ist im dazugehörigen XSLT mitten in einer Schleife:
    Code:
    <xsl:for-each select="./param">
    	<fo:table-row>
    		<xsl:if test="./@optional='y'"><xsl:attribute name="background-color">rgb(221, 221, 221)</xsl:attribute></xsl:if>
    		<xsl:if test="./@productSpecific!=''"><xsl:attribute name="background-color">rgb(219, 236, 210)</xsl:attribute></xsl:if>
    		<fo:table-cell><fo:block xsl:use-attribute-sets="p">
    			<xsl:if test="./@outdated='y'"><xsl:attribute name="text-decoration">line-through</xsl:attribute></xsl:if>
    			<xsl:value-of select="./@id" />
    			<xsl:if test="./@outdated='y'"> (outdated)</xsl:if>
    			<xsl:if test="./@productSpecific!=''"> (<xsl:value-of select="./@productSpecific" /> only)</xsl:if>
    		</fo:block></fo:table-cell>
    		<fo:table-cell><fo:block xsl:use-attribute-sets="p">
    			<xsl:choose>
    				<xsl:when test="./@optional='y'">Yes</xsl:when>
    				<xsl:when test="./@optional='n'">No</xsl:when>
    			</xsl:choose>
    		</fo:block></fo:table-cell>
    		<fo:table-cell><fo:block xsl:use-attribute-sets="p"><xsl:value-of select="./@default" /></fo:block></fo:table-cell>
    		<fo:table-cell><xsl:apply-templates /></fo:table-cell>
    	</fo:table-row>
    </xsl:for-each>
    Das Attribut-Set sieht wie folgt aus:
    Code:
    <xsl:attribute-set name="p">
    	<xsl:attribute name="text-indent">0pt</xsl:attribute>
    	<xsl:attribute name="space-before">0pt</xsl:attribute>
    	<xsl:attribute name="space-after">6pt</xsl:attribute>
    	<xsl:attribute name="text-align">left</xsl:attribute>
    	<xsl:attribute name="line-height">1.5</xsl:attribute>
    	<xsl:attribute name="font-family"><xsl:value-of select="$font-std"/></xsl:attribute>
    	<xsl:attribute name="font-size">9pt</xsl:attribute>
    	<xsl:attribute name="keep-together.within-page">always</xsl:attribute>
    </xsl:attribute-set>
    Wie kann ich das beheben bzw. wie finde ich raus, woran es nun genau liegt? Die Zeile, an der es scheitert, ist die vierte und letzte Zeile dieser Tabelle.

    Danke!
    Schnoof

  • #2
    Oder kann es sein, dass die Transformation abbricht, weil das Dokument zu lang wird? Ich nutze den javax.xml.transform.Transformer.

    Eben habe ich nämlich auf der Titelseite des Dokuments noch Graphiken eingefügt, nun ist die XSL-Datei ein paar Zeilen länger und das Transformationsergebnis wird natürlich auch länger. Nun bricht der Transformator prompt schon ein paar Zeilen vorher ab, nämlich in der dritten Zeile der Tabelle:
    Code:
    <fo:table-row background-color="rgb(221, 221, 221)"><fo:table-cell><fo:block text-indent="0pt" space-before="0pt" space-after="6pt" text-align="left" line-height="1.5" font-family="'Fedra Sans Std Book IC', Verdana, sans-serif" font-size="9pt" keep-together.within-page="always">name</fo:block></fo:table-cell><fo:table-cell><fo:block text-indent="0pt" space-before="0pt" space-after="6pt" text-align="left" line-height="1.5" font-family="'Fedra Sans Std Book IC', Verdana, sans-serif" font-size="9pt" keep-together.within-page="always">Yes</fo:block></fo:table-cell><fo:table-cell><fo:block text-indent="0pt" space-before="0pt" space-after="6pt" text-align="left" line-height="1.5" font-family="'Fedra Sans Std Book IC', Verdana, sans-serif" font-size="9pt" keep-together.within-page="always">interface</fo:block></fo:table-cell><fo:table-cell>
              <fo:block text-indent="0pt" space-before="0pt" space-after="6pt" text-align="left" line-height="1.5" font-family="'Fedra Sans Std Book IC', Verdana, sans-serif" font-size="9pt" keep-together.within-page="always">Name of the interface as configured at the
    Ich weiß, da kommen etwas wenig Zeilenumbrüche raus, im XSL-Dokument sind eigentlich weitaus mehr enthalten.

    Wie krieg ich das hin?

    Danke!
    Schnoof

    Comment


    • #3
      Also: Der Parser ist Saxon8 und er hört genau dann auf, die FO-Datei zu schreiben, wenn die Größe 40 KB erreicht. Kennt sich jemand mit Saxon aus und weiß, wie ich das beheben kann?

      Danke
      Schnoof

      Comment


      • #4
        Problem gelöst. Da war ein Bug im XSLT, das bei der Validierung des Outputs aufgetreten ist und weshalb dann der aktuelle Puffer nicht geschrieben wurde.

        Bis denne
        Schnoof

        Comment

        Working...
        X