X-Git-Url: https://git-public.kairo.at/?p=php-utility-classes.git;a=blobdiff_plain;f=include%2Fcbsm%2Futil%2Fdocument.php-class;fp=include%2Fcbsm%2Futil%2Fdocument.php-class;h=07a635a31ae9260a4a1954b60789c79af5797079;hp=0000000000000000000000000000000000000000;hb=cea5b93aab85131665c215c7df6ed297004db3b6;hpb=bc025bc86b13d0c942ab0612384a67dcad1ae169 diff --git a/include/cbsm/util/document.php-class b/include/cbsm/util/document.php-class new file mode 100755 index 0000000..07a635a --- /dev/null +++ b/include/cbsm/util/document.php-class @@ -0,0 +1,169 @@ + + * + * ***** END LICENSE BLOCK ***** */ + +class ExtendedDocument extends DOMDocument { + // ExtendedDocument PHP class + // this extends the general PHP DOM Document class to simplify some usual constructs + // + // function __construct([$version], [$encoding]) + // CONSTRUCTOR + // construct a new DOM Document that uses our element definitions + // + // function appendElement($name, [$value]) + // appends a DOMDocument::createElement() as a child of this document (see there for params) + // returns the new child + // + // function appendElementXML($name, $xmldata) + // appends a DOMDocument::createElement() with the given name as a child of this document, + // with an ExtendedDocument::createXMLFragment() of the given XML data inside + // returns the new child + // + // function appendLink($target, [$value]) + // appends an ExtendedDocument::createElementLink() as a child of this document (see there for params) + // returns the new child + // + // function appendText($text) + // appends a DOMDocument::createTextNode() as a child of this document (see there for params) + // returns the new child + // + // function appendRawMarkup($markupdata) + // appends an ExtendedDocument::createElementRawMarkup() as a child of this document (see there for params) + // NO return value! + // + // function appendJSElement($jsdata) + // appends an ExtendedDocument::createElementJS() as a child of this document (see there for params) + // NO return value! + // + // function createXMLFragment($xmldata) + // returns a DOMDocumentFragment containing the DOM of the given XML data + // + // function createElementLink($target, [$value]) + // returns an ExtendedElement that is an HTML with the given target (href) and (optional) value + // + // function createElementRawMarkup($markupdata) + // returns a DOMNode containing a representation of the given raw markup data + // + // function createElementJS($jsdata) + // returns an ExtendedElement that is an HTML