Project

Profile

Help

Revision e8aca6ed

Added by Michael Kay about 13 years ago

Fix bug 2283584 - s9api Serializer with character maps

View differences:

latest9.1/bj/net/sf/saxon/s9api/Serializer.java
1 1
package net.sf.saxon.s9api;
2 2

  
3 3
import net.sf.saxon.Configuration;
4
import net.sf.saxon.Controller;
4 5
import net.sf.saxon.event.PipelineConfiguration;
5 6
import net.sf.saxon.event.Receiver;
6 7
import net.sf.saxon.event.SaxonOutputKeys;
......
15 16
import java.io.Writer;
16 17
import java.net.URI;
17 18
import java.net.URISyntaxException;
19
import java.util.Enumeration;
18 20
import java.util.HashMap;
19 21
import java.util.Map;
20 22
import java.util.Properties;
21
import java.util.Enumeration;
22 23

  
23 24
/**
24 25
 * A Serializer takes a tree representation of XML and turns it into lexical XML markup.
......
322 323
     */
323 324

  
324 325
    public Receiver getReceiver(Configuration config) throws SaxonApiException {
325
        return getReceiver(config, null);
326
        return getReceiver(config, null, null);
326 327
    }
327 328

  
328 329
    /**
......
330 331
     * primarily for system use, though it could also be called by user applications
331 332
     * wanting to make use of the Saxon serializer.
332 333
     * @param config The Saxon configuration.
334
     * @param controller The Saxon controller (of the transformation). May be null.
333 335
     * @param predefinedProperties values of serialization properties defined within a query or stylesheet,
334 336
     * which will be used in the event that no value for the corresponding property has been defined in
335 337
     * the Serializer itself. May be null if no serialization properties have been predefined.
336 338
     * @return a receiver to which XML events will be sent
337 339
     */
338 340

  
339
    protected Receiver getReceiver(Configuration config, Properties predefinedProperties) throws SaxonApiException {
341
    protected Receiver getReceiver(Configuration config, Controller controller, Properties predefinedProperties) throws SaxonApiException {
340 342
        try {
341 343
            SerializerFactory sf = config.getSerializerFactory();
342
            PipelineConfiguration pipe = config.makePipelineConfiguration();
344
            PipelineConfiguration pipe = (controller==null ? config.makePipelineConfiguration() : controller.makePipelineConfiguration());
343 345
            Properties props  = new Properties();
344 346
            for (Property p : properties.keySet()) {
345 347
                String value = properties.get(p);
latest9.1/bj/net/sf/saxon/s9api/XQueryEvaluator.java
241 241
                if (destination instanceof Serializer) {
242 242
                    receiver = ((Serializer)destination).getReceiver(
243 243
                            expression.getExecutable().getConfiguration(),
244
                            null,
244 245
                            expression.getExecutable().getDefaultOutputProperties());
245 246
                } else {
246 247
                    receiver = destination.getReceiver(expression.getExecutable().getConfiguration());
......
270 271
            if (destination instanceof Serializer) {
271 272
                receiver = ((Serializer)destination).getReceiver(
272 273
                        expression.getExecutable().getConfiguration(),
274
                        null,
273 275
                        expression.getExecutable().getDefaultOutputProperties());
274 276
            } else {
275 277
                receiver = destination.getReceiver(expression.getExecutable().getConfiguration());
latest9.1/bj/net/sf/saxon/s9api/XsltTransformer.java
224 224
            Receiver receiver;
225 225
            if (destination instanceof Serializer) {
226 226
                receiver = ((Serializer)destination).getReceiver(
227
                        controller.getConfiguration(), controller.getOutputProperties());
227
                        controller.getConfiguration(), controller, controller.getOutputProperties());
228 228
            } else {
229 229
                receiver = destination.getReceiver(controller.getConfiguration());
230 230
            }

Also available in: Unified diff