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] Controlling header color from the Makefile


Unfortunately, the syntax you have suggested is not permitted in XSLT.
Putting an <xsl:choose> inside an attribute-set will yield an error because
an attribute-set only takes <xsl:attribute> child elements.  I think you
meant to put the <xsl:choose> inside each <xsl:attribute> element, since
xsl:attribute can take a template body.

<xsl:attribute-set name="attset">
  <xsl:attribute name="color">
    <xsl:choose>
      <xsl:when test="$internal.doc = '1'">black</xsl:when>
      <xsl:otherwise>blue</xsl:otherwise>
    </xsl:choose>
  </xsl:attribute>
  [other attributes defined the same way]
</xsl:attribute-set>

Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@sagehill.net


----- Original Message ----- 
From: "Thomas Schraitle" <tom_schr@web.de>
To: <docbook-apps@lists.oasis-open.org>
Sent: Friday, July 15, 2005 12:06 PM
Subject: Re: [docbook-apps] Controlling header color from the Makefile


> Hi Gurra,
>
> On Friday 15 July 2005 12:08, Gurra Green wrote:
> >
> > How would I go about to control an attribute in a attribute set from
> > the command line? Is it possible to use stringparam for that purpose?
>
> As far as I know, this is not possible. You use xmllint, right?
>
>
> > What I really want to accomplish is to graphically distinguish internal
> > documents from non-internals, e.g. by having different colors in the
> > header and footer, and control that from the command line with some
> > kind of string param "internal.doc". If that stringparam is set, I
> > would like to have one set of attributes, if not set another. I am not
> > allowed to simply have a xsl:if on the top level of the file,
> > obviously... Something like the draft mode, controlling possibly many
> > different things, but primarilly the header/footer color currently.
>
> Right, xsl:if is not possible as top level element. However, you can
> insert a xsl:choose in the attribute set like this:
>
> <xsl:param name="internal.doc">1</xsl:param>
> <xsl:attribute-set name="your.attribute.name">
>   <xsl:choose>
>    <xsl:when test="$internal.doc = '1'">
>      <!-- Insert here your xsl:attribute elements, if
>           this parameter is set -->
>      <xsl:attribute name="color">black</xsl:attribute>
>    </xsl:when>
>    <xsl:otherwise>
>      <!-- Insert here your xsl:attribute elements, if
>           this parameter is _not_ set -->
>      <xsl:attribute name="color">blue</xsl:attribute>
>     </xsl:otherwise>
>   </xsl:choose>
> </xsl:attribute-set>
>
> Probably you must insert this code in other attribute sets as well.
>
>
> > I could split the driver file in two which include the main parts, and
> > from the command line select which file to use, but is there anyhting
> > better?
>
> Attribute sets are a bit hairy. ;) As far as I know, there is no better
> solution (except the above code.)
>
> Bye,
> Tom
>
> -- 
> Thomas Schraitle
>
> ---------------------------------------------------------------------
> 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]