Re: xslt renderer: 2 questions

Eric Casteleijn <[email protected]>
Newsgroups gmane.comp.web.zope.silva.devel
Message-ID <[email protected]>
Martijn Faassen wrote:
> Marc Petitmermet wrote:
> 
>> dear developers
>>
>> - would it be possible to use the renderer for non-silva content? e.g. 
>> for an uploaded silva file asset which is an xml file from a external 
>> program. or should this xml file be included into a silva document 
>> using external sources?
> 
> 
> Neither way will work. Objects that want to participate in XSLT need to 
> represent themselves as XML to the system in a very specific way, by 
> sending SAX events. File objects do represent themselves as XML, but 
> their *content* doesn't.
> 
> If we want an object that is in fact an XML file, we should make a 
> special one dedicated to that. This can then send out SAX events based 
> on its XML content and the XSLT renderer can work.
> 
> One limitation would be that you could have only one set of XSLT 
> rendererers associated with such a "Silva XML Content". Instead, you'd 
> like to associate a set of XSLT renderers with each possible type of *XML*.
> 
> The following sequence of possible future developments could help to 
> lift this limitation:
> 
> * XSLT renderers won't be connected to meta_type (Silva File) anymore, 
> but to interface.
> 
> * There's an XML content object. If you save XML to it, the 
> structure/hints in the XML or, alternatively, some user specific action, 
> determine what *type* of XML this is and set an interface on the object 
> accordingly.
> 
> * Since you can specify an XSLT renderer by interface then, you could 
> have one type of object that can be represented using XSLT in all kinds 
> of way, depending on the content type.

Hmmm, we should get our stories straight ;) I still think it's possible 
with the current code though. What you would have to do is make your own 
asset type and write an xml-exporter for that that just dumps its 
content. Or am I saying something really stupid?

eric
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.