|
| 1 | +Kohana_XML is a XML modules to generate and read XML documents in Kohana. |
| 2 | +It is build for KO3, but there are barely one or two lines that makes it KO3 specific, |
| 3 | +so I guess it should work for KO2.x without much trouble. |
| 4 | + |
| 5 | +## Notable Features |
| 6 | + |
| 7 | +* **Extendible, configurable drivers** — You can use the XML class to write simple XML, |
| 8 | +or use the Atom driver to generate Atom compliant XML, or write your own driver (extending XML |
| 9 | +or another driver) to generate XML compliant to any specs you want. Driver support initial |
| 10 | +configuration, which will be used when using native functions, and your own function. |
| 11 | +Namespaces and prefix, value filters, default attributes, node name abstraction are all part |
| 12 | +of driver configuration and are then used as such by native functions, so they are dealt with |
| 13 | +on the fly. But you can also write your own function very easily in your drivers, and writing |
| 14 | +an add_author($user_model) function in the Atom driver would take a second. |
| 15 | + |
| 16 | +* **Dealing with objects of the same class whatever function you use** – $xml→add_node(“test”); |
| 17 | +generates another XML instance of the same driver you can add nodes to, import array or XML files |
| 18 | +to, search in, modify, export, combine… The whole XML document becomes modular, easy to read and |
| 19 | +to modify, and to run through with method chaining. Just play Lego with your XML. |
| 20 | + |
| 21 | +* **Magic get and get()** — allows to easily run through the document. For instance |
| 22 | +$atom→author→name will return an atom document author’s name, this regardless of your driver |
| 23 | +configuration. As another example of node name abstraction, if you’ve decided to abstract “pubDate” |
| 24 | +with “updated” in your RSS2 driver configuration and “published” with “updated” in you Atom driver, |
| 25 | +then $atom→updated will give you the same result as $rss→updated. |
| 26 | + |
| 27 | +* **Jelly-style driver configuration** — I liked the way Jelly initializes its models, so you can |
| 28 | +configure yours just the same way. Driver configuration then goes into a static meta class, which |
| 29 | +improves performance. |
| 30 | + |
| 31 | +* You can still use **DOM functions** if you wish and reintegrate in Kohana_XML |
0 commit comments