Package org.pdf4j.saxon.event

Examples of org.pdf4j.saxon.event.SerializerFactory


     * @return a receiver to which XML events will be sent
     */

    protected Receiver getReceiver(Configuration config, Controller controller, Properties predefinedProperties) throws SaxonApiException {
        try {
            SerializerFactory sf = config.getSerializerFactory();
            PipelineConfiguration pipe = (controller==null ? config.makePipelineConfiguration() : controller.makePipelineConfiguration());
            Properties props  = new Properties();
            for (Property p : properties.keySet()) {
                String value = properties.get(p);
                props.setProperty(p.toString(), value);
            }
            if (predefinedProperties != null) {
                Enumeration eps = predefinedProperties.propertyNames();
                while (eps.hasMoreElements()) {
                    String name = (String)eps.nextElement();
                    String value = predefinedProperties.getProperty(name);
                    if (props.getProperty(name) == null) {
                        props.setProperty(name, value);
                    } else if (name.equals(OutputKeys.CDATA_SECTION_ELEMENTS) || name.equals(SaxonOutputKeys.SUPPRESS_INDENTATION)) {
                        props.setProperty(name, props.getProperty(name) + " " + value);
                    }
                }
            }
            return sf.getReceiver(result, pipe, props);
        } catch (XPathException e) {
            throw new SaxonApiException(e);
        }
    }
View Full Code Here


        if (props == null) {
            props = new Properties();
        }
        props = SaxonXQSequence.setDefaultProperties(props);
        try {
            SerializerFactory sf = config.getSerializerFactory();
            PipelineConfiguration pipe = config.makePipelineConfiguration();
            Receiver out = sf.getReceiver(result, pipe, props);
            TreeReceiver tr = new TreeReceiver(out);
            tr.open();
            tr.append(item, 0, NodeInfo.ALL_NAMESPACES);
            tr.close();
        } catch (XPathException e) {
View Full Code Here

TOP

Related Classes of org.pdf4j.saxon.event.SerializerFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.