Hi Egbert I see what you mean, given the context of the import statements then maybe this approach will not be useful.
It does sound like looking at the URI resolver would be the way to address this, maybe you would like to raise a JIRA issue for this? Thanks Steve -----Original Message----- From: Egbert Gramsbergen [mailto:[email protected]] Sent: 16 September 2010 09:55 To: Steve Bayliss Cc: [email protected] Subject: RE: [fcrepo-user] Xslt import/include other datastream from same object Hi Steve, I do not think this will work because the import statement must contain a literal uri. The only dynamics allowed is through the use-when attribute, effectively allowing a choice between a finite number of predefined imports based on the evaluation of an xpath expression. This xpath expression itself has a very limited context (no context item, no variables available, no eccess to external docs). In practise, this means that you can import one stylesheet or the other depending on environment things like the xslt version or availability of certain extension functions. I think I will stick to the <xsl:import="/fedora/get/aux:xslt/XSLT2"/> style. It works but it feels a bit like a hack. For the future, I would like to see something like <xsl:import="$THIS$/XSLT2"/>. I guess that would require a change in the URI resolver used by the Saxon service. Feature request? Regards, Egbert -----Original Message----- From: Steve Bayliss [mailto:[email protected]] Sent: woensdag 15 september 2010 18:44 To: Egbert Gramsbergen; [email protected] Subject: RE: [fcrepo-user] Xslt import/include other datastream from same object Hi Egbert Looking at the Saxon Servlet code, any URL parameters apart from "source" and "style" are passed to the transformer as parameters - so should be accessible within the stylesheet as parameters. So maybe it is possible to pass in the PID (or even a full URL) of the object, and use this in the stylesheet to build a reference to the stylesheets to include? I've not tried this out... and I'm not sure how well it would work with stylesheets that include other stylesheets, but maybe it could form the basis of a solution to this issue? You will have to declare the parameters in the stylesheet using <xsl:param name="PID"/>, and then should be able to use $PID within the rest of the stylesheet. Regards Steve -----Original Message----- From: Egbert Gramsbergen [mailto:[email protected]] Sent: 15 September 2010 14:48 To: [email protected] Subject: [fcrepo-user] Xslt import/include other datastream from same object Hi all, I am using The Saxon service with stylesheets which are all datastreams of one object. Serveral of these stylesheets import or include one or more of the other stylesheets. In Fedora 3.0 I could say, e.g. in XSLT1: <xsl:import href="XSLT2"/> where XSLT2 is the datastream ID of the imported xslt. In Fedora 3.4 this does not work. I have to say <xsl:import href="../XSLT2"/> (because the uri of the stylesheet given to the Saxon service contains the date), but if XSLT2 itself imports XSLT3, the import statement in XSLT2 must be <xsl:import href="XSLT3"/>. However, if I wish to use XSLT2 directly, it has to be <xsl:import href="../XSLT3"/>. So it is impossible to make XSLT2 so that it works both directly and as an imported stylesheet, unless I use urls which include the object name, like <xsl:import="/fedora/get/aux:xslt/XSLT2"/>. Is there a way around this? In my optimism, tried using the keyword $THIS$ (<xsl:import href="$THIS$/XSLT2"/>) in analogy to the Schema extension of DS-COMPOSITE (https://wiki.duraspace.org/display/FCREPO/DSCOMPOSITE-MODEL+and+Schemas) but that obviously does not work either. Thanks, Egbert Gramsbergen ---------------------------------------------------------------------------- -- Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev _______________________________________________ Fedora-commons-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/fedora-commons-users ------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev _______________________________________________ Fedora-commons-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/fedora-commons-users
