Dom
extends DOMDocument
in package
Table of Contents
Methods
- __construct() : mixed
- __construct
- addArrayChild() : int
- addArrayChild Adiciona a um DOMNode parent, outros elementos passados em um array de DOMElements
- addChild() : void
- addChild Adiciona um elemento ao node xml passado como referencia Serão inclusos erros na array $erros[] sempre que a tag for obrigatória e nenhum parâmetro for passado na variável $content e $force for false
- appChild() : void
- appChild Acrescenta DOMElement a pai DOMElement Caso o pai esteja vazio retorna uma exception com a mensagem O parametro "child" pode ser vazio
- appChildBefore() : void
- appChildBefore Acrescenta DOMElement a pai DOMElement Caso o pai esteja vazio retorna uma exception com a mensagem O parametro "child" pode ser vazio
- getChave() : string
- getChave
- getNode() : DOMElement
- getNode Retorna o node solicitado
- getNodeValue() : string
- getNodeValue Extrai o valor do node DOM
- getValue() : string
- getValue
- loadXMLString() : mixed
Methods
__construct()
__construct
public
__construct([string $version = '1.0' ][, string $charset = 'utf-8' ]) : mixed
Parameters
- $version : string = '1.0'
- $charset : string = 'utf-8'
addArrayChild()
addArrayChild Adiciona a um DOMNode parent, outros elementos passados em um array de DOMElements
public
addArrayChild(DOMElement &$parent, array<string|int, mixed> $arr) : int
Parameters
- $parent : DOMElement
- $arr : array<string|int, mixed>
Return values
intaddChild()
addChild Adiciona um elemento ao node xml passado como referencia Serão inclusos erros na array $erros[] sempre que a tag for obrigatória e nenhum parâmetro for passado na variável $content e $force for false
public
addChild(DOMElement &$parent, string $name[, string $content = '' ][, bool $obrigatorio = false ][, string $descricao = "" ][, bool $force = false ]) : void
Parameters
- $parent : DOMElement
- $name : string
- $content : string = ''
- $obrigatorio : bool = false
- $descricao : string = ""
- $force : bool = false
-
força a criação do elemento mesmo sem dados e não considera como erro
appChild()
appChild Acrescenta DOMElement a pai DOMElement Caso o pai esteja vazio retorna uma exception com a mensagem O parametro "child" pode ser vazio
public
appChild(DOMNode &$parent, DOMNode $child[, string $msg = '' ]) : void
Parameters
- $parent : DOMNode
- $child : DOMNode
- $msg : string = ''
Tags
appChildBefore()
appChildBefore Acrescenta DOMElement a pai DOMElement Caso o pai esteja vazio retorna uma exception com a mensagem O parametro "child" pode ser vazio
public
appChildBefore(DOMNode &$parent, DOMNode $child, string $before[, string $msg = '' ]) : void
Parameters
- $parent : DOMNode
- $child : DOMNode
- $before : string
- $msg : string = ''
Tags
getChave()
getChave
public
getChave([string $nodeName = 'infNFe' ]) : string
Parameters
- $nodeName : string = 'infNFe'
Return values
stringgetNode()
getNode Retorna o node solicitado
public
getNode(string $nodeName[, int $itemNum = 0 ]) : DOMElement
Parameters
- $nodeName : string
- $itemNum : int = 0
Return values
DOMElement —se existir ou string vazia se não
getNodeValue()
getNodeValue Extrai o valor do node DOM
public
getNodeValue(string $nodeName[, int $itemNum = 0 ][, string $extraTextBefore = '' ][, string $extraTextAfter = '' ]) : string
Parameters
- $nodeName : string
-
identificador da TAG do xml
- $itemNum : int = 0
-
numero do item a ser retornado
- $extraTextBefore : string = ''
-
prefixo do retorno
- $extraTextAfter : string = ''
-
sufixo do retorno
Return values
stringgetValue()
getValue
public
getValue(DOMElement $node, string $name) : string
Parameters
- $node : DOMElement
- $name : string
Return values
stringloadXMLString()
public
loadXMLString([mixed $xmlString = '' ]) : mixed
Parameters
- $xmlString : mixed = ''