Re: Getting Mismatch: instream-foreign-object

2006-11-02 Thread Jacobus
Hi Guys,

This and many other problems with the 0.92 distribution seems to have to do 
with class paths. If you develop (I'm using Netbeans), then make sure that all 
the .jar files under fop's lib direcory is included in your project.

Cheers,
Jacobus




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



Re: Getting Mismatch: instream-foreign-object

2006-10-07 Thread Lars Ivar Igesund
Pascal Sancho pascal.sancho at takoma.fr writes:

 
  -Original Message-
  From: Lars Ivar Igesund [mailto:larsivar at igesund.net] 
  Sent: Wednesday, October 04, 2006 2:04 PM
  To: fop-users at xmlgraphics.apache.org
  Subject: Getting Mismatch: instream-foreign-object
  
  I am trying to create a PDF-document by taking a xml document 
  and put it through the transformer using xslt and fop, like this:
  
  File xsltfile = new File(baseDir, xslFile);
  File pdffile = new File(outDir, fileName);
  
  FopFactory fopFactory = FopFactory.newInstance();
  FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
  
  try {
  OutputStream out = new BufferedOutputStream(new 
  FileOutputStream(pdffile));
  
  Fop fop = 
  fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out);
  
  TransformerFactory factory = 
  TransformerFactory.newInstance();
  Transformer transformer = 
  factory.newTransformer(new StreamSource(xsltfile));
  
  transformer.setParameter(versionParam, 2.0);
  
  // Setup input for XSLT transformation, src from 
  servicemix
  Source src = message.getContent();
  
  Result res = new SAXResult(fop.getDefaultHandler());
  
  // Start XSLT transformation and FOP processing
  transformer.transform(src, res);
  }
  
  Most of the document consists of SVG graphics.
  
  The resulting FO document seems to be correct, but I get 
  these messages on the
  console:
  
  WARN  - FOTreeBuilder  - Mismatch: 
  instream-foreign-object 
  (http://www.w3.org/1999/XSL/Format) vs. svg 
  (http://www.w3.org/2000/svg)
  WARN  - FOTreeBuilder  - Mismatch: 
  instream-foreign-object 
  (http://www.w3.org/1999/XSL/Format) vs. block
  (http://www.w3.org/1999/XSL/Format)
  WARN  - FOTreeBuilder  - Mismatch: 
  instream-foreign-object 
  (http://www.w3.org/1999/XSL/Format) vs. flow
  (http://www.w3.org/1999/XSL/Format)
  WARN  - FOTreeBuilder  - Mismatch: 
  instream-foreign-object 
  (http://www.w3.org/1999/XSL/Format) vs. page-sequence
  (http://www.w3.org/1999/XSL/Format)
  WARN  - FOTreeBuilder  - Mismatch: 
  instream-foreign-object 
  (http://www.w3.org/1999/XSL/Format) vs. root
  (http://www.w3.org/1999/XSL/Format)
  (Location of error unknown)org.apache.fop.apps.FOPException: 
  Error(Unknown
  location): No element mapping definition found for svg:svg
  
  I use the 0.92beta version. 
  
  Where (or what) is the mismatch? I am fairly new to XSLT and 
  FO, but my xsl file is based on (lots of cut'n'paste) one 
  that used to work with the old stable releases of FOP.
  
  The instream svg starts like this in the xsl file:
  
  fo:instream-foreign-object
  svg xmlns=http://www.w3.org/2000/svg; 
  xmlns:xlink=http://www.w3.org/1999/xlink; width=425.197
  height=563.19 
  viewBox=0 0 765 1013
  
  
  Regards,
  Lars Ivar Igesund
 
 Hi,
 Can you give a simple XSL-FO file (not XSLT) that demonstrates what you
 describe here?
 
 Pascal
 

Ok, by writing out the FO file, then try to create PDF directly from this, I 
get these messages, not the ones above.

WARN  - FOTreeBuilder  - Mismatch: flow 
(http://www.w3.org/1999/XSL/Format) vs. page-sequence 
(http://www.w3.org/1999/XSL/Format)
WARN  - FOTreeBuilder  - Mismatch: flow 
(http://www.w3.org/1999/XSL/Format) vs. root 
(http://www.w3.org/1999/XSL/Format)
(Location of error unknown)org.apache.fop.fo.ValidationException: 
Error(Unknown 
location): fo:flow is missing child elements.
Required Content Model: marker* (%block;)+

Also, adding :svg to the svg xmlns above, lets FOP go on further, but of 
course 
now all the svg tags miss the svg namespace. 

A cut down .fo file (created from my xsl) and that still exhibits these last 
errors:

?xml version=1.0 encoding=UTF-8?
fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xmlns:svg=http://www.w3.org/2000/svg;
xmlns:fn=http://www.w3.org/2005/02/xpath-functions;
fo:layout-master-set
fo:simple-page-master margin-bottom=0cm margin-right=0cm
margin-left=0cm margin-top=0cm page-width=21cm
page-height=29.1cm master-name=simple
fo:region-body margin-right=1cm margin-left=1cm
margin-bottom=1cm margin-top=1cm /
fo:region-before display-align=before 
extent=0.5cm /
fo:region-after display-align=after 
extent=0.5cm /
/fo:simple-page-master
/fo:layout-master-set
fo:page-sequence master-reference=simple
fo:flow flow-name=xsl

Re: Getting Mismatch: instream-foreign-object

2006-10-07 Thread Lars Ivar Igesund
Pascal Sancho pascal.sancho at takoma.fr writes:
  -Original Message-
  From: Lars Ivar Igesund [mailto:larsivar at igesund.net]
  Sent: Wednesday, October 04, 2006 2:04 PM
  To: fop-users at xmlgraphics.apache.org
  Subject: Getting Mismatch: instream-foreign-object
 
  I am trying to create a PDF-document by taking a xml document
  and put it through the transformer using xslt and fop, like this:
 
  File xsltfile = new File(baseDir, xslFile);
  File pdffile = new File(outDir, fileName);
 
  FopFactory fopFactory = FopFactory.newInstance();
  FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
 
  try {
  OutputStream out = new BufferedOutputStream(new
  FileOutputStream(pdffile));
 
  Fop fop =
  fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out);
 
  TransformerFactory factory =
  TransformerFactory.newInstance();
  Transformer transformer =
  factory.newTransformer(new StreamSource(xsltfile));
 
  transformer.setParameter(versionParam, 2.0);
 
  // Setup input for XSLT transformation, src from
  servicemix
  Source src = message.getContent();
 
  Result res = new SAXResult(fop.getDefaultHandler());
 
  // Start XSLT transformation and FOP processing
  transformer.transform(src, res);
  }
 
  Most of the document consists of SVG graphics.
 
  The resulting FO document seems to be correct, but I get
  these messages on the
  console:
 
  WARN  - FOTreeBuilder  - Mismatch:
  instream-foreign-object
  (http://www.w3.org/1999/XSL/Format) vs. svg
  (http://www.w3.org/2000/svg)
  WARN  - FOTreeBuilder  - Mismatch:
  instream-foreign-object
  (http://www.w3.org/1999/XSL/Format) vs. block
  (http://www.w3.org/1999/XSL/Format)
  WARN  - FOTreeBuilder  - Mismatch:
  instream-foreign-object
  (http://www.w3.org/1999/XSL/Format) vs. flow
  (http://www.w3.org/1999/XSL/Format)
  WARN  - FOTreeBuilder  - Mismatch:
  instream-foreign-object
  (http://www.w3.org/1999/XSL/Format) vs. page-sequence
  (http://www.w3.org/1999/XSL/Format)
  WARN  - FOTreeBuilder  - Mismatch:
  instream-foreign-object
  (http://www.w3.org/1999/XSL/Format) vs. root
  (http://www.w3.org/1999/XSL/Format)
  (Location of error unknown)org.apache.fop.apps.FOPException:
  Error(Unknown
  location): No element mapping definition found for svg:svg
 
  I use the 0.92beta version.
 
  Where (or what) is the mismatch? I am fairly new to XSLT and
  FO, but my xsl file is based on (lots of cut'n'paste) one
  that used to work with the old stable releases of FOP.
 
  The instream svg starts like this in the xsl file:
 
  fo:instream-foreign-object
  svg xmlns=http://www.w3.org/2000/svg;
  xmlns:xlink=http://www.w3.org/1999/xlink; width=425.197
  height=563.19
  viewBox=0 0 765 1013
 
 
  Regards,
  Lars Ivar Igesund

 Hi,
 Can you give a simple XSL-FO file (not XSLT) that demonstrates what you
 describe here?

 Pascal

Ok, by writing out the FO file, then try to create PDF directly from this, I
get these messages, not the ones above.

WARN  - FOTreeBuilder  - Mismatch: flow
(http://www.w3.org/1999/XSL/Format) vs. page-sequence
(http://www.w3.org/1999/XSL/Format)
WARN  - FOTreeBuilder  - Mismatch: flow
(http://www.w3.org/1999/XSL/Format) vs. root
(http://www.w3.org/1999/XSL/Format)
(Location of error unknown)org.apache.fop.fo.ValidationException:
Error(Unknown
location): fo:flow is missing child elements.
Required Content Model: marker* (%block;)+

Also, adding :svg to the svg xmlns above, lets FOP go on further, but of
course
now all the svg tags miss the svg namespace.

A cut down .fo file (created from my xsl) and that still exhibits these last
errors:

?xml version=1.0 encoding=UTF-8?
fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xmlns:svg=http://www.w3.org/2000/svg;
xmlns:fn=http://www.w3.org/2005/02/xpath-functions;
fo:layout-master-set
fo:simple-page-master margin-bottom=0cm margin-right=0cm
margin-left=0cm margin-top=0cm page-width=21cm
page-height=29.1cm master-name=simple
fo:region-body margin-right=1cm margin-left=1cm
margin-bottom=1cm margin-top=1cm /
fo:region-before display-align=before
extent=0.5cm /
fo:region-after display-align=after
extent=0.5cm /
/fo:simple-page-master
/fo:layout-master-set
fo:page-sequence master-reference=simple
fo:flow flow-name=xsl-region-body

fo:block border-color=black border-width=1mm
text-align=center

Re: Getting Mismatch: instream-foreign-object

2006-10-06 Thread Lars Ivar Igesund
Ok, I have now solved my problem, and it was a simple missing piece in my setup 
(Batik library), but this was not easily diagnosed because 
SVGElementMapping.initialize() hides all exceptions thrown, among them the 
classloader error for Batik.

Regards,
Lars Ivar Igesund


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



Re: Getting Mismatch: instream-foreign-object

2006-10-05 Thread Lars Ivar Igesund
Pascal Sancho pascal.sancho at takoma.fr writes:

 
  -Original Message-
  From: Lars Ivar Igesund [mailto:larsivar at igesund.net] 
  Sent: Wednesday, October 04, 2006 2:04 PM
  To: fop-users at xmlgraphics.apache.org
  Subject: Getting Mismatch: instream-foreign-object
  
  I am trying to create a PDF-document by taking a xml document 
  and put it through the transformer using xslt and fop, like this:
  
  File xsltfile = new File(baseDir, xslFile);
  File pdffile = new File(outDir, fileName);
  
  FopFactory fopFactory = FopFactory.newInstance();
  FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
  
  try {
  OutputStream out = new BufferedOutputStream(new 
  FileOutputStream(pdffile));
  
  Fop fop = 
  fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out);
  
  TransformerFactory factory = 
  TransformerFactory.newInstance();
  Transformer transformer = 
  factory.newTransformer(new StreamSource(xsltfile));
  
  transformer.setParameter(versionParam, 2.0);
  
  // Setup input for XSLT transformation, src from 
  servicemix
  Source src = message.getContent();
  
  Result res = new SAXResult(fop.getDefaultHandler());
  
  // Start XSLT transformation and FOP processing
  transformer.transform(src, res);
  }
  
  Most of the document consists of SVG graphics.
  
  The resulting FO document seems to be correct, but I get 
  these messages on the
  console:
  
  WARN  - FOTreeBuilder  - Mismatch: 
  instream-foreign-object 
  (http://www.w3.org/1999/XSL/Format) vs. svg 
  (http://www.w3.org/2000/svg)
  WARN  - FOTreeBuilder  - Mismatch: 
  instream-foreign-object 
  (http://www.w3.org/1999/XSL/Format) vs. block
  (http://www.w3.org/1999/XSL/Format)
  WARN  - FOTreeBuilder  - Mismatch: 
  instream-foreign-object 
  (http://www.w3.org/1999/XSL/Format) vs. flow
  (http://www.w3.org/1999/XSL/Format)
  WARN  - FOTreeBuilder  - Mismatch: 
  instream-foreign-object 
  (http://www.w3.org/1999/XSL/Format) vs. page-sequence
  (http://www.w3.org/1999/XSL/Format)
  WARN  - FOTreeBuilder  - Mismatch: 
  instream-foreign-object 
  (http://www.w3.org/1999/XSL/Format) vs. root
  (http://www.w3.org/1999/XSL/Format)
  (Location of error unknown)org.apache.fop.apps.FOPException: 
  Error(Unknown
  location): No element mapping definition found for svg:svg
  
  I use the 0.92beta version. 
  
  Where (or what) is the mismatch? I am fairly new to XSLT and 
  FO, but my xsl file is based on (lots of cut'n'paste) one 
  that used to work with the old stable releases of FOP.
  
  The instream svg starts like this in the xsl file:
  
  fo:instream-foreign-object
  svg xmlns=http://www.w3.org/2000/svg; 
  xmlns:xlink=http://www.w3.org/1999/xlink; width=425.197
  height=563.19 
  viewBox=0 0 765 1013
  
  
  Regards,
  Lars Ivar Igesund
 
 Hi,
 Can you give a simple XSL-FO file (not XSLT) that demonstrates what you
 describe here?
 
 Pascal
 

I seem to get several problems, depending on exactly how I do it. Changing SVG 
xmlns above to xmlns:svg let's FOP continue past the point where the above 
error occurs, but of course then none of the SVG tags are recognized because 
they're not prefixed with svg: Prefixing everything with svg: seems to not be a 
solution either.

I then wrote the resulting .fo to file (pasted further down, most of svg cut 
away here, but the message is the same), then tried to create the PDF directly 
from that. This however did not work either, and now with a different 
message...

WARN  - FOTreeBuilder  - Mismatch: flow 
(http://www.w3.org/1999/XSL/Format) vs. page-sequence 
(http://www.w3.org/1999/XSL/Format)
WARN  - FOTreeBuilder  - Mismatch: flow 
(http://www.w3.org/1999/XSL/Format) vs. root 
(http://www.w3.org/1999/XSL/Format)
(Location of error unknown)org.apache.fop.fo.ValidationException: Error(Unknown 
location): fo:flow is missing child elements.
Required Content Model: marker* (%block;)+

The resulting .fo file:

?xml version=1.0 encoding=UTF-8?
fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xmlns:svg=http://www.w3.org/2000/svg;
xmlns:fn=http://www.w3.org/2005/02/xpath-functions;
fo:layout-master-set
fo:simple-page-master margin-bottom=0cm margin-right=0cm
margin-left=0cm margin-top=0cm page-width=21cm
page-height=29.1cm master-name=simple
fo:region-body margin-right=1cm margin-left=1cm
margin-bottom=1cm margin-top=1cm /
fo:region-before display

Re: Getting Mismatch: instream-foreign-object

2006-10-05 Thread Manuel Mall
On Thursday 05 October 2006 16:59, Lars Ivar Igesund wrote:
 Pascal Sancho pascal.sancho at takoma.fr writes:
   -Original Message-
   From: Lars Ivar Igesund [mailto:larsivar at igesund.net]
   Sent: Wednesday, October 04, 2006 2:04 PM
   To: fop-users at xmlgraphics.apache.org
   Subject: Getting Mismatch: instream-foreign-object
  
   I am trying to create a PDF-document by taking a xml document
   and put it through the transformer using xslt and fop, like this:
  
   File xsltfile = new File(baseDir, xslFile);
   File pdffile = new File(outDir, fileName);
  
   FopFactory fopFactory = FopFactory.newInstance();
   FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
  
   try {
 OutputStream out = new BufferedOutputStream(new
   FileOutputStream(pdffile));
  
   Fop fop =
   fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out);
  
   TransformerFactory factory =
   TransformerFactory.newInstance();
   Transformer transformer =
   factory.newTransformer(new StreamSource(xsltfile));
  
   transformer.setParameter(versionParam, 2.0);
  
   // Setup input for XSLT transformation, src from
   servicemix
   Source src = message.getContent();
  
   Result res = new SAXResult(fop.getDefaultHandler());
  
   // Start XSLT transformation and FOP processing
   transformer.transform(src, res);
   }
  
   Most of the document consists of SVG graphics.
  
   The resulting FO document seems to be correct, but I get
   these messages on the
   console:
  
   WARN  - FOTreeBuilder  - Mismatch:
   instream-foreign-object
   (http://www.w3.org/1999/XSL/Format) vs. svg
   (http://www.w3.org/2000/svg)
   WARN  - FOTreeBuilder  - Mismatch:
   instream-foreign-object
   (http://www.w3.org/1999/XSL/Format) vs. block
   (http://www.w3.org/1999/XSL/Format)
   WARN  - FOTreeBuilder  - Mismatch:
   instream-foreign-object
   (http://www.w3.org/1999/XSL/Format) vs. flow
   (http://www.w3.org/1999/XSL/Format)
   WARN  - FOTreeBuilder  - Mismatch:
   instream-foreign-object
   (http://www.w3.org/1999/XSL/Format) vs. page-sequence
   (http://www.w3.org/1999/XSL/Format)
   WARN  - FOTreeBuilder  - Mismatch:
   instream-foreign-object
   (http://www.w3.org/1999/XSL/Format) vs. root
   (http://www.w3.org/1999/XSL/Format)
   (Location of error unknown)org.apache.fop.apps.FOPException:
   Error(Unknown
   location): No element mapping definition found for svg:svg
  
   I use the 0.92beta version.
  
   Where (or what) is the mismatch? I am fairly new to XSLT and
   FO, but my xsl file is based on (lots of cut'n'paste) one
   that used to work with the old stable releases of FOP.
  
   The instream svg starts like this in the xsl file:
  
   fo:instream-foreign-object
 svg xmlns=http://www.w3.org/2000/svg;
   xmlns:xlink=http://www.w3.org/1999/xlink; width=425.197
 height=563.19
   viewBox=0 0 765 1013
  
  
   Regards,
   Lars Ivar Igesund
 
  Hi,
  Can you give a simple XSL-FO file (not XSLT) that demonstrates what
  you describe here?
 
  Pascal

 I seem to get several problems, depending on exactly how I do it.
 Changing SVG xmlns above to xmlns:svg let's FOP continue past the
 point where the above error occurs, but of course then none of the
 SVG tags are recognized because they're not prefixed with svg:
 Prefixing everything with svg: seems to not be a solution either.

 I then wrote the resulting .fo to file (pasted further down, most of
 svg cut away here, but the message is the same), then tried to create
 the PDF directly from that. This however did not work either, and now
 with a different message...

The fo below works just fine for me. No errors parsing, etc.. This is 
with the trunk version of fop, xerces xml parser and jdk 1.5.0_06.

What is your environment?

 WARN  - FOTreeBuilder  - Mismatch: flow
 (http://www.w3.org/1999/XSL/Format) vs. page-sequence
 (http://www.w3.org/1999/XSL/Format)
 WARN  - FOTreeBuilder  - Mismatch: flow
 (http://www.w3.org/1999/XSL/Format) vs. root
 (http://www.w3.org/1999/XSL/Format)
 (Location of error unknown)org.apache.fop.fo.ValidationException:
 Error(Unknown location): fo:flow is missing child elements.
 Required Content Model: marker* (%block;)+

 The resulting .fo file:

 ?xml version=1.0 encoding=UTF-8?
 fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;
   xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   xmlns:svg=http://www.w3.org/2000/svg;
   xmlns:fn=http://www.w3.org/2005/02/xpath-functions;
   fo:layout-master-set
   fo:simple-page-master margin-bottom=0cm margin-right=0cm
   margin-left=0cm margin-top=0cm page-width=21cm
   page-height=29.1cm master-name=simple

Re: Getting Mismatch: instream-foreign-object

2006-10-05 Thread Lars Ivar Igesund
Manuel Mall manuel at apache.org writes:

 
 The fo below works just fine for me. No errors parsing, etc.. This is 
 with the trunk version of fop, xerces xml parser and jdk 1.5.0_06.
 
 What is your environment?

I use FOP 0.92beta, Xerces 2.6.2 and JDK 1.5.0_08 on Linux.

Regards,
Lars Ivar Igesund


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



Re: Getting Mismatch: instream-foreign-object

2006-10-05 Thread Manuel Mall
On Thursday 05 October 2006 17:20, Lars Ivar Igesund wrote:
 Manuel Mall manuel at apache.org writes:
  The fo below works just fine for me. No errors parsing, etc.. This
  is with the trunk version of fop, xerces xml parser and jdk
  1.5.0_06.
 
  What is your environment?

 I use FOP 0.92beta, Xerces 2.6.2 and JDK 1.5.0_08 on Linux.


That's pretty much the same as me with the exception that I am using the 
latest trunk version of fop. However, I just tried your fo file against 
0.92beta and again it appears to work fine. No parsing errors Are 
you sure you don't have another xml parser somewhere the jdk picks up 
in preference to xerces?

 Regards,
 Lars Ivar Igesund

Manuel

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



Re: Getting Mismatch: instream-foreign-object

2006-10-05 Thread Lars Ivar Igesund
Manuel Mall manuel at apache.org writes:

 
 On Thursday 05 October 2006 17:20, Lars Ivar Igesund wrote:
  Manuel Mall manuel at apache.org writes:
   The fo below works just fine for me. No errors parsing, etc.. This
   is with the trunk version of fop, xerces xml parser and jdk
   1.5.0_06.
  
   What is your environment?
 
  I use FOP 0.92beta, Xerces 2.6.2 and JDK 1.5.0_08 on Linux.
 
 
 That's pretty much the same as me with the exception that I am using the 
 latest trunk version of fop. However, I just tried your fo file against 
 0.92beta and again it appears to work fine. No parsing errors Are 
 you sure you don't have another xml parser somewhere the jdk picks up 
 in preference to xerces?
 

That is possible, I guess. Hmm, XPP3 is in there, and whatever ServiceMix use 
for it's XML parsing (might actually be Xerces, as I didn't put it there).

Also, when searching the net for that particular error message, I got some hits 
related to invalid documents, 
http://www.mail-archive.com/fop-dev%40xmlgraphics.apache.org/msg05025.html, 
also reasonable recent. Can it be related to validation levels?

I'm still very curious about the first issue I had, btw.

Regards,
Lars Ivar Igesund 





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



Re: Getting Mismatch: instream-foreign-object

2006-10-05 Thread Manuel Mall
On Thursday 05 October 2006 17:50, Lars Ivar Igesund wrote:
 Manuel Mall manuel at apache.org writes:
  On Thursday 05 October 2006 17:20, Lars Ivar Igesund wrote:
   Manuel Mall manuel at apache.org writes:
The fo below works just fine for me. No errors parsing, etc..
This is with the trunk version of fop, xerces xml parser and
jdk 1.5.0_06.
   
What is your environment?
  
   I use FOP 0.92beta, Xerces 2.6.2 and JDK 1.5.0_08 on Linux.
 
  That's pretty much the same as me with the exception that I am
  using the latest trunk version of fop. However, I just tried your
  fo file against 0.92beta and again it appears to work fine. No
  parsing errors Are you sure you don't have another xml parser
  somewhere the jdk picks up in preference to xerces?

 That is possible, I guess. Hmm, XPP3 is in there, and whatever
 ServiceMix use for it's XML parsing (might actually be Xerces, as I
 didn't put it there).

 Also, when searching the net for that particular error message, I got
 some hits related to invalid documents,
 http://www.mail-archive.com/fop-dev%40xmlgraphics.apache.org/msg05025
.html, also reasonable recent. Can it be related to validation levels?

 I'm still very curious about the first issue I had, btw.


If I followed this correctly your first issue was the error message:

WARN  - FOTreeBuilder                  - Mismatch: 
instream-foreign-object 
(http://www.w3.org/1999/XSL/Format) vs. svg (http://www.w3.org/2000/svg)

You then removed the xslt translation and concentrated only on the .fo. 
In the end you posted an .fo which works for me but not for you, that 
is it is still throwing a similar error.

My 'gut' feel is that its one and the same problem. Your XML parser gets 
confused with the namespaces. If you get the simple .fo working in your 
environment then the rest will likely work as well.

 Regards,
 Lars Ivar Igesund


Manuel

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



Re: Getting Mismatch: instream-foreign-object

2006-10-05 Thread Lars Ivar Igesund
Manuel Mall manuel at apache.org writes:

 
  That is possible, I guess. Hmm, XPP3 is in there, and whatever
  ServiceMix use for it's XML parsing (might actually be Xerces, as I
  didn't put it there).
 
  Also, when searching the net for that particular error message, I got
  some hits related to invalid documents,
  http://www.mail-archive.com/fop-dev%40xmlgraphics.apache.org/msg05025
 .html, also reasonable recent. Can it be related to validation levels?
 
  I'm still very curious about the first issue I had, btw.
 
 
 If I followed this correctly your first issue was the error message:
 
 WARN  - FOTreeBuilder                  - Mismatch: 
 instream-foreign-object 
 (http://www.w3.org/1999/XSL/Format) vs. svg (http://www.w3.org/2000/svg)
 
 You then removed the xslt translation and concentrated only on the .fo. 
 In the end you posted an .fo which works for me but not for you, that 
 is it is still throwing a similar error.
 
 My 'gut' feel is that its one and the same problem. Your XML parser gets 
 confused with the namespaces. If you get the simple .fo working in your 
 environment then the rest will likely work as well.
 

I was of the impression (could be wrong of course), that this message 
(following the Mismatch warnings) was more relevant/important.

(Location of error unknown)org.apache.fop.apps.FOPException: Error(Unknown 
location): No element mapping definition found for svg:svg

As far as I can tell from the exception stack traces, Xerces is used, btw.

Is a binary snapshot of trunk available?

Regards,
Lars Ivar Igesund






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



RE: Re: Getting Mismatch: instream-foreign-object

2006-10-05 Thread Pascal Sancho
 -Original Message-
 From: Lars Ivar Igesund [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, October 05, 2006 12:58 PM
 To: fop-users@xmlgraphics.apache.org
 Subject: Re: Getting Mismatch: instream-foreign-object
 
 Manuel Mall manuel at apache.org writes:
 
  
   That is possible, I guess. Hmm, XPP3 is in there, and whatever 
   ServiceMix use for it's XML parsing (might actually be 
 Xerces, as I 
   didn't put it there).
  
   Also, when searching the net for that particular error message, I 
  got  some hits related to invalid documents,
   
  
 http://www.mail-archive.com/fop-dev%40xmlgraphics.apache.org/msg05025
  .html, also reasonable recent. Can it be related to 
 validation levels?
  
   I'm still very curious about the first issue I had, btw.
  
  
  If I followed this correctly your first issue was the error message:
  
  WARN  - FOTreeBuilder                  - Mismatch: 
  instream-foreign-object
  (http://www.w3.org/1999/XSL/Format) vs. svg 
  (http://www.w3.org/2000/svg)
  
  You then removed the xslt translation and concentrated only 
 on the .fo. 
  In the end you posted an .fo which works for me but not for 
 you, that 
  is it is still throwing a similar error.
  
  My 'gut' feel is that its one and the same problem. Your XML parser 
  gets confused with the namespaces. If you get the simple 
 .fo working 
  in your environment then the rest will likely work as well.
  
 
 I was of the impression (could be wrong of course), that this 
 message (following the Mismatch warnings) was more relevant/important.
 
 (Location of error unknown)org.apache.fop.apps.FOPException: 
 Error(Unknown
 location): No element mapping definition found for svg:svg
 
 As far as I can tell from the exception stack traces, Xerces 
 is used, btw.
 
 Is a binary snapshot of trunk available?
 
 Regards,
 Lars Ivar Igesund

Hi,
No TRUNK snapshot available.
But it is easy to build it yourself from SVN repository (see [1])

BTW, your XSL-FO code is OK both with FOP 0.92b and FOP TRUNK, as Manual said 
it.

[1] http://xmlgraphics.apache.org/fop/trunk/compiling.html

Pascal

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



Re: Getting Mismatch: instream-foreign-object

2006-10-05 Thread Manuel Mall
On Thursday 05 October 2006 18:57, Lars Ivar Igesund wrote:
 Manuel Mall manuel at apache.org writes:
   That is possible, I guess. Hmm, XPP3 is in there, and whatever
   ServiceMix use for it's XML parsing (might actually be Xerces, as
   I didn't put it there).
  
   Also, when searching the net for that particular error message, I
   got some hits related to invalid documents,
   http://www.mail-archive.com/fop-dev%40xmlgraphics.apache.org/msg0
  5025 .html, also reasonable recent. Can it be related to
   validation levels?
  
   I'm still very curious about the first issue I had, btw.
 
  If I followed this correctly your first issue was the error
  message:
 
  WARN  - FOTreeBuilder                  - Mismatch:
  instream-foreign-object
  (http://www.w3.org/1999/XSL/Format) vs. svg
  (http://www.w3.org/2000/svg)
 
  You then removed the xslt translation and concentrated only on the
  .fo. In the end you posted an .fo which works for me but not for
  you, that is it is still throwing a similar error.
 
  My 'gut' feel is that its one and the same problem. Your XML parser
  gets confused with the namespaces. If you get the simple .fo
  working in your environment then the rest will likely work as well.

 I was of the impression (could be wrong of course), that this message
 (following the Mismatch warnings) was more relevant/important.

 (Location of error unknown)org.apache.fop.apps.FOPException:
 Error(Unknown location): No element mapping definition found for
 svg:svg

 As far as I can tell from the exception stack traces, Xerces is used,
 btw.

 Is a binary snapshot of trunk available?

No, but given that 0.92beta works for me under Linux I still think 
something else is wrong.

Assuming you have a 'vanilla' 0.92beta installion available, that is 
just the .tar.gz file expanded into its own (fop-0.92beta) directory 
without any customizations. Now cd to that directory put the .fo 
snippet into the same directory as let's say svg.fo and then run
./fop svg.fo svg.pdf. This is what I did and it works fine. If that 
doesn't work do
export FOP_OPTS=-verbose:class
./fop svg.fo svg.pdf
this will dump all classloading activity.

If it helps I can e-mail you the output I get for comparison.


 Regards,
 Lars Ivar Igesund


Manuel

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



Re: Getting Mismatch: instream-foreign-object

2006-10-05 Thread Lars Ivar Igesund
Manuel Mall manuel at apache.org writes:

 
 
 No, but given that 0.92beta works for me under Linux I still think 
 something else is wrong.
 
 Assuming you have a 'vanilla' 0.92beta installion available, that is 
 just the .tar.gz file expanded into its own (fop-0.92beta) directory 
 without any customizations. Now cd to that directory put the .fo 
 snippet into the same directory as let's say svg.fo and then run
 ./fop svg.fo svg.pdf. This is what I did and it works fine. If that 
 doesn't work do
 export FOP_OPTS=-verbose:class
 ./fop svg.fo svg.pdf
 this will dump all classloading activity.
 
 If it helps I can e-mail you the output I get for comparison.
 

Ok, doing it this way works for me too. How can I set up -verbose in an 
embedded setting?

Thank you very much so far, btw.

Regards,
Lars Ivar Igesund



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



Re: Getting Mismatch: instream-foreign-object

2006-10-05 Thread Manuel Mall
On Thursday 05 October 2006 20:24, Lars Ivar Igesund wrote:
 Manuel Mall manuel at apache.org writes:
  No, but given that 0.92beta works for me under Linux I still think
  something else is wrong.
 
  Assuming you have a 'vanilla' 0.92beta installion available, that
  is just the .tar.gz file expanded into its own (fop-0.92beta)
  directory without any customizations. Now cd to that directory put
  the .fo snippet into the same directory as let's say svg.fo and
  then run ./fop svg.fo svg.pdf. This is what I did and it works
  fine. If that doesn't work do
  export FOP_OPTS=-verbose:class
  ./fop svg.fo svg.pdf
  this will dump all classloading activity.
 
  If it helps I can e-mail you the output I get for comparison.

 Ok, doing it this way works for me too. How can I set up -verbose in
 an embedded setting?

 Thank you very much so far, btw.


OK, its not a FOP problem then.

The -verbose:class option is NOT a FOP option but an option on the Java 
VM. You need to set it in the script that starts your embedded 
environment. My guess is that setting it in the embedded environment 
will give you a huge output which may be difficult to diagnose.

I still think you have a 'dodgy' XML parser or XSLT engine in your 
embedded environment. How does your environment start, where does it 
gets its classpath / jars from, ... You may have to dig into that.

 Regards,
 Lars Ivar Igesund


Manuel

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



Re: Getting Mismatch: instream-foreign-object

2006-10-05 Thread Lars Ivar Igesund
Manuel Mall manuel at apache.org writes:

  Ok, doing it this way works for me too. How can I set up -verbose in
  an embedded setting?
 
  Thank you very much so far, btw.
 
 
 OK, its not a FOP problem then.
 
 The -verbose:class option is NOT a FOP option but an option on the Java 
 VM. You need to set it in the script that starts your embedded 
 environment. My guess is that setting it in the embedded environment 
 will give you a huge output which may be difficult to diagnose.
 
 I still think you have a 'dodgy' XML parser or XSLT engine in your 
 embedded environment. How does your environment start, where does it 
 gets its classpath / jars from, ... You may have to dig into that.
 

I have now tried several things, and as far as I can see, the exact same 
libraries are used in both situations. I still get the No element mapping 
definition found for svg:svg error, though. I was able to extract a stack 
trace though, and it looks like this (when using the .fo file presented 
earlier, doing the full conversion only presents me with the error message, no 
stacktrace):

org.apache.fop.apps.FOPException: 
file:///home/foo/bar/apache-servicemix-3.0-M2-incubating/examples/foo/./myfodoc
.fo:25:39: 
Error(25/39): No element mapping definition found for svg:svg
at 
org.apache.fop.fo.ElementMappingRegistry.findFOMaker(
ElementMappingRegistry.java:144)
at org.apache.fop.fo.FOTreeBuilder.findFOMaker(FOTreeBuilder.java:214)
at org.apache.fop.fo.FOTreeBuilder.access$200(FOTreeBuilder.java:49)
at 
org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(
FOTreeBuilder.java:310)
at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:185)
at 
org.apache.xalan.transformer.TransformerIdentityImpl.startElement(
TransformerIdentityImpl.java:1072)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown 
Source)
at 
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown 
Source)
at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$
FragmentContentDispatcher.dispatch(Unknown 
Source)
at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown 
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at 
org.apache.xalan.transformer.TransformerIdentityImpl.transform(
TransformerIdentityImpl.java:484)
at 
com.foo.bar.client.message.handlers.GeneralHandler.handle(
GeneralHandler.java:74)

When searching around a bit, I found 
http://comments.gmane.org/gmane.text.xml.fop.user/20677
which suggests that it might be a multithreading issue (although it 
consistently don't work with me). My component embedding FOP is deployed on 
Apache ServiceMix, and it is a heavily multithreaded environment. Why this 
should affect anything, I don't know though. Note that xalan and xerces are the 
xml/xslt libs used by ServiceMix. Anyway, I have tried building FOP (and 
xmlgraphics/commons) from trunk, and no difference at all. I am a bit stumped, 
to say the least. Still hoping for _the_ answer. Thanks.

Regards,
Lars Ivar Igesund



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



Re: Getting Mismatch: instream-foreign-object

2006-10-05 Thread Lars Ivar Igesund
Manuel Mall manuel at apache.org writes:

 I still think you have a 'dodgy' XML parser or XSLT engine in your 
 embedded environment. How does your environment start, where does it 
 gets its classpath / jars from, ... You may have to dig into that.

Just another discovery, commenting out svg from my .fo file, completes the 
generation of my .pdf. Trying the embedding.fo (with svg) from the fop 
distribution exhibits the same errors in my ServiceMix environ.

Regards,
Lars Ivar Igesund


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



Re: Getting Mismatch: instream-foreign-object

2006-10-05 Thread Lars Ivar Igesund
Manuel Mall manuel at apache.org writes:


 
 OK, its not a FOP problem then.
 
 The -verbose:class option is NOT a FOP option but an option on the Java 
 VM. You need to set it in the script that starts your embedded 
 environment. My guess is that setting it in the embedded environment 
 will give you a huge output which may be difficult to diagnose.
 
 I still think you have a 'dodgy' XML parser or XSLT engine in your 
 embedded environment. How does your environment start, where does it 
 gets its classpath / jars from, ... You may have to dig into that.

Ok, some more debugging shows that the mapping.getTable() call in 
ElementMappingRegistry.addMapping() returns null for the SVG and Batik 
elementmappings in my setting, which explains the error message I get. Why it 
returns null, I've not been able to figure out yet, though. The ElementMappings 
themselves seems to be ok, and so does the namespaceUri.

Regards,
Lars Ivar Igesund




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



Getting Mismatch: instream-foreign-object

2006-10-04 Thread Lars Ivar Igesund
I am trying to create a PDF-document by taking a xml document and put it 
through the transformer using xslt and fop, like this:

File xsltfile = new File(baseDir, xslFile);
File pdffile = new File(outDir, fileName);

FopFactory fopFactory = FopFactory.newInstance();
FOUserAgent foUserAgent = fopFactory.newFOUserAgent();

try {
OutputStream out = new BufferedOutputStream(new 
FileOutputStream(pdffile));

Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, 
out);

TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer(new 
StreamSource(xsltfile));

transformer.setParameter(versionParam, 2.0);

// Setup input for XSLT transformation, src from servicemix
Source src = message.getContent();

Result res = new SAXResult(fop.getDefaultHandler());

// Start XSLT transformation and FOP processing
transformer.transform(src, res);
}

Most of the document consists of SVG graphics.

The resulting FO document seems to be correct, but I get these messages on the 
console:

WARN  - FOTreeBuilder  - Mismatch: instream-foreign-object 
(http://www.w3.org/1999/XSL/Format) vs. svg (http://www.w3.org/2000/svg)
WARN  - FOTreeBuilder  - Mismatch: instream-foreign-object 
(http://www.w3.org/1999/XSL/Format) vs. block 
(http://www.w3.org/1999/XSL/Format)
WARN  - FOTreeBuilder  - Mismatch: instream-foreign-object 
(http://www.w3.org/1999/XSL/Format) vs. flow 
(http://www.w3.org/1999/XSL/Format)
WARN  - FOTreeBuilder  - Mismatch: instream-foreign-object 
(http://www.w3.org/1999/XSL/Format) vs. page-sequence 
(http://www.w3.org/1999/XSL/Format)
WARN  - FOTreeBuilder  - Mismatch: instream-foreign-object 
(http://www.w3.org/1999/XSL/Format) vs. root 
(http://www.w3.org/1999/XSL/Format)
(Location of error unknown)org.apache.fop.apps.FOPException: Error(Unknown 
location): No element mapping definition found for svg:svg

I use the 0.92beta version. 

Where (or what) is the mismatch? I am fairly new to XSLT and FO, but my xsl 
file is based on (lots of cut'n'paste) one that used to work with the old 
stable releases of FOP.

The instream svg starts like this in the xsl file:

fo:instream-foreign-object
svg xmlns=http://www.w3.org/2000/svg; 
xmlns:xlink=http://www.w3.org/1999/xlink; width=425.197
height=563.19 viewBox=0 0 765 1013


Regards,
Lars Ivar Igesund



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



RE: Getting Mismatch: instream-foreign-object

2006-10-04 Thread Pascal Sancho
 -Original Message-
 From: Lars Ivar Igesund [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, October 04, 2006 2:04 PM
 To: fop-users@xmlgraphics.apache.org
 Subject: Getting Mismatch: instream-foreign-object
 
 I am trying to create a PDF-document by taking a xml document 
 and put it through the transformer using xslt and fop, like this:
 
 File xsltfile = new File(baseDir, xslFile);
 File pdffile = new File(outDir, fileName);
 
 FopFactory fopFactory = FopFactory.newInstance();
 FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
 
 try {
   OutputStream out = new BufferedOutputStream(new 
 FileOutputStream(pdffile));
   
 Fop fop = 
 fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out);
 
 TransformerFactory factory = 
 TransformerFactory.newInstance();
 Transformer transformer = 
 factory.newTransformer(new StreamSource(xsltfile));
 
 transformer.setParameter(versionParam, 2.0);
 
 // Setup input for XSLT transformation, src from 
 servicemix
 Source src = message.getContent();
 
 Result res = new SAXResult(fop.getDefaultHandler());
 
 // Start XSLT transformation and FOP processing
 transformer.transform(src, res);
 }
 
 Most of the document consists of SVG graphics.
 
 The resulting FO document seems to be correct, but I get 
 these messages on the
 console:
 
 WARN  - FOTreeBuilder  - Mismatch: 
 instream-foreign-object 
 (http://www.w3.org/1999/XSL/Format) vs. svg 
 (http://www.w3.org/2000/svg)
 WARN  - FOTreeBuilder  - Mismatch: 
 instream-foreign-object 
 (http://www.w3.org/1999/XSL/Format) vs. block
 (http://www.w3.org/1999/XSL/Format)
 WARN  - FOTreeBuilder  - Mismatch: 
 instream-foreign-object 
 (http://www.w3.org/1999/XSL/Format) vs. flow
 (http://www.w3.org/1999/XSL/Format)
 WARN  - FOTreeBuilder  - Mismatch: 
 instream-foreign-object 
 (http://www.w3.org/1999/XSL/Format) vs. page-sequence
 (http://www.w3.org/1999/XSL/Format)
 WARN  - FOTreeBuilder  - Mismatch: 
 instream-foreign-object 
 (http://www.w3.org/1999/XSL/Format) vs. root
 (http://www.w3.org/1999/XSL/Format)
 (Location of error unknown)org.apache.fop.apps.FOPException: 
 Error(Unknown
 location): No element mapping definition found for svg:svg
 
 I use the 0.92beta version. 
 
 Where (or what) is the mismatch? I am fairly new to XSLT and 
 FO, but my xsl file is based on (lots of cut'n'paste) one 
 that used to work with the old stable releases of FOP.
 
 The instream svg starts like this in the xsl file:
 
 fo:instream-foreign-object
   svg xmlns=http://www.w3.org/2000/svg; 
 xmlns:xlink=http://www.w3.org/1999/xlink; width=425.197
   height=563.19 
 viewBox=0 0 765 1013
 
 
 Regards,
 Lars Ivar Igesund

Hi,
Can you give a simple XSL-FO file (not XSLT) that demonstrates what you
describe here?

Pascal

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