Re: [PHP-XML-DEV] XSL Overlays?

[email protected] (Christian Stocker) Wed, 06 Oct 2004 10:04:50 +0200
Newsgroups php.xml.dev
Message-ID <[email protected]>

On 6.10.2004 9:01 Uhr, Brendon wrote:
> Christian Stocker wrote:
> 
>>
>>
>> On 6.10.2004 6:36 Uhr, Brendon wrote:
>>
>>> Are there any plans to implement overlays within the PHP 5 XSL 
>>> extension? This would proove to be very useful for modularized 
>>> applications. If this already exists, could someone point me in the 
>>> right direction?
>>
>>
>>
>> What are XSL Overlays?
>>
>> Google couldn't answer it for me..
>>
>> chregu
>>
>>>
>>
> 
> Overlays are a general XML concept created by Mozilla. Someone can 
> correct me if I have described this incorrectly, but the general concept 
> goes like this. Say you have MAIN.XML:
> 
> <people>
>     <policemen>
>         <police firstname="John" />
>         <police firstname="Fred" />
>     </policemen>
> </people>
> 
> Suppose that MAIN.XML comes standard with an application, but the 
> application developer wants to allow 3rd party module developers to 
> extend his MAIN.XML without actually modifying it. The 3rd party module 
> developers need to have fully capabilities of modifying or extending any 
> element within the MAIN.XML tree. So using the overlay concept, a 3rd 
> party developer could do something like this.. (this isnt exact xml 
> overlay syntax.. just an example):
> 
> <overlay modifies="policemen">
>     <add nodename="police">
>         <attribute attributename="firstname" attributevalue="Susie" />
>     </add>
> </overlay>
> 
> So, the above in theory would add a new police element to the original 
> tree.. I suppose maybe this could all be accomplished with an XSL 
> document to handle overlays, but i am not quite sure where to start with 
> it.

Ok, I got the concept (worked with XUL before), but I don't think, this 
would belong to the XSL extension.

It could be doable in xslt or just in DOM with a php script.

IMHO, the more I think about it, a library written as a PHP script 
should be the correct approach. This doesn't belong into one of the 
current extension.

chregu

-- 
christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich
phone +41 1 240 56 70 | mobile +41 76 561 88 60  | fax +41 1 240 56 71
http://www.bitflux.ch  |  [email protected]  |  gnupg-keyid 0x5CE1DECB