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.

  • 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 - typeHierarchy new namepool
  • Method Details

    • startElement

      public void startElement(NodeName elemName, SchemaType type, AttributeMap attributes, NamespaceMap namespaces, Location location, int properties) throws XPathException
      Output element start tag
      Specified by:
      startElement in interface Receiver
      Overrides:
      startElement in class ProxyReceiver
      Parameters:
      elemName - the name of the element.
      type - the type annotation of the element.
      attributes - the attributes of this element
      namespaces - the in-scope namespaces of this element: generally this is all the in-scope namespaces, without relying on inheriting namespaces from parent elements
      location - an object providing information about the module, line, and column where the node originated
      properties - bit-significant properties of the element node. If there are no relevant properties, zero is supplied. The definitions of the bits are in class ReceiverOption
      Throws:
      XPathException - if an error occurs