# classes/phing/tasks/ext/XmlPropertyTask.php

Task for setting properties from an XML file in buildfiles.

author
  Jonathan Bond-Caron
link
  http://ant.apache.org/manual/CoreTasks/xmlproperty.html
package
  phing.tasks.ext
since
  2.4.0
version
  $Revision: 1110 $

## \XmlPropertyTask
jump to top

Task for setting properties from an XML file in buildfiles.

Use {@link Project#createTask} to register a new Task.

Extends from
  \PropertyTask
author
  Jonathan Bond-Caron
copyright
  2001,2002 THYRELL. All rights reserved
link
  http://ant.apache.org/manual/CoreTasks/xmlproperty.html
package
  phing.tasks.ext
since
  2.4.0
version
  $Revision: 1110 $

### Properties

`$_collapseAttr= 'false'`
Default value `false` Details

Type

`$_delimiter= ','`
Default value`,`Details

Type

`$_keepRoot= 'true'`
Default value `true` Details

Type

### Methods

`_addNode( \SimpleXMLElement $node, array $path, \Properties $prop ) : void`
Adds an XML node
Parameters

Name | Type | Description
--- | --- | ---
$node | \SimpleXMLElement |
$path | array | Path to this node
$prop | \Properties | Properties will be added as they are found (by reference here)

`_getProperties( string $filePath ) : \Properties`
Parses an XML file and returns properties
Parameters

Name | Type | Description
--- | --- | ---
$filePath | string |

Returns

Type | Description
--- | ---
\Properties |

`getCollapseAttributes( ) : bool`
Returns

Type | Description
--- | ---
bool |

`getDelimiter( ) : string`
Returns

Type | Description
--- | ---
string |

`getFile( ) :`
Get the PhingFile that is being used as property source.
`getKeepRoot( ) : bool`
Returns

Type | Description
--- | ---
bool |

`getPrefix( ) : string`
Returns

Type | Description
--- | ---
string |

Details

since
  2.0

`loadFile( \PhingFile $file ) :`
load properties from an XML file.
Parameters

Name | Type | Description
--- | --- | ---
$file | \PhingFile |

`main( ) :`
set the property in the project to the value.

if the task was give a file or env attribute here is where it is loaded

`setCollapseAttributes( bool $yesNo ) :`
Treat attributes as nested elements.
Parameters

Name | Type | Description
--- | --- | ---
$yesNo | bool |

`setDelimiter( string $d ) :`
Delimiter for splitting multiple values.
Parameters

Name | Type | Description
--- | --- | ---
$d | string |

`setFile( $file ) :`
Set a file to use as the source for properties.
Parameters

Name | Type | Description
--- | --- | ---
$file |  |

`setKeepRoot( bool $yesNo ) :`
Keep the xml root tag as the first value in the property name
Parameters

Name | Type | Description
--- | --- | ---
$yesNo | bool |

`setPrefix( string $prefix ) : void`
Prefix to apply to properties loaded using `file`.

A "." is appended to the prefix if not specified.

Parameters

Name | Type | Description
--- | --- | ---
$prefix | string | prefix string

Details

since
  2.0

Documentation was generated by DocBlox 0.13.1.