OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: RE: [docbook-apps] Setting the draft.watermark.image parameter value: solution


Damn. I was feeling clever and it turns out I must have just screwed up something else, somewhere else.

Odd, though; I did consider that I might have messed the Xpath, but really, how far wrong can you go with test="//watermark"? It would have to be one of my most pithy screwups ever. I also tried the precise path to the watermark's doorstep, but when all else fails, going global usually works.

I'll go back and revisit...

-----Original Message-----
From: Bob Stayton [mailto:bobs@sagehill.net]
Sent: Tuesday, March 10, 2009 10:21 AM
To: Jeff Hooker; docbook-apps@lists.oasis-open.org
Subject: Re: [docbook-apps] Setting the draft.watermark.image parameter
value: solution


Jeff,
Your solution with the processing instruction demonstrates that when global 
params are being set that the file has already been parsed and xpaths into 
the file work.   If reading a processing instruction from the file works, 
then reading an element in the file should work too.  You said reading the 
element didn't work, but perhaps there was a problem with the xpath?

Bob Stayton
Sagehill Enterprises
bobs@sagehill.net


----- Original Message ----- 
From: "Jeff Hooker" <Jeff_Hooker@pmc-sierra.com>
To: <docbook-apps@lists.oasis-open.org>
Sent: Tuesday, March 10, 2009 10:03 AM
Subject: RE: [docbook-apps] Setting the draft.watermark.image parameter 
value: solution


Hi all,

Found one thing that works, still open to others. Set the value of the 
parameter using a processing instruction like so (basically cut-and-paste 
from Bob S's Docbook XSL book):

<xsl:param name="draft.watermark.image">
    <xsl:call-template name="dbfo-attribute">
      <xsl:with-param name="pis"
        select="//processing-instruction('dbfo')"/>
      <xsl:with-param name="attribute" select="'draft.watermark.image'"/>
   </xsl:call-template>
</xsl:param>

Then I added a step to one of my preprocessing scripts that picks up the 
existence of a "watermark" element and creates the processing instruction at 
the root of the document:

<?dbfo draft.watermark.image="/docbook-xsl-1.73.2/fo/mods/watermarks.png"?>

and it's all good.

Cheers,
Jeff.

-----Original Message-----
From: Jeff Hooker [mailto:Jeff_Hooker@pmc-sierra.com]
Sent: Tuesday, March 10, 2009 9:40 AM
To: docbook-apps@lists.oasis-open.org
Subject: RE: [docbook-apps] Setting the draft.watermark.image parameter
value


Technically right, but in my situation, wrong :(

My company uses a CMS that makes setting parameter values a nightmare. This 
is the main reason that I'm trying to do an end run around having to define 
them outside of the document.

Jeff.

-----Original Message-----
From: John Brown [mailto:johnbrown105@hotmail.com]
Sent: Tuesday, March 10, 2009 9:37 AM
To: docbook-apps@lists.oasis-open.org
Subject: RE: [docbook-apps] Setting the draft.watermark.image parameter
value





Jeff Hooker wrote:

> Hi all,

> I'm trying to allow my users to set their own watermark simply
> by defining an image labeled "watermark" within their document. This
> means I need to set the value of the draft.watermark.image value
> dynamically. This is a little difficult because, as far as I can tell,
> the parameter value needs to be set before the target file is processed
> (makes sense, just inconvienent at the moment). Is there any boilerplate
> way of getting around this?

> Thanks,
> Jeff

You could set the parameter on the command line to the value in an
environment variable. Using xsltproc on Windows would give:

C:\> xsltproc --stringparam draft.watermark.image %WATERMARK% ...

Each user could set his %WATERMARK% variable to whatever he wants,
without touching the source XML at all.


_________________________________________________________________
Windows Live™: Life without walls.
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_allup_1a_explore_032009
---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org


---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org


---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org





[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]