Platforms to show: All Mac Windows Linux Cross-Platform

XMLDocumentFragmentMBS class

Super class: XMLNodeMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
class XML MBS XML Plugin 22.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
XMLDocumentFragmentMBS is a "lightweight" or "minimal" XMLDocumentMBS object.

It is very common to want to be able to extract a portion of a document's tree or to create a new fragment of a document. Imagine implementing a user command like cut or rearranging a document by moving fragments around. It is desirable to have an object which can hold such fragments and it is quite natural to use a XMLNodeMBS for this purpose. While it is true that a XMLDocumentMBS object could fulfill this role, a XMLDocumentMBS object can potentially be a heavyweight object, depending on the underlying implementation. What is really needed for this is a very lightweight object. XMLDocumentFragmentMBS is such an object.

Furthermore, various operations -- such as inserting nodes as children of another XMLNodeMBS -- may take XMLDocumentFragmentMBS objects as arguments; this results in all the child nodes of the XMLDocumentFragmentMBS being moved to the child list of this node.
The children of a XMLDocumentFragmentMBS node are zero or more nodes representing the tops of any sub-trees defining the structure of the document. XMLDocumentFragmentMBS nodes do not need to be well-formed XML documents (although they do need to follow the rules imposed upon well-formed XML parsed entities, which can have multiple top nodes). For example, a XMLDocumentFragmentMBS might have only one child and that child node could be a XMLTextMBS node. Such a structure model represents neither an HTML document nor a well-formed XML document.

When a XMLDocumentFragmentMBS is inserted into a XMLDocumentMBS (or indeed any other XMLNodeMBS that may take children) the children of the XMLDocumentFragmentMBS and not the XMLDocumentFragmentMBS itself are inserted into the XMLNodeMBS. This makes the XMLDocumentFragmentMBS very useful when the user wishes to create nodes that are siblings; the XMLDocumentFragmentMBS acts as the parent of these nodes so that the user can use the standard methods from the XMLNodeMBS interface, such as insertBefore() and appendChild().
Subclass of the XMLNodeMBS class.
This is an abstract class. You can't create an instance, but you can get one from various plugin functions.

Super class XMLNodeMBS

Document Positions

Constant Value Description
DocumentPositionContainedBy 16 The node is contained by the reference node. A node which is contained is always following, too.
DocumentPositionContains 8 The node contains the reference node. A node which contains is always preceding, too.
DocumentPositionDisconnected 1 The two nodes are disconnected. Order between disconnected nodes is always implementation-specific.
DocumentPositionFollowing 4 The node follows the reference node.
DocumentPositionImplementationSpecific 32 The determination of preceding versus following is implementation-specific.
DocumentPositionPreceding 2 The second node precedes the reference node.

Types

Constant Value Description
TypeAttribute 2 Attribute Node
TypeCDataSection 4 CDataSection Node
TypeComment 8 Comment Node
TypeDocument 9 Document Node
TypeDocumentFragment 11 Document Fragment
TypeDocumentType 10 Document Type Node
TypeElement 1 Element Node
TypeEntity 6 Entity Node
TypeEntityReferenceNode 5 Entity Reference Node
TypeNotation 12 Notation Node
TypeProcessingInstruction 7 Processing Instruction Node
TypeText 3 Text Node

This class has no sub classes.

Some methods using this class:


The items on this page are in the following plugins: MBS XML Plugin.


XMLConfigurationMBS   -   XMLDocumentMBS


The biggest plugin in space...