On Thu, Feb 20, 2003 at 11:34:38AM +0000, Ulrich Mayring wrote:
> Sorry for asking here, but maybe someone can point me to a better place? 
> I've searched Google and the Apache site, but nowhere seems to be a 
> stylebook project, where I could go.
> 
> I'd like to pass parameters from the command-line to a stylesheet in an 
> ant script like this:
> 
> <java classname="${stylebook}" fork="yes">
>       <classpath refid="classpath"/>
>         <arg line="targetDirectory=foo book.xml skins/myskin 
> param=myparam"/>
> </java>
> 
> I'd like to retrieve the value of myparam in one of the stylesheets that 
> Stylebook uses to generate the docs. Can this be done? Or do I have to 
> write a separate skin for every little variation in layout?

You could use the 'sbk:' URL scheme to load an XML config file:

<properties>
  <bgcolor>#FFFFFF</bgcolor>
   ...
</properties>

Eg:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

  <xsl:variable name="config"
  select="document(sbk:properties.xml)/properties"/>
  ....
  <body bgcolor="{$config/bgcolor}">
    ....


For old abandoned code, Stylebook is pretty neat.

cvs -d :pserver:[EMAIL PROTECTED]:/home/cvspublic co xml-stylebook


--Jeff

> Thanks a lot in advance,
> 
> Ulrich
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to