/** * Set output properties, from an {@link SerializationProperties} object. The keys in the contained * {@code Properties} object are QNames in Clark format, that is "{uri}local"; any QNames * within the values must also be in this format. * <p>The values supplied are typically those specified in the stylesheet or query. In the case of XSLT, * they are typically the properties associated with unnamed xsl:output declarations.</p> * * @param suppliedProperties the output properties to be used. These overwrite any properties * that have been individually specified using * {@link #setOutputProperty(Property, String)} setOutputProperty} * @since 9.9 */ public void setOutputProperties(SerializationProperties suppliedProperties) { setOutputProperties(suppliedProperties.getProperties()); setCharacterMap(suppliedProperties.getCharacterMapIndex()); }
/** * Set output properties, from an {@link SerializationProperties} object. The keys in the contained * {@code Properties} object are QNames in Clark format, that is "{uri}local"; any QNames * within the values must also be in this format. * <p>The values supplied are typically those specified in the stylesheet or query. In the case of XSLT, * they are typically the properties associated with unnamed xsl:output declarations.</p> * * @param suppliedProperties the output properties to be used. These overwrite any properties * that have been individually specified using * {@link #setOutputProperty(Property, String)} setOutputProperty} * @since 9.9 */ public void setOutputProperties(SerializationProperties suppliedProperties) { setOutputProperties(suppliedProperties.getProperties()); setCharacterMap(suppliedProperties.getCharacterMapIndex()); }
@Override public Receiver resolve(XPathContext context, String href, String baseUri, SerializationProperties properties) throws XPathException { URI absolute = getAbsoluteUri(href, baseUri); if (absolute.getScheme().equals(dummyBaseOutputUriScheme)) { throw new XPathException("The location of output documents is undefined: use the transform option base-output-uri", "FOXT0002"); } StringWriter writer = new StringWriter(); Serializer serializer = makeSerializer(null); serializer.setCharacterMap(properties.getCharacterMapIndex()); serializer.setOutputWriter(writer); serializer.onClose(() -> results.put(absolute.toASCIIString(), writer.toString())); try { Receiver out = serializer.getReceiver(context.getReceiver().getPipelineConfiguration(), properties); out.setSystemId(absolute.toASCIIString()); return out; } catch (SaxonApiException e) { throw XPathException.makeXPathException(e); } }
@Override public Receiver resolve(XPathContext context, String href, String baseUri, SerializationProperties properties) throws XPathException { URI absolute = getAbsoluteUri(href, baseUri); if (absolute.getScheme().equals(dummyBaseOutputUriScheme)) { throw new XPathException("The location of output documents is undefined: use the transform option base-output-uri", "FOXT0002"); } StringWriter writer = new StringWriter(); Serializer serializer = makeSerializer(null); serializer.setCharacterMap(properties.getCharacterMapIndex()); serializer.setOutputWriter(writer); serializer.onClose(() -> results.put(absolute.toASCIIString(), writer.toString())); try { Receiver out = serializer.getReceiver(context.getReceiver().getPipelineConfiguration(), properties); out.setSystemId(absolute.toASCIIString()); return out; } catch (SaxonApiException e) { throw XPathException.makeXPathException(e); } }
CharacterMapIndex charMapIndex = new CharacterMapIndex(); charMapIndex.putCharacterMap(charMap.getName(), charMap); serializer.setCharacterMap(charMapIndex); String existing = serializer.getOutputProperty(Serializer.Property.USE_CHARACTER_MAPS); if (existing == null) {
CharacterMapIndex charMapIndex = new CharacterMapIndex(); charMapIndex.putCharacterMap(charMap.getName(), charMap); serializer.setCharacterMap(charMapIndex); String existing = serializer.getOutputProperty(Serializer.Property.USE_CHARACTER_MAPS); if (existing == null) {