Modify ↓
Ticket #308 (closed enhancement: duplicate)
Support for external entities
| Reported by: | cweiske@… | Owned by: | hans |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | phing-core | Version: | 2.3.2 |
| Keywords: | Cc: |
Description
Sometimes single tasks in build files grow too large. Parts of the tasks should be externalized, but that is currently not possible. The best way would be - in my opinion - using an external entity reference:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE project [ <!ENTITY changelog SYSTEM "./build-changelog.xml"> ]> <project name="myproject" default="package" basedir="."> ... &changelog; ... </project>
Unfortunately, phing's ExpatParser class does not resolve entities. The PHP manual contains an example how to implement entity resolving: http://php.net/manual/en/example.xml-external-entity.php
maybe that can be used as template for phing.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

Hi, Christian!
Firstly, I think, that large tasks (large build files) is bad. As and large methods (large classes) in OOP :)
Secondly, if includes is really needed, Xinclude is better way. It's more XML related technology (includes with entities more related to SGML world).
P.S. Implementation, as I think, must be with DOM functions, because they have built-in support for both technologies (Xinclude and resolving entities).