This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [docbook-apps] Multiplatform processing from the same source


Dan Gilleland wrote:

Hi Paul:

My understanding is that the 'href' attribute of 'xsl:import' can't
take a parameter, so I can't pass in something system-specific from
the Makefile (which would have been clumsy but sufficient).  Is there
an XSL solution to this problem?


If you can send in something "system-specific" from the Makefile to the XSL, then all you need to do is use that parameter you were intending for the <xsl:import> and use instead in an <xsl:choose>. For example:

<xsl:choose>
 <xsl:when test="$Machine = 'FreeBSD'>
   <xsl:import ...... />
 </xsl:when>
 <xsl:when test="$Machine = 'WinXP'>
   <xsl:import ...... />
 </xsl:when>
 <xsl:otherwise>
   <xsl:import ...... />
 </xsl:otherwise>
</xsl:choose>

This might do the trick in your top-level custom stylesheet.

I don't think this will work, if I understand you correctly.


According to the excellent book "XSLT Programmer's Reference" by Mickael Kay, <xsl:import> is a top-level element, and xsl:choose is not. In other words: xsl:import must be a direct child of the xsl:stylesheet element, while xsl:choose is an instruction and must appear within a template body.

I still believe XML catalogs are the only "clean" way to solve the problem.

Best regards,

Rune Lausen



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]