Class DocumentXMLFactory

Create a new instance of the XML document factory class.

Constructor

class DocumentXMLFactory()

Methods

createEmptyDocument

DocumentXMLFactory#createEmptyDocument()
Returns Object:A document initialized with default values.

Return a new empty document.

createFragmentAdapter

DocumentXMLFactory#createFragmentAdapter(type)
Arguments:
  • type (String) – The document type of the delta document this adapter should be used for.
Returns FragmentAdapter:
 

A suitable fragment adapter for the given type.

Return the proper document fragment adapter for the given deltadoc type.

createHandlerFactory

DocumentXMLFactory#createHandlerFactory()
Returns object:Instance of the handler factory class suitable for XML documents.

Returns delta operation handler factory.

createNodeEqualityTest

DocumentXMLFactory#createNodeEqualityTest(doc1, doc2)
Arguments:
  • doc1 (object) – The original document
  • doc2 (object) – The changed document
Returns function:
 

node equality test function.

Return the proper node equality test function.

createTreeEqualityTest

DocumentXMLFactory#createTreeEqualityTest(doc1, doc2)
Arguments:
  • doc1 (object) – The original document
  • doc2 (object) – The changed document
Returns function:
 

node equality test function.

Return the proper subtree equality test.

createValueTest

DocumentXMLFactory#createValueTest(doc)
Arguments:
  • doc (object) – The original document
Returns function:
 

value comparison function.

Return proper value checker.

loadInputDocument

DocumentXMLFactory#loadInputDocument(domdoc[, name])
Arguments:
  • domdoc (String|Document) – The underlying DOMDocument.
  • name (String) – The file name of the document.
Returns Object:

A document initialized from the given DOMDocument.

Return new document loaded from a DOMDocument.

loadOriginalDocument

DocumentXMLFactory#loadOriginalDocument(domdoc[, name])
Arguments:
  • domdoc (String|Document) – The underlying DOMDocument.
  • name (String) – The file name of the document.
Returns Object:

A document initialized from the given DOMDocument.

Return new document loaded from a DOMDocument. Use this method for loading the original (unchanged) document and supply it as doc1 to diff.Diff or patch.Patch.

serializeDocument

DocumentXMLFactory#serializeDocument(deltadoc)
Arguments:
  • deltadoc (Object) – A populated delta document.
Returns String:

The XML representation of the delta document as a string.

Serialize the data property into the src string and return it. Also store the source into the src property of deltadoc.