Implementation of std.experimental.xml.dom.Attr
Implementation of std.experimental.xml.dom.CDATASection
Implementation of std.experimental.xml.dom.CharacterData
Implementation of std.experimental.xml.dom.Comment
Implementation of std.experimental.xml.dom.DOMConfiguration
The implementation of std.experimental.xml.dom.DOMException thrown by this DOM implementation.
Implementation of std.experimental.xml.dom.Document
Implementation of std.experimental.xml.dom.DocumentFragment
Implementation of std.experimental.xml.dom.DocumentType
Implementation of std.experimental.xml.dom.Element
Implementation of std.experimental.xml.dom.EntityReference
Implementation of std.experimental.xml.dom.Node
Implementation of std.experimental.xml.dom.ProcessingInstruction
Implementation of std.experimental.xml.dom.Text
Implementation of std.experimental.xml.dom.DOMImplementation.createDocument.
Implementation of std.experimental.xml.dom.DOMImplementation.createDocumentType.
Implementation of std.experimental.xml.dom.DOMImplementation.hasFeature.
Implementation of std.experimental.xml.dom.DOMImplementation.hasFeature.
Implementation of std.experimental.xml.dom.DOMImplementation.createDocumentType.
Implementation of std.experimental.xml.dom.DOMImplementation.createDocument.
Implementation of std.experimental.xml.dom.DOMImplementation.hasFeature.
Implementation of std.experimental.xml.dom.DOMImplementation.hasFeature.
The implementation of std.experimental.xml.dom.DOMException thrown by this DOM implementation.
Implementation of std.experimental.xml.dom.Node
Implementation of std.experimental.xml.dom.DocumentFragment
Implementation of std.experimental.xml.dom.Document
Implementation of std.experimental.xml.dom.CharacterData
Implementation of std.experimental.xml.dom.Attr
Implementation of std.experimental.xml.dom.Element
Implementation of std.experimental.xml.dom.Text
Implementation of std.experimental.xml.dom.Comment
Implementation of std.experimental.xml.dom.DocumentType
Implementation of std.experimental.xml.dom.CDATASection
Implementation of std.experimental.xml.dom.ProcessingInstruction
Implementation of std.experimental.xml.dom.EntityReference
Implementation of std.experimental.xml.dom.DOMConfiguration
Instantiates a DOMBuilder specialized for the DOMImplementation implemented in this module.
1 2 DOMImplementation impl = new DOMImplementation(); 3 4 auto doc = impl.createDocument(new DOMString("myNamespaceURI"), new DOMString("myPrefix:myRootElement"), null); 5 auto root = doc.documentElement; 6 assert(root.prefix == "myPrefix"); 7 8 auto attr = doc.createAttributeNS(new DOMString("myAttrNamespace"), new DOMString("myAttrPrefix:myAttrName")); 9 root.setAttributeNode(attr); 10 assert(root.attributes.length == 1); 11 assert(root.getAttributeNodeNS(new DOMString("myAttrNamespace"), new DOMString("myAttrName")) is attr); 12 13 attr.nodeValue = new DOMString("myAttrValue"); 14 assert(attr.childNodes.length == 1); 15 assert(attr.firstChild.nodeType == dom.NodeType.text); 16 assert(attr.firstChild.nodeValue == attr.nodeValue); 17 18 auto elem = doc.createElementNS(new DOMString("myOtherNamespace"), new DOMString("myOtherPrefix:myOtherElement")); 19 assert(root.ownerDocument is doc); 20 assert(elem.ownerDocument is doc); 21 root.appendChild(elem); 22 assert(root.firstChild is elem); 23 assert(root.firstChild.namespaceURI == "myOtherNamespace"); 24 25 auto comm = doc.createComment(new DOMString("myWonderfulComment")); 26 doc.insertBefore(comm, root); 27 assert(doc.childNodes.length == 2); 28 assert(doc.firstChild is comm); 29 30 assert(comm.substringData(1, 4) == "yWon"); 31 comm.replaceData(0, 2, new DOMString("your")); 32 comm.deleteData(4, 9); 33 comm.insertData(4, new DOMString("Questionable")); 34 assert(comm.data == "yourQuestionableComment"); 35 36 auto pi = doc.createProcessingInstruction(new DOMString("myPITarget"), new DOMString("myPIData")); 37 elem.appendChild(pi); 38 assert(elem.lastChild is pi); 39 auto cdata = doc.createCDATASection(new DOMString("mycdataContent")); 40 elem.replaceChild(cdata, pi); 41 assert(elem.lastChild is cdata); 42 elem.removeChild(cdata); 43 assert(elem.childNodes.length == 0); 44 45 assert(doc.getElementsByTagNameNS(new DOMString("myOtherNamespace"), new DOMString("myOtherElement")).item(0) is elem); 46 47 doc.setUserData("userDataKey1", dom.UserData(3.14), null); 48 doc.setUserData("userDataKey2", dom.UserData(new Object()), null); 49 doc.setUserData("userDataKey3", dom.UserData(null), null); 50 assert(doc.getUserData("userDataKey1") == 3.14); 51 assert(doc.getUserData("userDataKey2").type == typeid(Object)); 52 assert(doc.getUserData("userDataKey3").peek!long is null); 53 54 assert(elem.lookupNamespaceURI(new DOMString("myOtherPrefix")) == "myOtherNamespace"); 55 assert(doc.lookupPrefix(new DOMString("myNamespaceURI")) == "myPrefix"); 56 57 assert(elem.isEqualNode(elem.cloneNode(false))); 58 assert(root.isEqualNode(root.cloneNode(true))); 59 assert(comm.isEqualNode(comm.cloneNode(false))); 60 assert(pi.isEqualNode(pi.cloneNode(false)));
An implementation of std.experimental.xml.dom.DOMImplementation.
It allows to specify a custom allocator to be used when creating instances of the DOM classes. As keeping track of the lifetime of every node would be very complex, this implementation does not try to do so. Instead, no object is ever deallocated; it is the users responsibility to directly free the allocator memory when all objects are no longer reachable.