Class XMLObj

    • Field Detail

      • element

        protected org.w3c.dom.Element element
        DOM element representing this node
      • doc

        protected org.w3c.dom.Document doc
        DOM document containing this node
      • name

        protected java.lang.String name
        Name of the node
    • Constructor Detail

      • XMLObj

        public XMLObj​(FONode parent)
        Base constructor
        Parameters:
        parent - FONode that is the parent of this object
    • Method Detail

      • validateChildNode

        protected void validateChildNode​(org.xml.sax.Locator loc,
                                         java.lang.String nsURI,
                                         java.lang.String localName)
                                  throws ValidationException
        Checks to make sure, during SAX processing of input document, that the incoming node is valid for this (parent) node (e.g., checking to see that fo:table is not an immediate child of fo:root) called from FOTreeBuilder.startElement(String, String, String, Attributes) before constructing the child FObj.
        Here, blocks XSL-FO's from having non-FO parents.
        Overrides:
        validateChildNode in class FONode
        Parameters:
        loc - location in the FO source file
        nsURI - namespace of incoming node
        localName - name of the incoming node (without namespace prefix)
        Throws:
        ValidationException - if incoming node not valid for parent
      • processNode

        public void processNode​(java.lang.String elementName,
                                org.xml.sax.Locator locator,
                                org.xml.sax.Attributes attlist,
                                PropertyList propertyList)
                         throws FOPException
        Initialize the node with its name, location information, and attributes The attributes must be used immediately as the sax attributes will be altered for the next element.
        Overrides:
        processNode in class FONode
        Parameters:
        elementName - element name (e.g., "fo:block")
        locator - Locator object (ignored by default)
        attlist - Collection of attributes passed to us from the parser.
        propertyList - the property list of the parent node
        Throws:
        FOPException - for errors or inconsistencies in the attributes
      • getDOMDocument

        public org.w3c.dom.Document getDOMDocument()
        Returns:
        DOM document representing this foreign XML
      • getDimension

        public java.awt.geom.Point2D getDimension​(java.awt.geom.Point2D view)
        Returns the dimensions of the generated area in pts.
        Parameters:
        view - Point2D instance to receive the dimensions
        Returns:
        the requested dimensions in pts.
      • getIntrinsicAlignmentAdjust

        public Length getIntrinsicAlignmentAdjust()
        Retrieve the intrinsic alignment-adjust of the child element.
        Returns:
        the intrinsic alignment-adjust.
      • getLocalName

        public java.lang.String getLocalName()
        Returns the local name (i.e. without namespace prefix) of the node
        Specified by:
        getLocalName in class FONode
        Returns:
        the local name of this node
      • addElement

        public void addElement​(org.w3c.dom.Document doc,
                               org.w3c.dom.Element parent)
        Add an element to the DOM document
        Parameters:
        doc - DOM document to which to add an element
        parent - the parent element of the element that is being added
      • buildTopLevel

        public void buildTopLevel​(org.w3c.dom.Document doc,
                                  org.w3c.dom.Element svgRoot)
        Add the top-level element to the DOM document
        Parameters:
        doc - DOM document
        svgRoot - non-XSL-FO element to be added as the root of this document
      • createBasicDocument

        public org.w3c.dom.Document createBasicDocument()
        Create an empty DOM document
        Returns:
        DOM document
      • addChildNode

        protected void addChildNode​(FONode child)
        Adds a node as a child of this node. The default implementation of this method just ignores any child node being added.
        Overrides:
        addChildNode in class FONode
        Parameters:
        child - child node to be added to the childNodes of this node
      • characters

        protected void characters​(char[] data,
                                  int start,
                                  int length,
                                  PropertyList pList,
                                  org.xml.sax.Locator locator)
                           throws FOPException
        Adds characters. Does nothing by default. To be overridden in subclasses that allow #PCDATA content.
        Overrides:
        characters in class FONode
        Parameters:
        data - array of characters containing text to be added
        start - starting array element to add
        length - number of elements to add
        pList - currently applicable PropertyList
        locator - location in the XSL-FO source file.
        Throws:
        FOPException - if there's a problem during processing