xslt - Can javascript in XSL FO file write to the document for processing with Apache FOP? -
i trying test using javascript scripts add content template @ time of processing pdf render-er, apache fop. know xsl can call javascript file can in turn call
document.write("<p>some text</p>"); which can displayed in web browser. possible javascript function write document more like
document.write("<fo:block>some text</fo:block>"); such apache fop able process , display block in output pdf?
document.write method of document object exposed browsers in text/html documents script. xslt not have access document object , method, not client-side xslt done in browser. option have there have xslt generate html result document uses script document.write something. , restricted, instance mozilla browsers don't support document.write in result document of xslt transformation, see https://developer.mozilla.org/en/docs/xsl_transformations_in_mozilla_faq#what_about_document.write.3f.
as javascript apache fop, no, don't think there document object available. , not sure why need script create fo:block element, xslt suffices use literal result element e.g.
<xsl:template match="foo"> <fo:block>some text</fo:block> </xsl:template>
Comments
Post a Comment