diff --git a/.github/README.md b/.github/README.md index 247a9de..533149f 100644 --- a/.github/README.md +++ b/.github/README.md @@ -64,6 +64,12 @@ $reader->element('food.0')->sole(); // Element::class // Use XPath to query the XML $reader->xpathValue('//food[@bestSeller="true"]/name')->get(); // ['Belgian Waffles', 'Berry-Berry Belgian Waffles'] + +// Use getAttributes() to get the attributes on the elements +$reader->element('food.0')->sole()->getAttributes(); // ['soldOut' => false, 'bestSeller' => true] + +// Use getContent() to get the contents of the elements +$reader->element('food.0')->sole()->getContent(); // ['name' => 'Belgian Waffles', 'price' => '$5.95', ...] ``` ## Writing XML