Subject: [xsl] Multiple/conditional import problem From: Martynas Jusevicius <martynas.jusevicius@xxxxxxxxx> Date: Thu, 26 May 2011 14:43:40 +0200 |
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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] [ANN] Balisage 2011 Pre-confe, Tommie Usdin | Thread | Re: [xsl] Multiple/conditional impo, David Carlisle |
Re: [xsl] decoding percent-escaped , Julian Reschke | Date | Re: [xsl] Multiple/conditional impo, David Carlisle |
Month |