Skip to content

Commit

Permalink
Udpate readme file
Browse files Browse the repository at this point in the history
  • Loading branch information
Edujugon committed Apr 12, 2018
1 parent 036c393 commit 7a7c118
Showing 1 changed file with 25 additions and 17 deletions.
42 changes: 25 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,6 @@ $mapper = XMLMapper::loadXML($xmlData);
> Don't forget to use the facade use statement at the
top of your class: `use Edujugon\XMLMapper\Facades\XMLMapper;`

#### Replace tag names

You can easily replace any tag name of the xml for an easier access.

```php
$mapper->replaceTagName(
[
'a10:author' => 'author',
'a10:name' => 'name',
'a10:updated' => 'updated'
]
);
```

The above snippet replaces all tags with names matching the keys and sets their values as new tag names.
Also updates the underlying object based on the new xml.

#### Get value

> You must know the tags path. Otherwise you should use [findValue](https://github.com/edujugon/XMLMapper#find-value).
Expand Down Expand Up @@ -210,4 +193,29 @@ They can be combined
['id' => 1,['name','!=','john']]
```

#### Replace tag names

You can easily replace any tag name of the xml for an easier access.

```php
$mapper->replaceTagName(
[
'a10:author' => 'author',
'a10:name' => 'name',
'a10:updated' => 'updated'
]
);
```

The above snippet replaces all tags with names matching the keys and sets their values as new tag names.
Also updates the underlying object based on the new xml.

#### Merge a new xml into the existing one

You can easily merge a new xml into the existing one just after a provided tag name.

```php
$mapper->mergeXML($newXml, 'desiredParentTag');
```

Enjoy :)

0 comments on commit 7a7c118

Please sign in to comment.