# Class DH

© 2019 Palo Alto Networks, Inc. All rights reserved.

Licensed under SCRIPT SOFTWARE AGREEMENT, Palo Alto Networks, Inc., at https://www.paloaltonetworks.com/legal/script-software-license-1-0.pdf

Located at misc-classes/DH.php

Methods summary
`public static` | # `Hosts_to_xmlDom( `DOMNode` $a, mixed & $objects, string $tagName = 'member', boolean $showAnyIfZero = TRUE, string $valueOfAny = 'any', mixed $typeObject = TRUE )` #### Parameters $a ``DOMNode`` $a $objects `mixed` $objects $tagName `string` $tagName $showAnyIfZero `boolean` $showAnyIfZero $valueOfAny `string` $valueOfAny $typeObject
`public static` | # `setDomNodeText( `DOMNode` $node, mixed $text )`
`public static` | # `makeElementAsRoot( `DOMElement` $newRoot, `DOMNode` $doc )`
`public static` | # `removeReplaceElement( `DOMElement` $el, mixed $newName )`
`public static` | # `clearDomNodeChilds( `DOMNode` $node )`
`public static boolean|`DOMElement`` | # `firstChildElement( `DOMNode` $node )` #### Parameters $node ``DOMNode`` $node #### Returns `boolean|`DOMElement``
`public static boolean|`DOMElement`` | # `findFirstElementOrDie( string $tagName, `DOMNode` $node )` #### Parameters $tagName `string` $tagName $node ``DOMNode`` $node #### Returns `boolean|`DOMElement`` #### Throws ``Exception``
`public static boolean|`DOMElement`` | # `findFirstElement( mixed $tagName, `DOMNode` $node )` #### Parameters $tagName `mixed` $tagName $node ``DOMNode`` $node #### Returns `boolean|`DOMElement``
`public static boolean|`DOMElement`` | # `findLastElement( mixed $tagName, `DOMNode` $node )` #### Parameters $tagName `mixed` $tagName $node ``DOMNode`` $node #### Returns `boolean|`DOMElement``
`public static` | # `removeChild( `DOMNode` $parent, `DOMNode` $child )`
`public static `DOMElement`` | # `createElement( `DOMElement` $parent, string $tagName, null $withText = null )` #### Parameters $parent ``DOMElement`` $parent $tagName `string` $tagName $withText `null` $withText #### Returns ``DOMElement``
`public static `DOMElement`` | # `createOrResetElement( `DOMElement` $parent, string $tagName, null $withText = null )` #### Parameters $parent ``DOMElement`` $parent $tagName `string` $tagName $withText `null` $withText #### Returns ``DOMElement``
`public static boolean|`DOMElement`` | # `findFirstElementOrCreate( string $tagName, `DOMNode` $node, null|string $withText = null )` #### Parameters $tagName `string` $tagName $node ``DOMNode`` $node $withText `null|string` $withText #### Returns `boolean|`DOMElement``
`public static integer|boolean` | # `removeChildrenElementsMatchingXPath( `DOMNode` $xpath, `DOMNode` $node )` #### Parameters $xpath ``DOMNode`` $node $node `string` $xpath #### Returns `integer|boolean` number of nodes deleted or false of XPATH is wrong
`public static `DOMNode`|boolean` | # `findFirstElementByNameAttrOrDie( string $tagName, mixed $value, `DOMNode` $node )` #### Parameters $tagName `string` $tagName $value `mixed` $value $node ``DOMNode`` $node #### Returns ``DOMNode`|boolean`
`public static `DOMNode`|boolean` | # `findFirstElementByNameAttrOrCreate( string $tagName, mixed $value, `DOMNode` $node, `DOMDocument` $xmlDoc1 )` #### Parameters $tagName `string` $tagName $value `mixed` $value $node ``DOMNode`` $node $xmlDoc1 #### Returns ``DOMNode`|boolean`
`public static `DOMNode`|boolean` | # `findFirstElementByNameAttr( string $tagName, mixed $value, `DOMNode` $node )` #### Parameters $tagName `string` $tagName $value `mixed` $value $node ``DOMNode`` $node #### Returns ``DOMNode`|boolean`
`public static boolean|string` | # `findAttribute( string $attrName, `DOMElement` $node )` #### Parameters $attrName `string` $attrName $node ``DOMElement`|`DOMNode`` $node #### Returns `boolean|string`
`public static string &` | # `domlist_to_xml( `DOMNodeList` $nodeList, integer $indenting = 0, boolean $lineReturn = TRUE, integer $limitSubLevels = -1 )` #### Parameters $nodeList ``DOMNodeList`` $nodeList $indenting `integer` $indenting $lineReturn `boolean` $lineReturn $limitSubLevels `integer` $limitSubLevels #### Returns `string`
`public static string &` | # `dom_to_xml( `DOMNode` $node, integer $indenting = 0, boolean $lineReturn = TRUE, integer $limitSubLevels = -1, mixed $indentingIncrement = 1 )` #### Parameters $node ``DOMNode`` $node $indenting `integer` $indenting $lineReturn `boolean` $lineReturn $limitSubLevels `integer` $limitSubLevels $indentingIncrement #### Returns `string`
`public static `DOMElement`` | # `importXmlStringOrDie( `DOMDocument` $xmlDoc, string $xmlString )` #### Parameters $xmlDoc ``DOMDocument`` $xmlDoc $xmlString `string` $xmlString #### Returns ``DOMElement``
`public static string` | # `elementToPanXPath( `DOMNode` $element )` #### Parameters $element ``DOMNode`` $element #### Returns `string`
`public static `DOMNode`` | # `findXPathSingleEntryOrDie( string $xpathString, `DOMDocument`|`DOMNode` $contextNode )` #### Parameters $xpathString `string` $xpathString $contextNode ``DOMDocument`|`DOMNode`` $contextNode #### Returns ``DOMNode``
`public static `DOMNode`|boolean` | # `findXPathSingleEntry( string $xpathString, `DOMDocument`|`DOMNode` $contextNode )` #### Parameters $xpathString `string` $xpathString $contextNode ``DOMDocument`|`DOMNode`` $contextNode #### Returns ``DOMNode`|boolean` returns FALSE if not found
`public static `DOMNodeList`|boolean` | # `findXPath( string $xpathString, `DOMDocument`|`DOMNode` $contextNode )` return return #### Parameters $xpathString `string` $xpathString $contextNode ``DOMDocument`|`DOMNode`` $contextNode #### Returns ``DOMNodeList`|boolean`
`public static integer` | # `moveChildElementsToNewParentNode( `DOMElement` $source, `DOMElement` $target )` #### Parameters $source ``DOMElement`` $source $target ``DOMElement`` $target #### Returns `integer` #### Throws ``Exception``
`public static integer` | # `copyChildElementsToNewParentNode( `DOMElement` $source, `DOMElement` $target )` #### Parameters $source ``DOMElement`` $source $target ``DOMElement`` $target #### Returns `integer` #### Throws ``Exception``