| FAQThis page provides answers to the most frequently asked questions regarding XMLmind XSL-FO Converter (XFC for short) and its graphical user interface (XSL Utility). Questions regarding the evaluation of XFC
End user questions
Questions regarding the evaluation of XFCQ: Do you have a trial version of XFC Professional Edition? A: No. XFC Personal Edition can be used to evaluate XFC is terms of speed and quality of output. Note that XSL Utility prints on its console the time spent in each step of the XML processing pipeline. Example: Compiling stylesheet "/usr/local/src/xfc-40/xslu/config/docbook/xsl/fo/docbook.xsl"... Stylesheet compiled in 1.183s. Transforming input "/home/hussein/src/xxe/docsrc/xvalid/xvalid.xml"... Input transformed in 1.264s. Processing FO "/home/hussein/src/xxe/docsrc/xvalid/xfcxslu63532.tmp"... FO processed in 0.359s. Conversion completed. Q: I have tested XFC using Personal Edition. But now, I need to estimate how long it will take me to integrate XFC in my application. How can I do that? A: XFC is very easy to integrate in any application. The following code converts an XSL-FO file to an RTF file: import com.xmlmind.fo.converter.Driver;
public class Sample1 {
public static void main(String[] args) throws Exception {
if (args.length != 2) {
System.err.println("usage: java Sample1 fo_file rtf_file");
System.exit(1);
}
Driver xfc = new Driver();
xfc.setProperty("outputFormat", "rtf");
xfc.setInput(args[0]);
xfc.setOutput(args[1]);
xfc.convert();
}
}The following code converts an XML file to an RTF file, using any JAXP-compliant XSLT engine: import java.io.File;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.Transformer;
import javax.xml.transform.Templates;
import javax.xml.transform.stream.StreamSource;
import javax.xml.transform.stream.StreamResult;
import com.xmlmind.fo.converter.Driver;
public class Sample2 {
public static void main(String[] args) throws Exception {
if (args.length != 3) {
System.err.println("usage: java Sample2 xslt_stylesheet" +
" xml_file rtf_file");
System.exit(1);
}
TransformerFactory factory = TransformerFactory.newInstance();
Templates compiledStylesheet =
factory.newTemplates(new StreamSource(new File(args[0])));
Transformer transformer = compiledStylesheet.newTransformer();
File xmlFile = new File(args[1]);
File foFile = File.createTempFile("sample2_", ".fo");
transformer.transform(new StreamSource(xmlFile),
new StreamResult(foFile));
Driver xfc = new Driver();
xfc.setProperty("outputFormat", "rtf");
xfc.setProperty("baseURL",
xmlFile.getParentFile().toURL().toExternalForm());
xfc.setInput(foFile.getPath());
xfc.setOutput(args[2]);
xfc.convert();
foFile.delete();
}
}Refer to the API documentation [Java] [.NET] for additional information. Q: This XSL technology seems elegant but also terribly complex. What can you say to convince me to take the time to learn it? A: This technology is not that complex. And it is certainly less tedious to learn than PDF, RTF, WML, OpenOffice, etc. XSL-FO is conceptually simple. Basically Formatting Objects are just nested blocks and text containers with attached style properties. XSL-FO is not harder to learn than HTML+CSS. XSLT is clearly more challenging to learn than XSL-FO. Alternatively you can use XML Query (AKA XQuery), which is, in our opinion, easier to learn and to use than XSLT. We recommend using one of these two XML query processors: qizx/open or Saxon 8+. Also note that, for some applications, directly generating XSL-FOs is the simplest and most efficient solution. Q: XFC is an XSL-FO processor written in JavaTM and, by experience, I know that XML processing in JavaTM is slow to the point of being unusable. Is XFC really usable in a production environment? A: Yes, if you do not implement the XML processing pipeline naively and if you carefully choose your software components:
Q: Now that all major office automation formats are publicly available, well-documented, XML-based standards, why would I need a software component such as XFC? A: Nowadays, all major office automation formats are based on very low-level XML vocabularies expressing in great details how to layout some text on a page. WorprocessingML example (paragraph containing the following text "Some unnamed character level styles: underline, italic, bold."): <w:p>
<w:r>
<w:t>Some unnamed character level styles: </w:t>
</w:r>
<w:r>
<w:rPr>
<w:u w:val="single"/>
</w:rPr>
<w:t>underline</w:t>
</w:r>
<w:r>
<w:t>, </w:t>
</w:r>
<w:r>
<w:rPr>
<w:i/>
<w:i-cs/>
</w:rPr>
<w:t>italic</w:t>
</w:r>
<w:r>
<w:t>, </w:t>
</w:r>
<w:r>
<w:rPr>
<w:b/>
</w:rPr>
<w:t>bold</w:t>
</w:r>
<w:r>
<w:t>.</w:t>
</w:r>
</w:p>The documentation of these formats is always very large and often obscure. Therefore, learning these formats is uninteresting and takes a long time. This being said, now let's compare the different methods which may be used to automatically generate documents in office automation formats:
End user questionsQ: I use the page-number-citation object to print the number of pages in my document, but the displayed value is always 0 when I load the document in MS-Word. How can I get the correct value? A: Page references are implemented with RTF fields. The values of these fields are not automatically updated when loading a document in MS-Word. The easiest way to update all field values is to force a repagination of the document, for instance by switching to the Page Layout view. This will work fine for fields in the body of the document, but not for those in the headers/footers. To update fields in the headers or footers of a document, proceed as follows:
© 2003-2008 Pixware. Updated 2008/2/22 using Qizx/open. Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. Acrobat and PostScript are trademarks of Adobe Systems Incorporated. |