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

[email protected] (Brendon) Wed, 06 Oct 2004 00:01:31 -0700
Newsgroups php.xml.dev
Message-ID <[email protected]>
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.