XMLXMLHandler (Apache FOP Core 2.11 API)
Date: 2025-04-24

org.apache.fop.render.xml

## Class XMLXMLHandler

- java.lang.Object
- - org.apache.fop.render.xml.XMLXMLHandler

- All Implemented Interfaces:
    XMLHandler

      public class XMLXMLHandler
      extends Object
      implements XMLHandler

  XML handler for the XML renderer.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `HANDLER` Key for getting the TransformerHandler from the RendererContext

    - ### Fields inherited from interface org.apache.fop.render.XMLHandler

      `HANDLE_ALL`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `XMLXMLHandler()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getNamespace()`
    `void` | `handleXML(RendererContext context, Document doc, String ns)` Handle an external xml document inside a Foreign Object Area.
    `boolean` | `supportsRenderer(Renderer renderer)` Checks if this XMLHandler supports handling an XML namespace for a particular renderer.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### HANDLER

          public static final String HANDLER

      Key for getting the TransformerHandler from the RendererContext
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### XMLXMLHandler

          public XMLXMLHandler()

  - ### Method Detail

    - #### handleXML

          public void handleXML(RendererContext context,
                                Document doc,
                                String ns)
                         throws Exception

      Handle an external xml document inside a Foreign Object Area.

      This may throw an exception if for some reason it cannot be handled. The caller is expected to deal with this exception.

      The implementation may convert the XML document internally to another XML dialect (SVG, for example) and call renderXML() on the AbstractRenderer again (which can be retrieved through the RendererContext).

      Specified by:
        `handleXML` in interface `XMLHandler`
      Parameters:
        `context` - The RendererContext (contains the user agent)
        `doc` - A DOM containing the foreign object to be processed
        `ns` - The Namespace of the foreign object
      Throws:
        `Exception` - If an error occurs during processing.

    - #### supportsRenderer

          public boolean supportsRenderer(Renderer renderer)

      Checks if this XMLHandler supports handling an XML namespace for a particular renderer.
      Specified by:
        `supportsRenderer` in interface `XMLHandler`
      Parameters:
        `renderer` - the renderer for which to check.
      Returns:
        true if this XML handler supports a particular renderer

    - #### getNamespace

          public String getNamespace()

      Specified by:
        `getNamespace` in interface `XMLHandler`
      Returns:
        the XML namespace for the XML dialect this XMLHandler supports, null if all XML content is handled by this instance.

Copyright © 2025 Apache Software Foundation. All rights reserved.