2017 © Pedro Peláez
 

library array_to_xml

Convenient way for xml-feed generation. You can get an multi-depth feed right from a SQL-query result.

image

ghopper/array_to_xml

Convenient way for xml-feed generation. You can get an multi-depth feed right from a SQL-query result.

  • Tuesday, May 2, 2017
  • by GHopper
  • Repository
  • 1 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

arrayToXml

Convenient way for xml-feed generation. You can get an multi-depth feed right from a SQL-query result!, (*1)

Configuring

All you need is an array with specific structure. Array, (*2)

[
    [
        'books_book_id' => '1',
        'books_book_name' => 'Suffocationg',
        'books_book_author' => 'Chuck Palahniuk'
    ],
    [
        'books_book_id' => '2',
        'books_book_name' => 'Atlas Shrugged',
        'books_book_author' => 'Ayn Rand'
    ]
]

Will be transformed into, (*3)

<?xml version="1.0" encoding="UTF-8" ?>
<books>
        <book>
                <id>1</id>
                <name>Suffocationg</name>
                <author>Chuck Palahniuk</author>
        </book>
        <book>
                <id>2</id>
                <name>Atlas Shrugged</name>
                <author>Ayn Rand</author>
        </book>
</books>

Also, you can specify tag attributes by adding "key-value" marker in a column name. Array, (*4)

[
    [
        'books_book_key-value_id' => '1',
        'books_book_name' => 'Suffocationg',
        'books_book_author' => 'Chuck Palahniuk'
    ],
    [
        'books_book_key-value_id' => '2',
        'books_book_name' => 'Atlas Shrugged',
        'books_book_author' => 'Ayn Rand'
    ]
];

Will be transfored into, (*5)


<books>
        <book id="1">
                <name>Suffocationg</name>
                <author>Chuck Palahniuk</author>
        </book>
        <book id="2">
                <name>Atlas Shrugged</name>
                <author>Ayn Rand</author>
        </book>
</books>

Look at the example folder for more information., (*6)

The Versions

02/05 2017

v0.2

0.2.0.0

Convenient way for xml-feed generation. You can get an multi-depth feed right from a SQL-query result.

  Sources   Download

MIT

by Nikolay Poryadin

xml feed generator array

02/05 2017

dev-master

9999999-dev

  Sources   Download

MIT

by Nikolay Poryadin

xml feed generator array

02/05 2017

v0.1

0.1.0.0

  Sources   Download

MIT

by Nikolay Poryadin

xml feed generator array