Class XMLDoc

  • All Implemented Interfaces:
    java.lang.Cloneable, IStreamWriter
    Direct Known Subclasses:
    JDFDoc

    public class XMLDoc
    extends java.lang.Object
    implements java.lang.Cloneable, IStreamWriter
    • Constructor Summary

      Constructors 
      Constructor Description
      XMLDoc()
      constructor
      XMLDoc​(java.lang.String strDocType)
      convenience constructor
      XMLDoc​(java.lang.String strDocType, java.lang.String namespaceURI)
      constructor
      XMLDoc​(DocumentXMLImpl document)
      constructor
      XMLDoc​(XMLDoc other)
      constructor
      XMLDoc​(org.w3c.dom.Document document)
      constructor
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      org.w3c.dom.Node appendChild​(org.w3c.dom.Node newChild)
      append a new child node to 'this'
      XMLDoc clone()
      clone the document, completely severing all connections to the original document
      org.w3c.dom.Node cloneNode​(boolean deep)
      get a copy of 'this'
      void copyMeta​(XMLDoc dMine)
      copy metadata from other document
      org.w3c.dom.Attr createAttribute​(java.lang.String name)
      createAttribute in namespace JDFCoreConstants.NONAMESPACE (DOM Level 2)
      org.w3c.dom.Attr createAttributeNS​(java.lang.String namespaceURI, java.lang.String qualifiedName)
      create an attribute withe the given name in the given namespace
      org.w3c.dom.CDATASection createCDATASection​(java.lang.String data)
      create a CDATA section, which has this document as ownerDoc
      org.w3c.dom.Comment createComment​(java.lang.String data)
      createComment
      org.w3c.dom.DocumentFragment createDocumentFragment()
      createDocumentFragment
      org.w3c.dom.DocumentType createDocumentType​(java.lang.String qualifiedName, java.lang.String publicID, java.lang.String systemID)
      createDocumentType
      org.w3c.dom.Element createElement​(java.lang.String elementName)
      createElement create a JDFElement that floats in nirvana.
      org.apache.xerces.dom.ElementDefinitionImpl createElementDefinition​(java.lang.String name)
      creates an element definition.
      org.w3c.dom.Element createElementNS​(java.lang.String namespaceURI, java.lang.String qualifiedName)
      create a Element that floats in nirvana, this must be appended to a node with appendChild
      org.w3c.dom.Entity createEntity​(java.lang.String name)
      create an entity
      org.w3c.dom.EntityReference createEntityReference​(java.lang.String name)
      creates an EntityReference
      org.w3c.dom.events.Event createEvent​(java.lang.String type)
      create an Event object
      org.w3c.dom.traversal.NodeIterator createNodeIterator​(org.w3c.dom.Node root, int whatToShow, org.w3c.dom.traversal.NodeFilter filter, boolean entityReferenceExpansion)
      createNodeIterator
      org.w3c.dom.traversal.NodeIterator createNodeIterator​(org.w3c.dom.Node root, short whatToShow, org.w3c.dom.traversal.NodeFilter filter)
      create a node iterator
      org.w3c.dom.Notation createNotation​(java.lang.String name)
      creates a Notation having this Document as its OwnerDoc
      org.w3c.dom.ProcessingInstruction createProcessingInstruction​(java.lang.String target, java.lang.String data)
      creates a ProcessingInstruction having this Document as ownerDoc
      org.w3c.dom.ranges.Range createRange()
      createRange
      protected XMLDoc createRoot​(org.w3c.dom.Document document)  
      org.w3c.dom.Text createTextNode​(java.lang.String data)
      createTextNode
      org.w3c.dom.traversal.TreeWalker createTreeWalker​(org.w3c.dom.Node root, int whatToShow, org.w3c.dom.traversal.NodeFilter filter, boolean entityReferenceExpansion)
      creates a TreeWalker
      org.w3c.dom.traversal.TreeWalker createTreeWalker​(org.w3c.dom.Node root, short whatToShow, org.w3c.dom.traversal.NodeFilter filter)
      creates a TreeWalker
      boolean equals​(java.lang.Object o)  
      protected boolean flush()
      Method Flush
      clean the m_doc and restart from scratch.
      org.w3c.dom.NamedNodeMap getAttributes()
      get the attributes associated with this node
      javax.mail.BodyPart getBodyPart()
      get the Javax.Mail.BodyPart
      protected org.w3c.dom.Node getChildNode​(int nodeType, int iPos)
      gets the n'th child node of nodetype nodeType with n = iPos
      org.w3c.dom.NodeList getChildNodes()
      get the child nodes of this node
      long getDocMemoryUsed()
      rough guestimate of the memory used by this if called after parsing
      org.w3c.dom.DocumentType getDoctype()
      getDoctype
      org.w3c.dom.Element getDocumentElement()
      getDocumentElement
      org.w3c.dom.Element getElementById​(java.lang.String elementId)
      get element with ID = elementId similar to Docoment.getElementByID but works with non schema parsed documents
      org.w3c.dom.NodeList getElementsByTagName​(java.lang.String tagname)
      return a NodeList of all elements having the specified tagname
      org.w3c.dom.NodeList getElementsByTagNameNS​(java.lang.String namespaceURI, java.lang.String myLocalName)
      get a NodeList of all elements with a given name and namespace URI
      boolean getErrorChecking()
      does the DOM implementation perform error checking upon operations?
      org.w3c.dom.Node getFirstChild()
      get the first child node of 'this'
      org.w3c.dom.Element getIdentifier​(java.lang.String idName)
      gets the element with the registered name = "idName"
      java.util.Enumeration<?> getIdentifiers()
      gets the registered identifiers
      protected DocumentXMLImpl getImpl()  
      org.w3c.dom.DOMImplementation getImplementation()
      getImplementation
      static int getIndent()  
      org.w3c.dom.Node getLastChild()
      get the last child node of 'this'
      static int getLineWidth()  
      java.lang.String getLocalName()
      get the the local part of the qualified name of 'this'
      DocumentXMLImpl getMemberDocument()
      getMemberDocument
      javax.mail.Multipart getMultiPart()
      get the Javax.Mail.Multipart
      org.w3c.dom.Node getNextSibling()
      get the next sibling of 'this'
      org.w3c.dom.Node getNode​(short type, int skip, java.lang.String nodeName)  
      java.lang.String getNodeName()
      gets the node name
      short getNodeType()
      get node type
      java.lang.String getNodeValue()
      gets the node value
      JDFAttributeMap getNSMap()
      get a copy of the nsmap
      java.lang.String getOriginalFileName()  
      org.w3c.dom.Node getParentNode()
      get the parent node of 'this' node
      java.lang.String getPrefix()
      get the namespace prefix of 'this' node
      org.w3c.dom.Node getPreviousSibling()
      get the previous sibling of 'this'
      org.w3c.dom.ProcessingInstruction getProcessingInstruction​(int skip, java.lang.String name)  
      KElement getRoot()
      get the root of the dom tree
      java.lang.String getRootName()  
      java.lang.String getSchemaLocation​(java.lang.String nsURI)  
      java.io.File getSchemaLocationFile​(java.lang.String nsURI)  
      XMLDoc getValidationResult()  
      java.lang.String getXMLComment()
      gets of 'this' the text of the i-th child XMLComment.
      protected XMLParser getXMLParser()  
      java.lang.String getXSLTURL()
      gets the url for an xslt stylesheet e
      ZipReader getZipReader()
      get the ZipReader
      boolean hasAttributes()
      check if 'this' has attributes
      boolean hasChildNodes()
      test if 'this' has any children
      int hashCode()  
      org.w3c.dom.Node importNode​(org.w3c.dom.Node importedNode, boolean deep)
      copy a node from another document in this document
      org.w3c.dom.Node insertBefore​(org.w3c.dom.Node newChild, org.w3c.dom.Node refChild)
      insert a new node before a given node
      boolean isDirty()
      check whether the underlying document is null
      boolean isNull()
      check whether the underlying document is null
      boolean isSchemaValid()  
      boolean isSupported​(java.lang.String feature, java.lang.String version)
      test whether a specific DOMImplelementation feature is supported by 'this'
      void normalize()
      normalize
      static XMLDoc parseFile​(java.io.File file)
      parse an XML file
      static XMLDoc parseFile​(java.lang.String fileName)
      parse an XML file
      static XMLDoc parseStream​(java.io.InputStream is)
      parse a JDF input stream
      static XMLDoc parseString​(java.lang.String string)
      parse an XML file
      static XMLDoc parseURL​(java.lang.String url, javax.mail.BodyPart bp)
      parse a given url
      static XMLDoc parseZipFile​(java.io.File file)
      parse an XML file
      protected void pushParser​(XMLParser xmlParser)  
      void putIdentifier​(java.lang.String idName, org.w3c.dom.Element element)
      Registers an identifier name with a specified element node
      org.w3c.dom.Node removeChild​(org.w3c.dom.Node oldChild)
      remove a child from 'this'
      void removeIdentifier​(java.lang.String idName)
      remove element with identifier "idName"
      org.w3c.dom.Node replaceChild​(org.w3c.dom.Node newChild, org.w3c.dom.Node oldChild)
      replace a child node with a new one
      void setBodyPart​(javax.mail.BodyPart bodyPart)
      set the Javax.Mail.BodyPart
      void setErrorChecking​(boolean check)
      sets whether the DOM implementation performs error checking upon operations
      static void setIndent​(int indent)  
      static void setLineWidth​(int lineWidth)  
      protected void setMemberDoc​(DocumentXMLImpl myDoc)  
      void setNodeValue​(java.lang.String nodeValue)
      set the node value
      void setNSMap​(XMLDoc other)
      set the namespace map from another document
      void setOriginalFileName​(java.lang.String originalFileName)  
      void setPrefix​(java.lang.String prefix)
      set the namespace prefix of 'this' node
      KElement setRoot​(java.lang.String strDocType, java.lang.String namespaceURI)
      initialize a new root of strDocType in the document called by constructor XMLDoc(String strDocType)
      void setSchemaLocation​(java.lang.String nsURI, java.io.File _schemaLocation)
      set xs:schemalocation to
      void setValidationResult​(XMLDoc validationResult)  
      void setXPathValues​(JDFAttributeMap valueMap)
      set the xpath values of thei to the values in the node
      void setXSLTURL​(java.lang.String url)
      sets the processing instruction for an xslt stylesheet
      void setZipReader​(ZipReader zip)
      set the ZipReader
      java.lang.String toString()
      toString
      java.lang.String toXML()
      toXML
      boolean write2File​(java.io.File oFilePath)
      write2File - write to a file; Create if it doesn't exist always assume utf-8 encoding
      boolean write2File​(java.io.File file, int indent, boolean bPreserveSpace)
      write2File - write to a file; Create if it doesn't exist
      boolean write2File​(java.lang.String oFilePath)
      write2File - write to a file; Create if it doesn't exist always assume utf-8 encoding
      boolean write2File​(java.lang.String oFilePath, int indent)
      Deprecated.
      060419 use write2File(oFilePath, indent, true);
      boolean write2File​(java.lang.String oFilePath, int indent, boolean bPreserveSpace)
      write2File - write to a file; Create if it doesn't exist DO NOT attempt any url escaping voodoo @see write2URL
      UrlPart write2HttpURL​(java.net.URL url, java.lang.String strContentType, HTTPDetails det)  
      java.net.HttpURLConnection write2HTTPURL​(java.net.URL url, java.lang.String strContentType, HTTPDetails det)  
      void write2Stream​(java.io.OutputStream outStream, int indent)  
      void write2Stream​(java.io.OutputStream outStream, int indent, boolean bPreserveSpace)
      write this to a stream
      static void write2StreamStatic​(org.w3c.dom.Element elem, java.io.OutputStream outStream, int indent)
      Deprecated.
      060306
      static void write2StreamStatic​(org.w3c.dom.Element elem, java.io.OutputStream outStream, int indent, boolean bPreserveSpace)
      Deprecated.
      060306
      java.lang.String write2String​(int indent)
      write2String - write to a string;
      XMLDoc write2URL​(java.lang.String strURL, java.lang.String strContentType)
      This method sends the contents of this XMLDoc to the URL strURL and receives the response in the returned XMLDoc.
      XMLDoc write2URL​(java.lang.String strURL, java.lang.String strContentType, HTTPDetails details)
      This method sends the contents of this XMLDoc to the URL strURL and receives the response in the returned XMLDoc.
      java.io.File write2Zip​(java.io.File file)
      write2Zip - write to a file and compress as zip; remove the .zip from the extension in the zip entry or add .zip
      void writeStream​(java.io.OutputStream stream)
      write myself to a stream
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • XMLDoc

        public XMLDoc()
        constructor
      • XMLDoc

        public XMLDoc​(org.w3c.dom.Document document)
        constructor
        Parameters:
        document -
      • XMLDoc

        public XMLDoc​(DocumentXMLImpl document)
        constructor
        Parameters:
        document -
      • XMLDoc

        public XMLDoc​(XMLDoc other)
        constructor
        Parameters:
        other -
      • XMLDoc

        public XMLDoc​(java.lang.String strDocType)
        convenience constructor
        Parameters:
        strDocType - ElementName.JDF, ElementName.JMF, "Config" ...
      • XMLDoc

        public XMLDoc​(java.lang.String strDocType,
                      java.lang.String namespaceURI)
        constructor
        Parameters:
        strDocType - ElementName.JDF, ElementName.JMF, "Config" ...
        namespaceURI - namespace to be used by the new XMLDoc
    • Method Detail

      • getIndent

        public static int getIndent()
      • setIndent

        public static void setIndent​(int indent)
      • getLineWidth

        public static int getLineWidth()
      • setLineWidth

        public static void setLineWidth​(int lineWidth)
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
        See Also:
        Object.equals(java.lang.Object)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
        See Also:
        Object.hashCode()
      • createRoot

        protected XMLDoc createRoot​(org.w3c.dom.Document document)
      • setRoot

        public KElement setRoot​(java.lang.String strDocType,
                                java.lang.String namespaceURI)
        initialize a new root of strDocType in the document called by constructor XMLDoc(String strDocType)
        Parameters:
        strDocType - qualified tag name of the doc root to create if still empty
        namespaceURI - namespace URI of the doc root
        Returns:
        JDFElement - the root element
      • getMemberDocument

        public DocumentXMLImpl getMemberDocument()
        getMemberDocument
        Returns:
        the MemberDocument
      • flush

        protected boolean flush()
        Method Flush
        clean the m_doc and restart from scratch. The root element remains
        Returns:
        boolean - true if successful
      • getRoot

        public KElement getRoot()
        get the root of the dom tree
        Returns:
        JDFElement default: getRoot()
      • write2String

        public java.lang.String write2String​(int indent)
        write2String - write to a string;
        Parameters:
        indent - the indentation of the xml
        Returns:
        String - output
      • write2File

        @Deprecated
        public boolean write2File​(java.lang.String oFilePath,
                                  int indent)
        Deprecated.
        060419 use write2File(oFilePath, indent, true);
        write2File - write to a file; Create if it doesn't exist always assume utf-8 encoding
        Parameters:
        oFilePath -
        indent -
        Returns:
        boolean
      • write2File

        public boolean write2File​(java.lang.String oFilePath)
        write2File - write to a file; Create if it doesn't exist always assume utf-8 encoding
        Parameters:
        oFilePath -
        indent -
        Returns:
        boolean
      • write2File

        public boolean write2File​(java.io.File oFilePath)
        write2File - write to a file; Create if it doesn't exist always assume utf-8 encoding
        Parameters:
        oFilePath -
        indent -
        Returns:
        boolean
      • write2Zip

        public java.io.File write2Zip​(java.io.File file)
        write2Zip - write to a file and compress as zip; remove the .zip from the extension in the zip entry or add .zip
        Parameters:
        file -
        Returns:
        the created file
      • write2File

        public boolean write2File​(java.lang.String oFilePath,
                                  int indent,
                                  boolean bPreserveSpace)
        write2File - write to a file; Create if it doesn't exist DO NOT attempt any url escaping voodoo @see write2URL
        Parameters:
        oFilePath - the file path where to write the file
        indent - indentation
        bPreserveSpace - if true, preserve whitespace
        Returns:
        boolean - true if successful
      • write2File

        public boolean write2File​(java.io.File file,
                                  int indent,
                                  boolean bPreserveSpace)
        write2File - write to a file; Create if it doesn't exist
        Parameters:
        file - the file to write to
        indent - indentation
        bPreserveSpace - if true, preserve whitespace
        Returns:
        boolean - true if successful
      • getRootName

        public java.lang.String getRootName()
      • write2Stream

        public void write2Stream​(java.io.OutputStream outStream,
                                 int indent)
                          throws java.io.IOException
        Parameters:
        outStream -
        indent -
        Throws:
        java.io.IOException
      • writeStream

        public void writeStream​(java.io.OutputStream stream)
                         throws java.io.IOException
        Description copied from interface: IStreamWriter
        write myself to a stream
        Specified by:
        writeStream in interface IStreamWriter
        Parameters:
        stream - the output stream
        Throws:
        java.io.IOException - if io snafu...
      • write2Stream

        public void write2Stream​(java.io.OutputStream outStream,
                                 int indent,
                                 boolean bPreserveSpace)
                          throws java.io.IOException
        write this to a stream
        Parameters:
        outStream -
        indent -
        bPreserveSpace -
        Throws:
        java.io.IOException
        Since:
        080425 synchronized
      • write2StreamStatic

        @Deprecated
        public static void write2StreamStatic​(org.w3c.dom.Element elem,
                                              java.io.OutputStream outStream,
                                              int indent)
                                       throws java.io.IOException
        Deprecated.
        060306
        Parameters:
        elem -
        outStream -
        indent -
        Throws:
        java.io.IOException
      • write2StreamStatic

        @Deprecated
        public static void write2StreamStatic​(org.w3c.dom.Element elem,
                                              java.io.OutputStream outStream,
                                              int indent,
                                              boolean bPreserveSpace)
                                       throws java.io.IOException
        Deprecated.
        060306
        Parameters:
        elem -
        outStream -
        indent -
        bPreserveSpace -
        Throws:
        java.io.IOException
      • getDoctype

        public org.w3c.dom.DocumentType getDoctype()
        getDoctype
        Returns:
        DocumentType
      • getImplementation

        public org.w3c.dom.DOMImplementation getImplementation()
        getImplementation
        Returns:
        DOMImplementation
      • getDocumentElement

        public org.w3c.dom.Element getDocumentElement()
        getDocumentElement
        Returns:
        Element
      • createElement

        public org.w3c.dom.Element createElement​(java.lang.String elementName)
        createElement create a JDFElement that floats in nirvana. This must be appended to a node with appendChild (created in namespace JDFCoreConstants.NONAMESPACE (DOM Level 2)).
        Another way would be to use KElement.appendElement(String elementName, String nameSpaceURI)
        Parameters:
        elementName - name of the element that is created
        Returns:
        Element - unconnected element that is created
      • createDocumentFragment

        public org.w3c.dom.DocumentFragment createDocumentFragment()
        createDocumentFragment
        Returns:
        DocumentFragment
      • createTextNode

        public org.w3c.dom.Text createTextNode​(java.lang.String data)
        createTextNode
        Parameters:
        data -
        Returns:
        Text
      • createComment

        public org.w3c.dom.Comment createComment​(java.lang.String data)
        createComment
        Parameters:
        data -
        Returns:
        Comment
      • createCDATASection

        public org.w3c.dom.CDATASection createCDATASection​(java.lang.String data)
        create a CDATA section, which has this document as ownerDoc
        Parameters:
        data - content of the CDATA
        Returns:
        CDATASection
      • setXSLTURL

        public void setXSLTURL​(java.lang.String url)
        sets the processing instruction for an xslt stylesheet
        Parameters:
        url - the url of the xslt file
      • getXSLTURL

        public java.lang.String getXSLTURL()
        gets the url for an xslt stylesheet e
      • setXPathValues

        public void setXPathValues​(JDFAttributeMap valueMap)
        set the xpath values of thei to the values in the node
        Parameters:
        valueMap - the map of values, if this is still null, MUST be fully qualified
      • createProcessingInstruction

        public org.w3c.dom.ProcessingInstruction createProcessingInstruction​(java.lang.String target,
                                                                             java.lang.String data)
        creates a ProcessingInstruction having this Document as ownerDoc
        Parameters:
        target - the target "processor channel"
        data - parameter string to be passed to the target
        Returns:
        ProcessingInstruction
      • getProcessingInstruction

        public org.w3c.dom.ProcessingInstruction getProcessingInstruction​(int skip,
                                                                          java.lang.String name)
        Parameters:
        skip -
        name -
        Returns:
      • getNode

        public org.w3c.dom.Node getNode​(short type,
                                        int skip,
                                        java.lang.String nodeName)
        Parameters:
        type - the node type see Document
        skip - the number onodes to skip
        Returns:
      • createAttribute

        public org.w3c.dom.Attr createAttribute​(java.lang.String name)
        createAttribute in namespace JDFCoreConstants.NONAMESPACE (DOM Level 2)
        Parameters:
        name - attribute name
        Returns:
        Attr
      • createEntityReference

        public org.w3c.dom.EntityReference createEntityReference​(java.lang.String name)
        creates an EntityReference
        Parameters:
        name - name of the entity to refer to
        Returns:
        the newly created EntityReference
      • getElementsByTagName

        public org.w3c.dom.NodeList getElementsByTagName​(java.lang.String tagname)
        return a NodeList of all elements having the specified tagname
        Parameters:
        tagname - tag name of the elements to find (JDFCoreConstants.star for all elements)
        Returns:
        NodeList
      • importNode

        public org.w3c.dom.Node importNode​(org.w3c.dom.Node importedNode,
                                           boolean deep)
        copy a node from another document in this document
        Parameters:
        importedNode - node to import
        deep - if true: recurse and import the subtree under the node as well
        Returns:
        Node
      • createElementNS

        public org.w3c.dom.Element createElementNS​(java.lang.String namespaceURI,
                                                   java.lang.String qualifiedName)
        create a Element that floats in nirvana, this must be appended to a node with appendChild
        Parameters:
        namespaceURI - the namespace uri of the created element
        qualifiedName - name of the element that is created
        Returns:
        Element - unconnected element that is created
      • createAttributeNS

        public org.w3c.dom.Attr createAttributeNS​(java.lang.String namespaceURI,
                                                  java.lang.String qualifiedName)
        create an attribute withe the given name in the given namespace
        Parameters:
        namespaceURI - namespace URI of the attribute
        qualifiedName - qualified name of the attribute
        Returns:
        Attr - the newly created attribute
      • getElementsByTagNameNS

        public org.w3c.dom.NodeList getElementsByTagNameNS​(java.lang.String namespaceURI,
                                                           java.lang.String myLocalName)
        get a NodeList of all elements with a given name and namespace URI
        Parameters:
        namespaceURI - the namespace URI to look for
        myLocalName - the element name to look for
        Returns:
        NodeList with all elements found
      • getElementById

        public org.w3c.dom.Element getElementById​(java.lang.String elementId)
        get element with ID = elementId similar to Docoment.getElementByID but works with non schema parsed documents
        Parameters:
        elementId - the element ID to look for
        Returns:
        the Element found
      • getNodeName

        public java.lang.String getNodeName()
        gets the node name
        Returns:
        String
      • getNodeValue

        public java.lang.String getNodeValue()
        gets the node value
        Returns:
        String
      • setNodeValue

        public void setNodeValue​(java.lang.String nodeValue)
        set the node value
        Parameters:
        nodeValue - value to set the node to
      • setNSMap

        public void setNSMap​(XMLDoc other)
        set the namespace map from another document
        Parameters:
        other - value to set the node to
      • getNodeType

        public short getNodeType()
        get node type
        Returns:
        a short representing the node type
      • getParentNode

        public org.w3c.dom.Node getParentNode()
        get the parent node of 'this' node
        Returns:
        the parent node
      • getChildNodes

        public org.w3c.dom.NodeList getChildNodes()
        get the child nodes of this node
        Returns:
        a NodeList containing the child nodes
      • getFirstChild

        public org.w3c.dom.Node getFirstChild()
        get the first child node of 'this'
        Returns:
        the first child node
      • getLastChild

        public org.w3c.dom.Node getLastChild()
        get the last child node of 'this'
        Returns:
        the last child node
      • getPreviousSibling

        public org.w3c.dom.Node getPreviousSibling()
        get the previous sibling of 'this'
        Returns:
        the previous sibling node
      • getNextSibling

        public org.w3c.dom.Node getNextSibling()
        get the next sibling of 'this'
        Returns:
        the next sibling node
      • getAttributes

        public org.w3c.dom.NamedNodeMap getAttributes()
        get the attributes associated with this node
        Returns:
        NamedNodeMap containing the attributes associated with this node
      • insertBefore

        public org.w3c.dom.Node insertBefore​(org.w3c.dom.Node newChild,
                                             org.w3c.dom.Node refChild)
        insert a new node before a given node
        Parameters:
        newChild - the new child node to insert
        refChild - the ref child node, the new node is inserted before it
        Returns:
        Node
      • replaceChild

        public org.w3c.dom.Node replaceChild​(org.w3c.dom.Node newChild,
                                             org.w3c.dom.Node oldChild)
        replace a child node with a new one
        Parameters:
        newChild - the new child node to add
        oldChild - the old child node to be replaced
        Returns:
        Node
      • removeChild

        public org.w3c.dom.Node removeChild​(org.w3c.dom.Node oldChild)
        remove a child from 'this'
        Parameters:
        oldChild - the child node to be removed
        Returns:
        oldChild, in its new state (removed)
      • appendChild

        public org.w3c.dom.Node appendChild​(org.w3c.dom.Node newChild)
        append a new child node to 'this'
        Parameters:
        newChild - new child node to add
        Returns:
        Node
      • hasChildNodes

        public boolean hasChildNodes()
        test if 'this' has any children
        Returns:
        boolean - true, if 'this' has children
      • cloneNode

        public org.w3c.dom.Node cloneNode​(boolean deep)
        get a copy of 'this'
        Parameters:
        deep - true: copy children as well
        Returns:
        Node - a copy of 'this'
      • normalize

        public void normalize()
        normalize
      • isSupported

        public boolean isSupported​(java.lang.String feature,
                                   java.lang.String version)
        test whether a specific DOMImplelementation feature is supported by 'this'
        Parameters:
        feature - package name of the feature to test
        version - version number of the package name to test
        Returns:
        boolean - true, if the feature is sopported
        See Also:
        Xerxes-Documentation
      • getPrefix

        public java.lang.String getPrefix()
        get the namespace prefix of 'this' node
        Returns:
        String - namespace prefix (null if unspecified)
      • setPrefix

        public void setPrefix​(java.lang.String prefix)
        set the namespace prefix of 'this' node
        Parameters:
        prefix - namespace prefix
      • getLocalName

        public java.lang.String getLocalName()
        get the the local part of the qualified name of 'this'
        Returns:
        String - local name
      • isNull

        public boolean isNull()
        check whether the underlying document is null
        Returns:
        true if m_doc==null
      • isDirty

        public boolean isDirty()
        check whether the underlying document is null
        Returns:
        true if m_doc==null
      • hasAttributes

        public boolean hasAttributes()
        check if 'this' has attributes
        Returns:
        true, if 'this' has attributes
      • createDocumentType

        public org.w3c.dom.DocumentType createDocumentType​(java.lang.String qualifiedName,
                                                           java.lang.String publicID,
                                                           java.lang.String systemID)
        createDocumentType
        Parameters:
        qualifiedName -
        publicID -
        systemID -
        Returns:
        DocumentType
      • setErrorChecking

        public void setErrorChecking​(boolean check)
        sets whether the DOM implementation performs error checking upon operations
        Parameters:
        check - true - enable error checking
      • getErrorChecking

        public boolean getErrorChecking()
        does the DOM implementation perform error checking upon operations?
        Returns:
        true - error checking is enabled, otherwise false
      • createEntity

        public org.w3c.dom.Entity createEntity​(java.lang.String name)
        create an entity
        Parameters:
        name - name of the entity
        Returns:
        Entity - the newly created entity
      • createNotation

        public org.w3c.dom.Notation createNotation​(java.lang.String name)
        creates a Notation having this Document as its OwnerDoc
        Parameters:
        name - name of the notation
        Returns:
        Notation - the newly created notation
      • createElementDefinition

        public org.apache.xerces.dom.ElementDefinitionImpl createElementDefinition​(java.lang.String name)
        creates an element definition. Element definitions hold default attribute values.
        Parameters:
        name -
        Returns:
        ElementDefinitionImpl
      • putIdentifier

        public void putIdentifier​(java.lang.String idName,
                                  org.w3c.dom.Element element)
        Registers an identifier name with a specified element node
        Parameters:
        idName -
        element -
      • getIdentifier

        public org.w3c.dom.Element getIdentifier​(java.lang.String idName)
        gets the element with the registered name = "idName"
        Parameters:
        idName - name of the element to get
        Returns:
        Element - the element with "idName"
      • removeIdentifier

        public void removeIdentifier​(java.lang.String idName)
        remove element with identifier "idName"
        Parameters:
        idName -
      • getIdentifiers

        public java.util.Enumeration<?> getIdentifiers()
        gets the registered identifiers
        Returns:
        Enumeration of registered identifiers
      • createNodeIterator

        public org.w3c.dom.traversal.NodeIterator createNodeIterator​(org.w3c.dom.Node root,
                                                                     short whatToShow,
                                                                     org.w3c.dom.traversal.NodeFilter filter)
        create a node iterator
        Parameters:
        root - the root of the iterator
        whatToShow - the whatToShow mask
        filter - the node filter (null = no filter)
        Returns:
        the newly created NodeIterator
      • createNodeIterator

        public org.w3c.dom.traversal.NodeIterator createNodeIterator​(org.w3c.dom.Node root,
                                                                     int whatToShow,
                                                                     org.w3c.dom.traversal.NodeFilter filter,
                                                                     boolean entityReferenceExpansion)
        createNodeIterator
        Parameters:
        root - the root of the iterator
        whatToShow - the whatToShow mask
        filter - the node filter (null = no filter)
        entityReferenceExpansion - true: expand the contents of EntityReference nodes
        Returns:
        the newly created NodeIterator
      • createTreeWalker

        public org.w3c.dom.traversal.TreeWalker createTreeWalker​(org.w3c.dom.Node root,
                                                                 short whatToShow,
                                                                 org.w3c.dom.traversal.NodeFilter filter)
        creates a TreeWalker
        Parameters:
        root - the root of the iterator
        whatToShow - the whatToShow mask
        filter - the node filter (null = no filter)
        Returns:
        the newly created TreeWalker
      • createTreeWalker

        public org.w3c.dom.traversal.TreeWalker createTreeWalker​(org.w3c.dom.Node root,
                                                                 int whatToShow,
                                                                 org.w3c.dom.traversal.NodeFilter filter,
                                                                 boolean entityReferenceExpansion)
        creates a TreeWalker
        Parameters:
        root - the root of the iterator
        whatToShow - the whatToShow mask
        filter - the node filter (null = no filter)
        entityReferenceExpansion - true: expand the contents of EntityReference nodes
        Returns:
        the newly created TreeWalker
      • createRange

        public org.w3c.dom.ranges.Range createRange()
        createRange
        Returns:
        Range
      • createEvent

        public org.w3c.dom.events.Event createEvent​(java.lang.String type)
        create an Event object
        Parameters:
        type - type of Event interface to be created
        Returns:
        the newly created Event
      • clone

        public XMLDoc clone()
        clone the document, completely severing all connections to the original document
        Overrides:
        clone in class java.lang.Object
        Returns:
        Object
      • toString

        public java.lang.String toString()
        toString
        Overrides:
        toString in class java.lang.Object
        Returns:
        String
      • toXML

        public java.lang.String toXML()
        toXML
        Returns:
        String
      • write2URL

        public XMLDoc write2URL​(java.lang.String strURL,
                                java.lang.String strContentType)
        This method sends the contents of this XMLDoc to the URL strURL and receives the response in the returned XMLDoc.
        Parameters:
        strURL - the URL to write to
        strContentType - the content type to write to
        Returns:
        docResponse the response received from URL. if url is a file, an empty doc is returned A Null document if no response was received, or an exception occurred
      • write2URL

        public XMLDoc write2URL​(java.lang.String strURL,
                                java.lang.String strContentType,
                                HTTPDetails details)
        This method sends the contents of this XMLDoc to the URL strURL and receives the response in the returned XMLDoc.
        Parameters:
        strURL - the URL to write to
        strContentType - the content type to write to
        Returns:
        docResponse the response received from URL. if url is a file, an empty doc is returned A Null document if no response was received, or an exception occurred
      • pushParser

        protected void pushParser​(XMLParser xmlParser)
        Parameters:
        xmlParser -
      • getChildNode

        protected org.w3c.dom.Node getChildNode​(int nodeType,
                                                int iPos)
        gets the n'th child node of nodetype nodeType with n = iPos
        Parameters:
        nodeType - the DOM node type to get
        - copy from KElement -
        • ELEMENT_NODE = 1
        • ATTRIBUTE_NODE = 2
        • TEXT_NODE = 3
        • CDATA_SECTION_NODE = 4
        • ENTITY_REFERENCE_NODE = 5
        • ENTITY_NODE = 6
        • PROCESSING_INSTRUCTION_NODE = 7
        • COMMENT_NODE = 8
        • DOCUMENT_NODE = 9
        • DOCUMENT_TYPE_NODE = 10
        • DOCUMENT_FRAGMENT_NODE = 11
        • NOTATION_NODE = 12
        • XML_DECL_NODE = 13
      iPos - the index of the node with default 0 for the first occurance
      Returns:
      KElement: a node that matches the filter, null if iPos is higher then the number of child nodes
    • getXMLComment

      public java.lang.String getXMLComment()
      gets of 'this' the text of the i-th child XMLComment. would return this is a XMLComment
      Returns:
      String text document XMLComment, null if i is higher then the number of child nodes
    • getXMLParser

      protected XMLParser getXMLParser()
      Returns:
    • getValidationResult

      public XMLDoc getValidationResult()
      Returns:
      Returns the m_OriginalFileName.
    • isSchemaValid

      public boolean isSchemaValid()
      Returns:
      Returns the m_OriginalFileName.
    • write2HTTPURL

      public java.net.HttpURLConnection write2HTTPURL​(java.net.URL url,
                                                      java.lang.String strContentType,
                                                      HTTPDetails det)
      Parameters:
      url - the url to write to
      strContentType - the content type; if null use text/xml
      det - the details to set
      Returns:
      the HttpURLConnection, null if failure
    • write2HttpURL

      public UrlPart write2HttpURL​(java.net.URL url,
                                   java.lang.String strContentType,
                                   HTTPDetails det)
      Parameters:
      url - the url to write to
      strContentType - the content type; if null use text/xml
      det - the details to set
      Returns:
      the HttpURLConnection, null if failure
    • getDocMemoryUsed

      public long getDocMemoryUsed()
      rough guestimate of the memory used by this if called after parsing
      Returns:
      the difference of memory used when calling compared to construction time
    • getBodyPart

      public javax.mail.BodyPart getBodyPart()
      get the Javax.Mail.BodyPart
      Returns:
      the BodyPart
    • getMultiPart

      public javax.mail.Multipart getMultiPart()
      get the Javax.Mail.Multipart
      Returns:
      the Multipart
    • setBodyPart

      public void setBodyPart​(javax.mail.BodyPart bodyPart)
      set the Javax.Mail.BodyPart
      Parameters:
      bodyPart - the value to set
    • setZipReader

      public void setZipReader​(ZipReader zip)
      set the ZipReader
      Parameters:
      zip - the value to set
    • getZipReader

      public ZipReader getZipReader()
      get the ZipReader
      Returns:
      zip the value to set
    • getOriginalFileName

      public java.lang.String getOriginalFileName()
      Returns:
      Returns the m_OriginalFileName.
    • setOriginalFileName

      public void setOriginalFileName​(java.lang.String originalFileName)
      Parameters:
      originalFileName - The OriginalFileName to set.
    • getSchemaLocation

      public java.lang.String getSchemaLocation​(java.lang.String nsURI)
      Parameters:
      nsURI - the namespace uri to get the schema location for
      Returns:
      String that corresponds to the schema, null if no schemalocation is defined for nsURI
    • getSchemaLocationFile

      public java.io.File getSchemaLocationFile​(java.lang.String nsURI)
      Parameters:
      nsURI - the namespace uri to get the schema location for
      Returns:
      File that corresponds to the schema, null if no readable file is found
    • setSchemaLocation

      public void setSchemaLocation​(java.lang.String nsURI,
                                    java.io.File _schemaLocation)
      set xs:schemalocation to
      Parameters:
      nsURI -
      _schemaLocation -
    • setValidationResult

      public void setValidationResult​(XMLDoc validationResult)
      Parameters:
      validationResult - the validationResult to set.
    • parseStream

      public static XMLDoc parseStream​(java.io.InputStream is)
      parse a JDF input stream
      Parameters:
      is -
      Returns:
      the parsed JDFDoc
    • parseFile

      public static XMLDoc parseFile​(java.lang.String fileName)
      parse an XML file
      Parameters:
      fileName -
      Returns:
      the parsed JDFDoc
    • parseString

      public static XMLDoc parseString​(java.lang.String string)
      parse an XML file
      Parameters:
      string -
      Returns:
      the parsed JDFDoc
    • parseFile

      public static XMLDoc parseFile​(java.io.File file)
      parse an XML file
      Parameters:
      file -
      Returns:
      the parsed JDFDoc
    • parseZipFile

      public static XMLDoc parseZipFile​(java.io.File file)
      parse an XML file
      Parameters:
      file -
      Returns:
      the parsed JDFDoc
    • parseURL

      public static XMLDoc parseURL​(java.lang.String url,
                                    javax.mail.BodyPart bp)
      parse a given url
      Parameters:
      url - the url to search
      bp - the bodypart that the CID url is located in
      Returns:
      the parsed JDFDoc
    • copyMeta

      public void copyMeta​(XMLDoc dMine)
      copy metadata from other document
      Parameters:
      dMine -