XML technologies / XML / XML in a Nutshell / DOM reference / Object reference / Comment
(Excerpt from "XML in a Nutshell" by Elliotte Rusty Harold & W. Scott Means)
This object contains the text of an XML comment, that is, the characters between <!-- and -->. Comment is an interface derived from CharacterData.
Note: The DOM specification does not require XML parsers to retain comments after parsing. Some implementations therefore discard comments during parsing.
Java example
// Ein Kommentar-Objekt wird erzeugt
Comment ndComment = doc.createComment("Das Dokument wurde vom
DOM-Werkzeug geparst.");
// und in das Dokument eingefügt
doc.appendChild(ndComment);
Copyright © 2005 O'Reilly Verlag GmbH & Co. KG
You may print the online version for your private use.
Otherwise, this chapter from the book "XML in a Nutshell" is subject to the same conditions as the printed edition: the work and all its parts are protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
O’Reilly Verlag GmbH & Co. KG, Balthasarstraße 81, 50670 Köln, kommentar(at)oreilly.de
back to top