PHP Class DOMDocumentWrapper, microweber

Show file Open project: microweber/microweber Class Usage Examples

Public Properties

Property Type Description
$charset
$contentType unknown_type
$data
$dataNodes
$document DOMDocument
$events
$eventsGlobal
$eventsNodes
$frames unknown_type
$id
$isDocumentFragment
$isHTML
$isXHTML
$isXML
$root DOMNode Used by documentFragments.
$uuid
$xpath

Public Methods

Method Description
__construct ( $markup = null, $contentType = null, $newDocumentID = null )
debug ( $text )
expandEmptyTag ( $tag, $xml ) : unknown_type expandEmptyTag.
import ( $source, $sourceCharset = null ) : array
importAttr ( $value )
isDocumentFragmentHTML ( $markup )
isDocumentFragmentXHTML ( $markup )
isDocumentFragmentXML ( $markup )
load ( $markup, $contentType = null, $newDocumentID = null )
markup ( $nodes = null, $innerMarkup = false ) : string Return document markup, starting with optional $nodes as root.

Protected Methods

Method Description
afterMarkupLoad ( )
charsetAppendToHTML ( $html, $charset, $xhtml = false )
charsetAppendToXML ( $markup, $charset )
charsetFixHTML ( $markup ) Repositions meta[type=charset] at the start of head. Bypasses DOMDocument bug.
charsetFromHTML ( $markup )
charsetFromXML ( $markup )
contentTypeFromHTML ( $markup ) : array
contentTypeToArray ( $contentType )
documentCreate ( $charset, $version = '1.0' )
documentFragmentCreate ( $source, $charset = null ) : DOMDocumentWrapper Creates new document fragment.
documentFragmentToMarkup ( $fragment )
isXHTML ( $markup = null )
isXML ( $markup )
loadMarkup ( $markup )
loadMarkupHTML ( $markup, $requestedCharset = null )
loadMarkupReset ( )
loadMarkupXML ( $markup, $requestedCharset = null )
markupFixXHTML ( $markup )

Private Methods

Method Description
documentFragmentLoadMarkup ( $fragment, $charset, $markup = null )

Method Details

__construct() public method

public __construct ( $markup = null, $contentType = null, $newDocumentID = null )

afterMarkupLoad() protected method

protected afterMarkupLoad ( )

charsetAppendToHTML() protected method

protected charsetAppendToHTML ( $html, $charset, $xhtml = false )

charsetAppendToXML() protected method

protected charsetAppendToXML ( $markup, $charset )

charsetFixHTML() protected method

Repositions meta[type=charset] at the start of head. Bypasses DOMDocument bug.
protected charsetFixHTML ( $markup )

charsetFromHTML() protected method

protected charsetFromHTML ( $markup )

charsetFromXML() protected method

protected charsetFromXML ( $markup )

contentTypeFromHTML() protected method

protected contentTypeFromHTML ( $markup ) : array
$markup
return array contentType, charset

contentTypeToArray() protected method

protected contentTypeToArray ( $contentType )

debug() public static method

public static debug ( $text )

documentCreate() protected method

protected documentCreate ( $charset, $version = '1.0' )

documentFragmentCreate() protected method

Creates new document fragment.
protected documentFragmentCreate ( $source, $charset = null ) : DOMDocumentWrapper
$source
return DOMDocumentWrapper

documentFragmentToMarkup() protected method

protected documentFragmentToMarkup ( $fragment )

expandEmptyTag() public static method

expandEmptyTag.
Author: mjaque at ilkebenson dot com
public static expandEmptyTag ( $tag, $xml ) : unknown_type
$tag
$xml
return unknown_type

import() public method

public import ( $source, $sourceCharset = null ) : array
$source
$sourceCharset
return array Array of imported nodes.

importAttr() public method

public importAttr ( $value )

isDocumentFragmentHTML() public static method

public static isDocumentFragmentHTML ( $markup )

isDocumentFragmentXHTML() public static method

public static isDocumentFragmentXHTML ( $markup )

isDocumentFragmentXML() public static method

public static isDocumentFragmentXML ( $markup )

isXHTML() protected method

protected isXHTML ( $markup = null )

isXML() protected method

protected isXML ( $markup )

load() public method

public load ( $markup, $contentType = null, $newDocumentID = null )

loadMarkup() protected method

protected loadMarkup ( $markup )

loadMarkupHTML() protected method

protected loadMarkupHTML ( $markup, $requestedCharset = null )

loadMarkupReset() protected method

protected loadMarkupReset ( )

loadMarkupXML() protected method

protected loadMarkupXML ( $markup, $requestedCharset = null )

markup() public method

Return document markup, starting with optional $nodes as root.
public markup ( $nodes = null, $innerMarkup = false ) : string
$nodes DOMNode|DOMNodeList
return string

markupFixXHTML() protected static method

protected static markupFixXHTML ( $markup )

Property Details

$charset public property

public $charset

$contentType public property

public unknown_type $contentType
return unknown_type

$data public property

public $data

$dataNodes public property

public $dataNodes

$document public property

public DOMDocument $document
return DOMDocument

$events public property

public $events

$eventsGlobal public property

public $eventsGlobal

$eventsNodes public property

public $eventsNodes

$frames public property

public unknown_type $frames
return unknown_type

$id public property

public $id

$isDocumentFragment public property

public $isDocumentFragment

$isHTML public property

public $isHTML

$isXHTML public property

public $isXHTML

$isXML public property

public $isXML

$root public property

Used by documentFragments.
public DOMNode $root
return DOMNode

$uuid public property

public $uuid

$xpath public property

public $xpath