Skip to content

Commit

Permalink
Use xmlns:atom
Browse files Browse the repository at this point in the history
  • Loading branch information
gwagroves committed Sep 1, 2018
1 parent 8b6425f commit 1a71b0b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ NOTE: Not all fields are currently implemented.

### Implemented

* `content` (note)
* `gd:name`
* `atom:content` (note)
* `gd:email`
* `gd:phoneNumber`
* `gd:structuredPostalAddress`
Expand Down Expand Up @@ -78,7 +78,7 @@ $xmlstring = $contact->render();
The following XML is rendered:

```xml
<atom:entry xmlns="http://www.w3.org/2005/Atom" xmlns:gd="http://schemas.google.com/g/2005">
<atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:gd="http://schemas.google.com/g/2005">
<atom:category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/contact/2008#contact"/>
<gd:name>
<gd:givenName>John</gd:givenName>
Expand Down
2 changes: 1 addition & 1 deletion src/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ public function createEntryElement()
$dom = $this->getDomDocument();

$entry = $dom->createElement('atom:entry');
$entry->setAttribute('xmlns', 'http://www.w3.org/2005/Atom');
$entry->setAttribute('xmlns:atom', 'http://www.w3.org/2005/Atom');
$entry->setAttribute('xmlns:gd', 'http://schemas.google.com/g/2005');

$category = $dom->createElement('atom:category');
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/contact.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<atom:entry xmlns="http://www.w3.org/2005/Atom" xmlns:gd="http://schemas.google.com/g/2005">
<atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:gd="http://schemas.google.com/g/2005">
<atom:category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/contact/2008#contact"/>
<gd:name>
<gd:givenName>John</gd:givenName>
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/entry.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<atom:entry xmlns="http://www.w3.org/2005/Atom" xmlns:gd="http://schemas.google.com/g/2005">
<atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:gd="http://schemas.google.com/g/2005">
<atom:category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/contact/2008#contact"/>
</atom:entry>

0 comments on commit 1a71b0b

Please sign in to comment.