PHP 클래스 FluentDOM\Transformer\Namespaces\Optimize

파일 보기 프로젝트 열기: fluentdom/fluentdom

공개 메소드들

메소드 설명
__construct ( DOMDocument $document, array $namespaces = [] ) Create a namespace optimizer for the provided document. The provided document will be copied.
__toString ( ) : string Create a document with optimized namespaces and return it as xml string
getDocument ( ) : Document Create and return a document with optimized namespaces.

비공개 메소드들

메소드 설명
addAttribute ( DOMElement $target, DOMAttr $source ) Add an attribute to the target element node.
addElement ( DOMNode $target, DOMElement $source ) Add an element node to the target (document or element)
addNamespaceAttribute ( DOMElement $node, string | null $prefix, string $uri )
addNode ( DOMNode $target, DOMNode $source ) Add a node to the target element, just copies any child nodes except elements. Element nodes are recreated with mapped/optimized namespaces.
canAddNamespaceToNode ( DOMNode $node, string | null $prefix, string $uri ) : boolean
createElement ( DOMNode $target, string $prefix, string $name, string $uri ) : DOMElement
getNodeDefinition ( DOMNode $node ) : array Get the node name definition (prefix, namespace, local name) for the target node

메소드 상세

__construct() 공개 메소드

The second argument allows to provide namespaces and prefixes. The keys of the array are the namespace uri, the values are the prefixes. If a namespace is not provided it is read from the source node. You can use the same prefix for multiple namespace uris. Empty prefixes are possible (default namespace for an element). It is highly recommend that you always use a non-empty prefix if the here are attributes in that namespace. Attributes always need a prefix to make use of the namespace.
public __construct ( DOMDocument $document, array $namespaces = [] )
$document DOMDocument
$namespaces array

__toString() 공개 메소드

Create a document with optimized namespaces and return it as xml string
public __toString ( ) : string
리턴 string

getDocument() 공개 메소드

Create and return a document with optimized namespaces.
public getDocument ( ) : Document
리턴 FluentDOM\Document