On Friday 14 September 2001 11:40, Alexandr Efimov wrote:
> We tried to use XML, but the main problem with XML
> is that we cannot insert even a simple logic constructions,
> like IF of FOREACH, as with Template.

Yes you can, but of course you need a dedicated processor. XML is just a 
syntax :-) One thing you could use for this is XSP, available as part of 
AxKit (it's useful enough that I'd like to see it split out, but it looks 
like no one has the time to work on that right now).

I don't know of anyone that's defined a control structures taglib, but of 
course you can always use XSP Core to do that. In fact it is rarely needed as 
in the general case for example for loops, you'd simply output what it is you 
want to loop over as the output of XSP, and then XSLT will take care of 
converting that to whatever output you want, most of the time taking care of 
the looping transparently (at whatever degree of depth and/or recursivity).

> At this time, for this configuration file we use
> a special XML-like syntax (it is not really an XML,
> it is translated into TT2 with a our parser).

If you are considering switching to XML (even if it is in a very distant 
future) then I'd recommend still using valid XML rather than an XML-like 
syntax. It may be useless now, but if you're thinking of changing it'll make 
the change trivial.

> Our questions are:
> 1. Are there any mod-perl packages created for similar tasks?

There's AxKit, and I think that other packages can do that too 
(Apache::PageKit ?).

> 2. Can constructions similar to
> <FOREACH c=rows>
> ...
> </FOREACH>
>
> (which is now translated into [% FOREACH ... %] template blocks)
> be implemented with standard XML parser?

By the parser itself, no, its job is simply to parse, nothing more. You could 
however rather trivially create a SAX processor, and XSP taglib, etc that 
would do that job.

-- 
_______________________________________________________________________
Robin Berjon <[EMAIL PROTECTED]> -- CTO
k n o w s c a p e : // venture knowledge agency www.knowscape.com
-----------------------------------------------------------------------
An eye for an eye will make the whole world blind. -- Mahatma Gandhi

Reply via email to