Class NamePoolConverter

All Implemented Interfaces:
Result, Receiver

public class NamePoolConverter extends ProxyReceiver
This class is a filter that passes all Receiver events through unchanged, except that it changes namecodes to allow for the source and the destination using different NamePools. This is necessary when a stylesheet has been constructed as a general document (e.g. as the result of a transformation) and is passed to newTemplates() to be compiled as a stylesheet.

The type annotations of nodes passed through this filter must be built-in types in the XSD namespace, because user-defined types belong to a specific Configuration and cannot readily be transferred. In practice the class is used only for untyped trees.

  • Field Details

  • Constructor Details

    • NamePoolConverter

      public NamePoolConverter(Receiver next, NamePool oldPool, NamePool newPool)
      Constructor
      Parameters:
      next - the next receiver in the pipeline
      oldPool - the old namepool
      newPool - th new namepool
  • Method Details

    • startElement

      public void startElement(NodeName name, SchemaType type, Location location, int properties) throws XPathException
      Output element start tag
      Specified by:
      startElement in interface Receiver
      Overrides:
      startElement in class ProxyReceiver
      Parameters:
      name - integer code identifying the name of the element within the name pool.
      type - the element's type annotation.
      location - a location associated with the event (typically either a location in the source document or the stylesheet)
      properties - properties of the element node
      Throws:
      XPathException - if an error occurs
    • attribute

      public void attribute(NodeName name, SimpleType type, CharSequence value, Location location, int properties) throws XPathException
      Handle an attribute
      Specified by:
      attribute in interface Receiver
      Overrides:
      attribute in class ProxyReceiver
      Parameters:
      name - The name of the attribute
      type - The type of the attribute
      value - the string value of the attribute
      location - The location of the node
      properties - Bit significant value. The following bits are defined:
      DISABLE_ESCAPING
      Disable escaping for this attribute
      NO_SPECIAL_CHARACTERS
      Attribute value contains no special characters
      Throws:
      XPathException - if an error occurs