[xep-support] XEP processing instruction bug?

Geoff Levner geoff at n-generate.com
Wed Jun 15 07:01:23 PDT 2005


No, I am passing the DOMSource directly to render. Here is the relevant 
code:

     DOMSource source = new DOMSource(doc.getDocumentElement(), sysId);
     FOTarget target = new FOTarget(stream, format);
     XEPLogger logger = new XEPLogger();
     if (pageAreaHandler == null) {
         xep.render(source, target, logger);
     } else {
         ContentHandler generator = xep.createGenerator(target, logger);
         XEPContentHandler myGenerator =
             new XEPContentHandler(generator, pageAreaHandler);
         xep.render(source, myGenerator, logger);
     }

and here is a sample input document:

<?xml version="1.0"?>
<?xep-pdf-initial-zoom fit?>
<?xep-pdf-crop-offset 72pt 72pt 72pt 72pt?>
<?xep-pdf-bleed 24pt 24pt 24pt 24pt?>
<?xep-pdf-crop-mark-width 1pt?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
	 xmlns:rx="http://www.renderx.com/XSL/Extensions"
	 id="root">
   <rx:meta-info id="meta-info">
     <rx:meta-field id="meta1" name="title" value="This is a test"/>
     <rx:meta-field id="meta2" name="author" value="John Doe"/>
   </rx:meta-info>
   <fo:layout-master-set id="layout">
     <fo:simple-page-master id="simple" master-name="only"
			   page-width="595pt" page-height="842pt">
       <fo:region-body id="body"
		      background-color="rgb-icc(255, 255, 255, #SpotColor,'PANTONE 
229 C',1)"
		      column-count="2" column-gap="0.5in" margin="1in"/>
     </fo:simple-page-master>
   </fo:layout-master-set>
   <fo:page-sequence id="pages" master-reference="only">
     <fo:flow id="flow" flow-name="xsl-region-body">
       <fo:block-container id="block1" position="absolute"
			  left="-34pt" top="34pt" width="527pt" height="100pt"
			  background-color="rgb-icc(255, 255, 255, #SpotColor,'PANTONE 540 
C',1)"
			  display-align="before">
	<fo:block-container id="block2" position="absolute" top="30pt">
	  <fo:block id="block3"
		    font-family="Helvetica" color="#FFFFFF" text-align="left"
		    font-size="30pt" line-height="30pt">
	    Why don't you take this nice car for a drive and then buy
	    it. Please. The quick brown fox jumps over the lazy dog.
	  </fo:block>
	</fo:block-container>
       </fo:block-container>
       <fo:block-container id="block4" position="absolute"
			  left="34pt" top="100pt" width="527pt" height="774pt"
			  display-align="before">
	<fo:block-container id="block5" position="absolute" top="30pt">
	  <fo:block id="block6" font-family="Helvetica" color="#FFFFFF"
		    text-align="justify" font-size="24pt" line-height="72pt"
		    hyphenate="true">
	    Lorem ipsum ades dolor sit consec atetuer adipiscing elit, sed
	    diam nonummy nibh euismod tincidunt ut laoreet dolore magna
	    aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud
	    exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea
	    commodo consequat. Duis autem vel eum iriure dolor in hendrerit in
	    vulputate velit esse molestie consequat, vel illum dolore eu
	    feugiat nulla facilisis at vero eros et accumsan et iusto odio
	    dignissim qui blandit praesent luptatum enim ad minim veniam, quis
	    nostrud exerci tation ullamcorper suscipit lobortis nisl utzzril
	    delenit.
	  </fo:block>
	</fo:block-container>
       </fo:block-container>
       <fo:block-container id="block7" position="absolute"
			  left="34pt" top="34pt" width="527pt" height="774pt"
			  display-align="after"/>
     </fo:flow>
   </fo:page-sequence>
</fo:root>

Thanks,
Geoff

On 15 Jun 2005, at 13:02, Alexander Peshkov wrote:

> Hello Geoff,
>
> Processing instructions works fine in XEP then DOMSource is passed to
> the render method - I've just rechecked it. So it looks like a problem
> with your code. Note that if you feed your DOM object to XSLT
> transformer (not to the 'render' method of Formatter, but to 
> 'transform'
> method of FOTransformer) when PIs will be consumed by XSLT engine, not
> XEP.
> Still if you post here a relevant code snippet of your Java source and
> input document itself someone may came up with a good suggestion.
>
> Best regards,
> Alexander Peshkov                             
> mailto:peshkov at renderx.com
> RenderX
>
>
> GL> We have a document in which we use XEP processing instructions to
> GL> specify bleed values and crop marks.  When we feed it to XEP on the
> GL> command line (OS X), everything works fine.  But when our Java
> GL> application feeds it to XEP programatically as a DOMSource, the
> GL> processing instructions are ignored.
>
> GL> Just before rendering the document, I traverse the DOM to verify 
> that
> GL> the processing instructions are there, so I am certain they are.
>
> GL> Is it possible that XEP ignores processing instructions when 
> render()
> GL> is passed a DOMSource?  If not, is there something we might be 
> doing
> GL> wrong?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 4956 bytes
Desc: not available
URL: <http://lists.renderx.com/pipermail/xep-support/attachments/20050615/e4482c4f/attachment.bin>


More information about the Xep-support mailing list