org.apache.xalan.transformer
Class SerializerSwitcher

java.lang.Object
  extended byorg.apache.xalan.transformer.SerializerSwitcher

public class SerializerSwitcher
extends Object

This is a helper class that decides if Xalan needs to switch serializers, based on the first output element.


Constructor Summary
SerializerSwitcher()
           
 
Method Summary
private static String getOutputPropertyNoDefault(String qnameString, Properties props)
          Get the value of a property, without using the default properties.
static Serializer switchSerializerIfHTML(String ns, String localName, Properties props, Serializer oldSerializer)
          Switch to HTML serializer if element is HTML
static void switchSerializerIfHTML(TransformerImpl transformer, String ns, String localName)
          Switch to HTML serializer if element is HTML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SerializerSwitcher

public SerializerSwitcher()
Method Detail

switchSerializerIfHTML

public static void switchSerializerIfHTML(TransformerImpl transformer,
                                          String ns,
                                          String localName)
                                   throws javax.xml.transform.TransformerException
Switch to HTML serializer if element is HTML

Parameters:
transformer - Non-null transformer instance
ns - Namespace URI of the element
localName - Local part of name of element
Throws:
javax.xml.transform.TransformerException

getOutputPropertyNoDefault

private static String getOutputPropertyNoDefault(String qnameString,
                                                 Properties props)
                                          throws IllegalArgumentException
Get the value of a property, without using the default properties. This can be used to test if a property has been explicitly set by the stylesheet or user.

Returns:
The value of the property, or null if not found.
Throws:
IllegalArgumentException - If the property is not supported, and is not namespaced.

switchSerializerIfHTML

public static Serializer switchSerializerIfHTML(String ns,
                                                String localName,
                                                Properties props,
                                                Serializer oldSerializer)
                                         throws javax.xml.transform.TransformerException
Switch to HTML serializer if element is HTML

Parameters:
ns - Namespace URI of the element
localName - Local part of name of element
Returns:
new contentHandler.
Throws:
javax.xml.transform.TransformerException