RE: [xep-support] XEP processing instruction bug?

From: Mark Gabriel <markg@limehouse.co.uk>
Date: Wed Jun 15 2005 - 07:18:20 PDT

Hi,

On your 1st line you are getting the root element of your FO document, this
will not include any of the processing instructions.
I had a similar problem and was able to get around it by simple putting the
processing instructions inside the root node...

Mark

________________________________________
From: owner-xep-support@renderx.com [mailto:owner-xep-support@renderx.com]
On Behalf Of Geoff Levner
Sent: 15 June 2005 15:01
To: xep-support@renderx.com
Cc: Sylvia Nguyen
Subject: Re: [xep-support] XEP processing instruction bug?

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@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?

-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo@renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/terms-of-service.html
Received on Wed Jun 15 07:58:04 2005

This archive was generated by hypermail 2.1.8 : Wed Jun 15 2005 - 07:58:05 PDT