[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: dyn:evaluate question

Subject: Re: dyn:evaluate question
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Thu, 24 Mar 2005 10:31:57 +1100
dyn evaluate
> I want to implement a per document view. This view extracts html
> snippets from a snippet rep. This way user from apache forrest can
> implement their own view for each document or use the default view
> without knowing xsl.

A known working solution is to dynamically modify the stylesheet (e.g.
it's DOM) by setting the value of the "href" attribute to whatever
necessary and *only then* pass this stylesheet to the XSLT processor.


Cheers,
Dimitre Novatchev


On Wed, 23 Mar 2005 14:46:55 +0100, Thorsten Scherler
<thorsten@xxxxxxxxxx> wrote:
> On Wed, 2005-03-23 at 13:19 +0000, Michael Kay wrote:
> > We used to get a lot of variations on attempts to do dynamic inclusion, but
> > this is one of the most imaginative.
> >
> 
> LOL
> 
> cheers ;-)
> 
> > xsl:include is a compile time construct, it's effect happens right at the
> > start of processing, to assemble a stylesheet for compilation. There's no
> > way a variable can be evaluated before the stylesheet has been compiled, so
> > trying to refer to a variable here simply isn't going to work.
> > dyn:evaluate() does things at run-time that would normally be done at
> > compile-time, it isn't going to enable you to do at compile time something
> > (evaluating a variable) that can only possibly be done at run-time.
> >
> > You don't need a workaround, you need a different design: but you haven't
> > said what the problem is, so I can't give you one.
> >
> 
> I want to implement a per document view. This view extracts html
> snippets from a snippet rep. This way user from apache forrest can
> implement their own view for each document or use the default view
> without knowing xsl.
> 
> sample for a view:
> <forrest:view
>  xmlns:forrest="http://apache.org/forrest/templates/1.0" type="xhtml">
> 
>  <forrest:contract name="meta"/>
> 
>  <forrest:hook name="container">
>    <forrest:hook name="branding">
>      <forrest:contract name="projectlogo"/>
>      <forrest:contract name="grouplogo"/>
>      <forrest:contract name="searchbox"/>
>      <forrest:contract name="nav-main"/>
>    </forrest:hook>
>    <forrest:hook name="spacer" />
>    <forrest:contract name="nav"/>
>    <forrest:contract name="content"/>
>  </forrest:hook>
>  <forrest:contract name="feedback"/>
> </forrest:view>
> 
> pipe:
> 
> index.html -> requested page
> 
> index.xml -> content for the page
> index.fv -> styling information about the page (as forrest:view)
> 
> Through the prepare.include.* and prepare.xhmtl.* I am calling html
> snippets from a rep based on index.fv.
> 
> On the final stylesheet I am then creating the page like
> <xhtml>
>  <head>
>    <xsl:call-template name="getHead"/>
>    <style type="text/css">
>      <xsl:call-template name="getCss"/>
>    </style>
>  </head>
> </xhtml>
> 
> cheers for any suggestions
> salu2
> 
> > Michael Kay
> > http://www.saxonica.com/
> >
> >
> >
> > > -----Original Message-----
> > > From: Thorsten Scherler [mailto:thorsten@xxxxxxxxxx]
> > > Sent: 23 March 2005 13:00
> > > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> > > Subject:  dyn:evaluate question
> > >
> > > Hello list,
> > >
> > > I am trying to dynamically include a stylesheet like this:
> > > <xsl:variable name="request">index</xsl:variable>
> > > <xsl:include href="cocoon:/prepare.include.dyn:evaluate($request)"/>
> > >
> > > but the dyn:evaluate($request) -part will not get resolved.
> > >
> > > As soon I change it to
> > > <xsl:include href="cocoon:/prepare.include.index"/>
> > > I get my stylesheets.
> > >
> > > Am I using the dyn:evaluate wrong? Are there a workaround?
> > >
> > > TIA
> > > --
> > > thorsten
> > >
> > > "Together we stand, divided we fall!"
> > > Hey you (Pink Floyd)
> >
> --
> thorsten
> 
> "Together we stand, divided we fall!"
> Hey you (Pink Floyd)

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.