xsl-list
[Top] [All Lists]

[xsl] Multiple/conditional import problem

2011-05-26 07:43:54
Hey list,

I have a problem related to conditional imports, but with a twist though.

Let's say I have a stylesheet default.xsl which renders query result
in a standard property/value fashion (possibly <dl>/<dt>/<dd>).

However, if the result contains some specific properties like 'image'
or 'visualization', I'd like to overload the default rendering with
custom.
In the case of of 'image' it could be simply <img> element, in the
case of visualization it could be loading/generating some
Javascript/JSON to insert a visualization.
The properties are arbitrary, and ideally they should be decoupled
from the default stylesheet so that 3rd parties could take care of
them. They can also load more data (parameters/document arguments)
than default.xsl.
For these reasons I have made a separate stylesheet for each property,
e.g. image.xsl and visualization.xsl.

The question is, how do I combine and execute them in a generic way?
This is likely related to the conditional import problem (which I know
is not possible in run-time), so the solution would be to have
specific stylesheets to import generic stylesheets, in this case
image.xsl or visualization.xsl to import default.xsl, right?

But the twist is, if the result contains both 'image' and
'visualization' properties and maybe some other ones, I want to
overload *all* of them. So the import solution above is not valid
since I don't know which stylesheet to choose to transform the result
in the first place. If I transform with image.xsl I will miss the
visualization templates, and vice versa. If I transform with
default.xsl then I don't know how to import all the specific
stylesheets.

I get a feeling this requires stylesheet pre-processing, but of course
I would like to avoid that.

Suggestions appreciated!

Martynas
semantic-web.dk

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>