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 Avik Sengupta <av...@apache.org> on 2002/12/21 12:13:10 UTC

No handler defned for external graphic

I am using the the latest CVS version (tag fop-0_20_2-maintain), and 
have compiled it with both jimi and JAI enabled. However, i get the 
following error on <fo:external-graphic 
src="file:///somepath/someimage.jpg" />


ERROR   (2002-12-21) 16:32.40:433   [sitemap] (Unknown-URI) 
Unknown-thread/FOTreeBuilder: Unknown formatting object ^external-graphic
INFO    (2002-12-21) 16:32.40:457   [sitemap] (Unknown-URI) 
Unknown-thread/PageSequence: [1]
ERROR   (2002-12-21) 16:32.40:477   [sitemap] (Unknown-URI) 
Unknown-thread/UnknownXMLObj: no handler defined for :external-graphic 
foreign xml

Any ideas?

Thanks
-
Avik




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


Re: No handler defned for external graphic

Posted by Joerg Pietschmann <j3...@yahoo.de>.
On Saturday 21 December 2002 12:13, you wrote:
> I am using the the latest CVS version (tag fop-0_20_2-maintain), and
> have compiled it with both jimi and JAI enabled. However, i get the
> following error on <fo:external-graphic
> src="file:///somepath/someimage.jpg" />
>
> ERROR   (2002-12-21) 16:32.40:433   [sitemap] (Unknown-URI)
> Unknown-thread/FOTreeBuilder: Unknown formatting object ^external-graphic
> INFO    (2002-12-21) 16:32.40:457   [sitemap] (Unknown-URI)
> Unknown-thread/PageSequence: [1]
> ERROR   (2002-12-21) 16:32.40:477   [sitemap] (Unknown-URI)
> Unknown-thread/UnknownXMLObj: no handler defined for :external-graphic
> foreign xml

The second error is caused by the first. The real problem is here:
  Unknown formatting object ^external-graphic
This means the external-graphic element is in the default namespace.
Usually this is in turn caused by not having the fo namespace declaration
in scope while generating the external-graphic element, like
  <xsl:template match="/">
    <fo:root xmlns:fo="http://www.w3.org/...">
      <!-- fo namespace in scope here -->
      ...
       <xsl:apply-templates/>
     ...
  </xsl:template>
  <xsl:template match="img">
    <!-- fo namespace not in scope here -->
    <fo:external-graphic src="@src"/>
  </xsl:template>

Actually this shouldn't happen without you noticing before. Did you
write the FO file directly, or generated with the Xalan coming
with FOP? In the latter case, we might have hit another Xalan bug.

The simplest way to ensure the fo namespace declaration is in scope
is to move it to the xsl:stylesheet element.. If this doesn't work, run
the transformation standalone and check whether there is a xmlns:fo=""
somewhere, this usually gives hints where you unassigned the
namespace in the style sheet.

J.Pietschmann

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


Re: No handler defned for external graphic

Posted by Joerg Pietschmann <j3...@yahoo.de>.
On Sunday 22 December 2002 14:04, you wrote:
> Do you mean the latest CVS? I tried with 2.4.1, same result (ie, correct
> result from command line, same error message via cocoon)

2.4.1 should be ok. Are you running on JDK 1.4? Check
if you really use your Xalan version with Cocoon. JDK 1.4
comes with an older, buggy Xalan version which is usually
loaded first. Ask the Cocoon gurus how to work around this.

J.Pietschmann

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


Re: No handler defned for external graphic

Posted by Avik Sengupta <av...@apache.org>.
Do you mean the latest CVS? I tried with 2.4.1, same result (ie, correct 
result from command line, same error message via cocoon)

Joerg Pietschmann wrote:
> On Sunday 22 December 2002 12:35, you wrote:
> 
>>Thanks. Actually i was using centipede to create the pdf which was using
>>forrest, which was using cocoon. So it was xml->xslt->fo->pdf.
> 
> 
> Upgrade Xalan to the lates version, and you should see an error
> message.
> 
> J.Pietschmann





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


Re: No handler defned for external graphic

Posted by Joerg Pietschmann <j3...@yahoo.de>.
On Sunday 22 December 2002 12:35, you wrote:
> Thanks. Actually i was using centipede to create the pdf which was using
> forrest, which was using cocoon. So it was xml->xslt->fo->pdf.

Upgrade Xalan to the lates version, and you should see an error
message.

J.Pietschmann

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


Re: No handler defned for external graphic

Posted by Avik Sengupta <av...@apache.org>.
Thanks. Actually i was using centipede to create the pdf which was using 
forrest, which was using cocoon. So it was xml->xslt->fo->pdf.

Your reply gave me many more paths to experiment, and i found that 
running FOP on the command line gave me correct results, even using the 
jar's that are being used by centipede. The xmls declaration is in the 
correct place, and there is no re-setting of the namespace in the fo 
produced as a result of the xslt; and the pdf has the correct image. So 
i presume this must be a result of some resolver being overriden in the 
cocoon config.

Thanks for your pointer. I'll probably take it to the 
cocoon/forrest/centipede lists.

Regards
-
avik



Joerg Pietschmann <j3...@yahoo.de> wrote

The second error is caused by the first. The real problem is here:
   Unknown formatting object ^external-graphic
This means the external-graphic element is in the default namespace.
Usually this is in turn caused by not having the fo namespace declaration
in scope while generating the external-graphic element, like
   <xsl:template match="/">
     <fo:root xmlns:fo="http://www.w3.org/...">
       <!-- fo namespace in scope here -->
       ...
        <xsl:apply-templates/>
      ...
   </xsl:template>
   <xsl:template match="img">
     <!-- fo namespace not in scope here -->
     <fo:external-graphic src="@src"/>
   </xsl:template>

Actually this shouldn't happen without you noticing before. Did you
write the FO file directly, or generated with the Xalan coming
with FOP? In the latter case, we might have hit another Xalan bug.

The simplest way to ensure the fo namespace declaration is in scope
is to move it to the xsl:stylesheet element.. If this doesn't work, run
the transformation standalone and check whether there is a xmlns:fo=""
somewhere, this usually gives hints where you unassigned the
namespace in the style sheet.

J.Pietschmann

Avik Sengupta wrote:
> I am using the the latest CVS version (tag fop-0_20_2-maintain), and 
> have compiled it with both jimi and JAI enabled. However, i get the 
> following error on <fo:external-graphic 
> src="file:///somepath/someimage.jpg" />
> 
> 
> ERROR   (2002-12-21) 16:32.40:433   [sitemap] (Unknown-URI) 
> Unknown-thread/FOTreeBuilder: Unknown formatting object ^external-graphic
> INFO    (2002-12-21) 16:32.40:457   [sitemap] (Unknown-URI) 
> Unknown-thread/PageSequence: [1]
> ERROR   (2002-12-21) 16:32.40:477   [sitemap] (Unknown-URI) 
> Unknown-thread/UnknownXMLObj: no handler defined for :external-graphic 
> foreign xml
> 
> Any ideas?
> 
> Thanks
> -
> Avik





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