com.ibm.xdms.function
Interface DomXmlProcessor

All Superinterfaces:
Function, XmlProcessor

public interface DomXmlProcessor
extends XmlProcessor

The DomXmlProcessor class handles the function of processing an XML document. This includes the ability to for a DOM object from a string representation of the XML document as well as validating the document against the schemas.


Field Summary
static java.lang.String ATTR_REQUEST_DOM
          Request attribute to store the request DOM *
static java.lang.String ATTR_RESPONSE_DOM
          Request attribute to store the response DOM *
static java.lang.String COPYRIGHT
           
 
Method Summary
 org.w3c.dom.Document createDocument(java.lang.String xml, boolean doValidate)
          Create a DOM document from the XML String.
 org.w3c.dom.Document getRequestDocument(XcapServerRequest request)
          Returns the XML in the request as a DOM Document.
 org.w3c.dom.Document getResponseDocument(XcapServerRequest request, XcapServerResponse response)
          Returns the XML in the response as a DOM Document.
 java.lang.String node2String(org.w3c.dom.Node node)
          Converts a node to a String.
 java.lang.String node2String(org.w3c.dom.Node node, boolean omitXmlDeclaration)
          Converts a node to a String.
 
Methods inherited from interface com.ibm.xdms.function.XmlProcessor
addSchema
 
Methods inherited from interface com.ibm.xdms.function.Function
getApplicationUsage, init
 

Field Detail

COPYRIGHT

static final java.lang.String COPYRIGHT

ATTR_REQUEST_DOM

static final java.lang.String ATTR_REQUEST_DOM
Request attribute to store the request DOM *

See Also:
Constant Field Values

ATTR_RESPONSE_DOM

static final java.lang.String ATTR_RESPONSE_DOM
Request attribute to store the response DOM *

See Also:
Constant Field Values
Method Detail

getRequestDocument

org.w3c.dom.Document getRequestDocument(XcapServerRequest request)
                                        throws SchemaValidationException,
                                               NotWellFormedException,
                                               XcapException
Returns the XML in the request as a DOM Document. If the request does not contain any XML, then null is returned. If a previous call was made to generate the DOM Document, then the previously generated DOM Document is returned.

Parameters:
request - The XcapServerRequest
Returns:
Returns the XML in the request as a DOM Document. If the request does not contain any XML, then null is returned.
Throws:
SchemaValidationException
NotWellFormedException
XcapException

getResponseDocument

org.w3c.dom.Document getResponseDocument(XcapServerRequest request,
                                         XcapServerResponse response)
                                         throws SchemaValidationException,
                                                NotWellFormedException,
                                                XcapException
Returns the XML in the response as a DOM Document. If the response does not contain any XML, then null is returned. If a previous call was made to generate the DOM Document, then the previously generated DOM Document is returned.

Parameters:
request - The XcapServerRequest
response - The XcapServerResponse
Returns:
Returns the XML in the request as a DOM Document. If the request does not contain any XML, then null is returned.
Throws:
SchemaValidationException
NotWellFormedException
XcapException

createDocument

org.w3c.dom.Document createDocument(java.lang.String xml,
                                    boolean doValidate)
                                    throws SchemaValidationException,
                                           NotWellFormedException,
                                           XcapException
Create a DOM document from the XML String.

Parameters:
xml - The XML String.
doValidate - Set to true if validating
Returns:
Returns the XML as a Document object.
Throws:
SchemaValidationException
NotWellFormedException
XcapException

node2String

java.lang.String node2String(org.w3c.dom.Node node)
                             throws XcapException
Converts a node to a String.

Parameters:
node - The node to convert.
Returns:
A String representation of the node.
Throws:
XcapException

node2String

java.lang.String node2String(org.w3c.dom.Node node,
                             boolean omitXmlDeclaration)
                             throws XcapException
Converts a node to a String. Optionally, it can omit the XML declaration.

Parameters:
node - The node to convert.
omitXmlDeclaration - true if the XML Declaration should be omitted, false otherwise
Returns:
A String representation of the node.
Throws:
XcapException